utils: Remove blank line at the end of file
[youtube-dl] / youtube_dl / extractor / play44.py
1 from __future__ import unicode_literals
2
3 from .common import InfoExtractor
4 from ..utils import (
5     compat_urllib_parse
6 )
7
8
9 class Play44IE(InfoExtractor):
10     _VALID_URL = r'http://[w.]*play44\.net/embed\.php[^/]*/(?P<id>.+)'
11
12     _TESTS = [{
13         'url': 'http://play44.net/embed.php?w=600&h=438&vid=M/mahou-shoujo-madoka-magica-07.flv',
14         'md5': 'e37e99d665f503dd2db952f7c4dba9e6',
15         'info_dict': {
16             'id': 'mahou-shoujo-madoka-magica-07',
17             'ext': 'flv',
18             'title': 'mahou-shoujo-madoka-magica-07',
19         }
20     }]
21
22     def _real_extract(self, url):
23         video_id = self._match_id(url)
24         page = self._download_webpage(url, video_id)
25
26         video_url = compat_urllib_parse.unquote(self._html_search_regex(
27             r'_url = "(https?://[^"]+?)";', page, 'url'))
28         title = self._search_regex(r'.*/(?P<title>[^.]*).', video_url, 'title')
29
30         return {
31             'id': title,
32             'url': video_url,
33             'title': title,
34         }
35
36
37 class ByZooIE(Play44IE):
38     _VALID_URL = r'http://[w.]*byzoo\.org/embed\.php[^/]*/(?P<id>.+)'
39
40     _TESTS = [{
41         'url': 'http://byzoo.org/embed.php?w=600&h=438&vid=at/nw/mahou_shoujo_madoka_magica_movie_3_-_part1.mp4',
42         'md5': '455c83dabe2cd9fd74a87612b01fe017',
43         'info_dict': {
44             'id': 'mahou_shoujo_madoka_magica_movie_3_-_part1',
45             'ext': 'mp4',
46             'title': 'mahou_shoujo_madoka_magica_movie_3_-_part1',
47         }
48     }]
49
50
51 class Video44IE(Play44IE):
52     _VALID_URL = r'http://[w.]*video44\.net/.*file=(?P<id>[^&].).*'
53
54     _TESTS = [{
55         'url': 'http://www.video44.net/gogo/?w=600&h=438&file=chaoshead-12.flv&sv=1',
56         'md5': '43eaec6d0beb10e8d42459b9f108aff3',
57         'info_dict': {
58             'id': 'chaoshead-12',
59             'ext': 'mp4',
60             'title': 'chaoshead-12',
61         }
62     }]
63
64
65 class VideoWingIE(Play44IE):
66     _VALID_URL = r'''(?x)
67         http://[w.]*videowing\.[^/]*/
68         (?:
69             .*video=/*
70             |embed/
71         )
72         (?P<id>[^&?.]+)
73     '''
74
75     _TESTS = [{
76         'url': 'http://videowing.me/embed?w=718&h=438&video=ongoing/boku_wa_tomodachi_ga_sukunai_-_05.mp4',
77         'md5': '4ed320e353ed26c742c4f12a9c210b60',
78         'info_dict': {
79             'id': 'boku_wa_tomodachi_ga_sukunai_-_05',
80             'ext': 'mp4',
81             'title': 'boku_wa_tomodachi_ga_sukunai_-_05',
82         }
83     }, {
84         'url': 'http://videowing.me/embed/a8d6a39522df066bd734a69f2334497e?w=600&h=438',
85         'md5': '33fdd71581357018c226f95c5cedcfd7',
86         'info_dict': {
87             'id': 'mahoushoujomadokamagicamovie1part1',
88             'ext': 'flv',
89             'title': 'mahoushoujomadokamagicamovie1part1',
90         }
91     }]
92
93
94 class PlayPandaIE(Play44IE):
95     _VALID_URL = r'http://[w.]*playpanda\.[^/]*/.*vid=/*(?P<id>[^&].).*'
96
97     _TESTS = [{
98         'url': 'http://playpanda.net/embed.php?w=718&h=438&vid=at/nw/boku_wa_tomodachi_ga_sukunai_-_05.mp4',
99         'md5': '4ed320e353ed26c742c4f12a9c210b60',
100         'info_dict': {
101             'id': 'boku_wa_tomodachi_ga_sukunai_-_05',
102             'ext': 'mp4',
103             'title': 'boku_wa_tomodachi_ga_sukunai_-_05',
104             'description': 'boku_wa_tomodachi_ga_sukunai_-_05'
105         }
106     }]
107
108
109 class VideoZooIE(Play44IE):
110     _VALID_URL = r'http://[w.]*videozoo\.[^/]*/.*vid=/*(?P<id>[^&].).*'
111
112     _TESTS = [{
113         'url': 'http://videozoo.me/embed.php?w=718&h=438&vid=at/nw/boku_wa_tomodachi_ga_sukunai_-_05.mp4',
114         'md5': '4ed320e353ed26c742c4f12a9c210b60',
115         'info_dict': {
116             'id': 'boku_wa_tomodachi_ga_sukunai_-_05',
117             'ext': 'mp4',
118             'title': 'boku_wa_tomodachi_ga_sukunai_-_05',
119         }
120     }]
121
122
123 class PlayBBIE(Play44IE):
124     _VALID_URL = r'http://[w.]*playbb\.[^/]*/.*vid=/*(?P<id>[^&].).*'
125
126     _TESTS = [{
127         'url': 'http://playbb.me/embed.php?w=718&h=438&vid=at/nw/boku_wa_tomodachi_ga_sukunai_-_05.mp4',
128         'md5': '4ed320e353ed26c742c4f12a9c210b60',
129         'info_dict': {
130             'id': 'boku_wa_tomodachi_ga_sukunai_-_05',
131             'ext': 'mp4',
132             'title': 'boku_wa_tomodachi_ga_sukunai_-_05',
133         }
134     }]
135
136
137 class EasyVideoIE(Play44IE):
138     _VALID_URL = r'http://[w.]*easyvideo\.[^/]*/.*file=/*(?P<id>[^&.]+)'
139
140     _TESTS = [{
141         'url': 'http://easyvideo.me/gogo/?w=718&h=438&file=bokuwatomodachigasukunai-04.flv&sv=1',
142         'md5': '26178b57629b7650106d72b191137176',
143         'info_dict': {
144             'id': 'bokuwatomodachigasukunai-04',
145             'ext': 'mp4',
146             'title': 'bokuwatomodachigasukunai-04',
147         },
148         'skip': 'Blocked in Germany',
149     }]