From 1a814f74376e911b159fa08ba52ad1e7ca7bf2b5 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Mon, 10 Jul 2017 18:06:06 -0400 Subject: [PATCH] Adding a cassette --- rtv/mime_parsers.py | 2 +- .../test_parser[liveleak_video].yaml | 381 ++++++++++++++++++ 2 files changed, 382 insertions(+), 1 deletion(-) create mode 100644 tests/cassettes/test_parser[liveleak_video].yaml diff --git a/rtv/mime_parsers.py b/rtv/mime_parsers.py index 1054efe..e782151 100644 --- a/rtv/mime_parsers.py +++ b/rtv/mime_parsers.py @@ -230,7 +230,7 @@ class LiveleakMIMEParser(BaseMIMEParser): Sometimes only one video source is available """ - pattern = re.compile(r'https?://((www|m)\.)?liveleak\.com/view\?i\=\w+$') + pattern = re.compile(r'https?://((www|m)\.)?liveleak\.com/view\?i=\w+$') @staticmethod def get_mimetype(url): diff --git a/tests/cassettes/test_parser[liveleak_video].yaml b/tests/cassettes/test_parser[liveleak_video].yaml new file mode 100644 index 0000000..6f93910 --- /dev/null +++ b/tests/cassettes/test_parser[liveleak_video].yaml @@ -0,0 +1,381 @@ +interactions: +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [python-requests/2.17.3] + method: GET + uri: https://www.liveleak.com/view?i=08b_1499296574 + response: + body: {string: "\r\n\r\n\r\n\tLiveLeak.com + - German Tourists shoot a silenced .22\r\n \r\n \r\n \r\n \r\n + \ \r\n + \ \r\n\r\n\r\n\r\n + \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nSafe Mode: On\r\n
\r\n\t
\r\n\t\t\"\"/\r\n\r\n\t\t
\r\n\t\t\t

\r\n\t\t\t\t + \ Create Account | \r\n\t\t\t\tLog in | \r\n  \r\n \r\n \t\t\t

\r\n
\r\n\t\t\t\r\n\r\n\t\t\t
\r\n
\r\n\t\t\t\t\r\n\t\t\t\t\r\n
\r\n\t\t + \
\r\n
\r\n\r\n\t\t
\r\n\r\n\t\t\t\t\t\r\n\t
\r\n
\r\n
\r\n
\r\n\t
\r\n\t\t
+ \
\r\n \r\n
\r\n \r\n + \
\r\n
\r\n
German + Tourists shoot a silenced .22 
\r\n + \
\r\n
\r\n
\"\" Part of channel(s): Liveleakers (promoted)
\r\n

I met some German tourists passing through (father and + son) and I took them out shooting the next day. They had a good time. This + was his first shot with the silenced .22. It ended up being their favorite. + He is shooting at a bottle approximately 30 yards away.
\r\n
\r\nSilencer + makes a big difference ..... almost no noise at all.

\r\n\t\t\r\n\r\n
+ \
\r\n \r\n + \
\r\n \r\n
\r\n \r\n
\r\n + \
\r\n
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t + \
\r\n
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tAdded: + 4 days ago Occurred On: Jun-7-2017 + \
By: The + gambler
In:
Weapons, + Other Items from Liveleakers
Tags: Germany, USA, + Guns, silencer, + .22, fun, bottle
Location: Colorado, + United States (load + item map)
Marked as: featured
Views: 81322 | Comments: 333 | Votes: + 28\r\n + | Favorites: 3 + | Shared: 43 | Updates: 0 | Times + used in channels: 3 + \
\r\n \r\n
\r\n + \
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n
\r\n\r\n
\r\n\r\n + \ \r\n + \ Direct link:


\r\n Direct + link without comments:
\r\n
\r\n
+ \r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n + \
\r\n \r\n
\r\n \r\n + \
\r\n \r\n
\r\n \r\n\r\n + \
You need to be registered in order to add comments! + Register HERE
\r\n + \ \r\n \r\n\r\n \r\n
\r\n + \ \r\n
\r\n + \
\r\n\t\r\n \r\n \r\n

\r\n\r\n Advertisement below\r\n
\r\n
\r\n\r\n\r\n
\r\n + \
\r\n \r\n\r\n \r\n\r\n \r\n\r\n\r\n + \ \r\n\r\n\r\n
Liveleak + on Facebook
\r\nLIKE Liveleak.com

\r\n
Items
\r\n
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
    \r\n + \ \t\t\t\t\t\t\t
  • Related
  • \r\n \t\t\t\t\t\t\t
  • User
  • \r\n \t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t + \r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n \t\t
\r\n
Advertisers
\r\n
\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t

\r\n Advertise on Liveleak
\r\n + \ Liveleak Forums
\r\n TomoNews - Animated News
\r\n + \

\r\n
\r\n
+ \r\n \t\t
\r\n\t
\r\n
\r\n
\r\n\t
\r\n\t\t\r\n\r\n\t\t\"Web\r\n\t\tBACK + TO TOP\r\n\r\n\t
\r\n
\r\n \r\n + \ \r\n\r\n + \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"} + headers: + Access-Control-Allow-Origin: ['*'] + Cache-Control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] + Connection: [keep-alive] + Content-Type: [text/html; charset=UTF-8] + Date: ['Mon, 10 Jul 2017 22:04:43 GMT'] + Expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] + Pragma: [no-cache] + Server: [nginx/1.10.2] + Set-Cookie: [PHPSESSID=7c66aca605ccae0c962f89812dd332bc; path=/; domain=.liveleak.com, + 'liveleak_safe_mode=1; expires=Tue, 10-Jul-2018 22:04:42 GMT; Max-Age=31536000; + path=/; domain=.liveleak.com; httponly', 'liveleak_use_old_player=1; expires=Tue, + 10-Jul-2018 22:04:42 GMT; Max-Age=31536000; path=/; domain=.liveleak.com; + httponly'] + X-Powered-By: [PHP/5.6.30] + status: {code: 200, message: OK} +version: 1