]>
Commit | Line | Data |
---|---|---|
3cdcebf5 | 1 | # coding: utf-8 |
32dac694 PH |
2 | from __future__ import unicode_literals |
3 | ||
fc287219 | 4 | import re |
fc287219 | 5 | |
0af25f78 | 6 | from .common import InfoExtractor |
1cc79574 | 7 | from ..compat import ( |
e525d9a3 | 8 | compat_str, |
20a6a154 | 9 | compat_xpath, |
1cc79574 PH |
10 | ) |
11 | from ..utils import ( | |
fc287219 | 12 | ExtractorError, |
90834c78 | 13 | find_xpath_attr, |
5aafe895 | 14 | fix_xml_ampersands, |
8765151c | 15 | float_or_none, |
0ef68e04 | 16 | HEADRequest, |
0c75abbb | 17 | RegexNotFoundError, |
5c2266df | 18 | sanitized_Request, |
7cdfc4c9 | 19 | strip_or_none, |
712c7530 | 20 | timeconvert, |
adf063da | 21 | try_get, |
340b0468 | 22 | unescapeHTML, |
0c75abbb | 23 | update_url_query, |
8d9453b9 | 24 | url_basename, |
5767b4ee | 25 | xpath_text, |
fc287219 PH |
26 | ) |
27 | ||
90834c78 | 28 | |
300fcad8 JMF |
29 | def _media_xml_tag(tag): |
30 | return '{http://search.yahoo.com/mrss/}%s' % tag | |
fc287219 | 31 | |
f7e02595 | 32 | |
0af25f78 | 33 | class MTVServicesInfoExtractor(InfoExtractor): |
340b0468 | 34 | _MOBILE_TEMPLATE = None |
a542e372 | 35 | _LANG = None |
8940c1c0 | 36 | |
f7e02595 JMF |
37 | @staticmethod |
38 | def _id_from_uri(uri): | |
39 | return uri.split(':')[-1] | |
40 | ||
0c75abbb YCH |
41 | @staticmethod |
42 | def _remove_template_parameter(url): | |
43 | # Remove the templates, like &device={device} | |
44 | return re.sub(r'&[^=]*?={.*?}(?=(&|$))', '', url) | |
45 | ||
8940c1c0 JMF |
46 | def _get_feed_url(self, uri): |
47 | return self._FEED_URL | |
48 | ||
ab2f744b | 49 | def _get_thumbnail_url(self, uri, itemdoc): |
84db8181 JMF |
50 | search_path = '%s/%s' % (_media_xml_tag('group'), _media_xml_tag('thumbnail')) |
51 | thumb_node = itemdoc.find(search_path) | |
52 | if thumb_node is None: | |
53 | return None | |
70bfab0e | 54 | return thumb_node.get('url') or thumb_node.text or None |
f7e02595 | 55 | |
340b0468 JMF |
56 | def _extract_mobile_video_formats(self, mtvn_id): |
57 | webpage_url = self._MOBILE_TEMPLATE % mtvn_id | |
5c2266df | 58 | req = sanitized_Request(webpage_url) |
340b0468 | 59 | # Otherwise we get a webpage that would execute some javascript |
3fcfb8e9 | 60 | req.add_header('User-Agent', 'curl/7') |
340b0468 | 61 | webpage = self._download_webpage(req, mtvn_id, |
9e1a5b84 | 62 | 'Downloading mobile page') |
0ef68e04 JMF |
63 | metrics_url = unescapeHTML(self._search_regex(r'<a href="(http://metrics.+?)"', webpage, 'url')) |
64 | req = HEADRequest(metrics_url) | |
65 | response = self._request_webpage(req, mtvn_id, 'Resolving url') | |
66 | url = response.geturl() | |
67 | # Transform the url to get the best quality: | |
68 | url = re.sub(r'.+pxE=mp4', 'http://mtvnmobile.vo.llnwd.net/kip0/_pxn=0+_pxK=18639+_pxE=mp4', url, 1) | |
5f6a1245 | 69 | return [{'url': url, 'ext': 'mp4'}] |
340b0468 | 70 | |
dbaf6016 | 71 | def _extract_video_formats(self, mdoc, mtvn_id, video_id): |
054d43bb | 72 | if re.match(r'.*/(error_country_block\.swf|geoblock\.mp4|copyright_error\.flv(?:\?geo\b.+?)?)$', mdoc.find('.//src').text) is not None: |
340b0468 | 73 | if mtvn_id is not None and self._MOBILE_TEMPLATE is not None: |
0ef68e04 | 74 | self.to_screen('The normal version is not available from your ' |
9e1a5b84 | 75 | 'country, trying with the mobile version') |
340b0468 | 76 | return self._extract_mobile_video_formats(mtvn_id) |
cc1db7f9 | 77 | raise ExtractorError('This video is not available from your country.', |
9e1a5b84 | 78 | expected=True) |
f7e02595 | 79 | |
f13d0933 PH |
80 | formats = [] |
81 | for rendition in mdoc.findall('.//rendition'): | |
20faad74 | 82 | if rendition.get('method') == 'hls': |
dbaf6016 | 83 | hls_url = rendition.find('./src').text |
cdd11c05 | 84 | formats.extend(self._extract_m3u8_formats( |
adf063da | 85 | hls_url, video_id, ext='mp4', entry_protocol='m3u8_native', |
e0f1fb0a | 86 | m3u8_id='hls', fatal=False)) |
dbaf6016 PH |
87 | else: |
88 | # fms | |
89 | try: | |
90 | _, _, ext = rendition.attrib['type'].partition('/') | |
91 | rtmp_video_url = rendition.find('./src').text | |
adf063da S |
92 | if 'error_not_available.swf' in rtmp_video_url: |
93 | raise ExtractorError( | |
94 | '%s said: video is not available' % self.IE_NAME, | |
95 | expected=True) | |
dbaf6016 PH |
96 | if rtmp_video_url.endswith('siteunavail.png'): |
97 | continue | |
dbaf6016 | 98 | formats.extend([{ |
adf063da S |
99 | 'ext': 'flv' if rtmp_video_url.startswith('rtmp') else ext, |
100 | 'url': rtmp_video_url, | |
101 | 'format_id': '-'.join(filter(None, [ | |
102 | 'rtmp' if rtmp_video_url.startswith('rtmp') else None, | |
103 | rendition.get('bitrate')])), | |
dbaf6016 PH |
104 | 'width': int(rendition.get('width')), |
105 | 'height': int(rendition.get('height')), | |
adf063da | 106 | }]) |
dbaf6016 PH |
107 | except (KeyError, TypeError): |
108 | raise ExtractorError('Invalid rendition field.') | |
e0f1fb0a S |
109 | if formats: |
110 | self._sort_formats(formats) | |
f13d0933 | 111 | return formats |
f7e02595 | 112 | |
e525d9a3 S |
113 | def _extract_subtitles(self, mdoc, mtvn_id): |
114 | subtitles = {} | |
e525d9a3 S |
115 | for transcript in mdoc.findall('.//transcript'): |
116 | if transcript.get('kind') != 'captions': | |
117 | continue | |
118 | lang = transcript.get('srclang') | |
5ea765fb RA |
119 | for typographic in transcript.findall('./typographic'): |
120 | sub_src = typographic.get('src') | |
121 | if not sub_src: | |
122 | continue | |
123 | ext = typographic.get('format') | |
124 | if ext == 'cea-608': | |
125 | ext = 'scc' | |
126 | subtitles.setdefault(lang, []).append({ | |
127 | 'url': compat_str(sub_src), | |
128 | 'ext': ext | |
129 | }) | |
0af25f78 | 130 | return subtitles |
e525d9a3 | 131 | |
67fc365b | 132 | def _get_video_info(self, itemdoc, use_hls=True): |
f7e02595 JMF |
133 | uri = itemdoc.find('guid').text |
134 | video_id = self._id_from_uri(uri) | |
135 | self.report_extraction(video_id) | |
04cbc498 | 136 | content_el = itemdoc.find('%s/%s' % (_media_xml_tag('group'), _media_xml_tag('content'))) |
0c75abbb | 137 | mediagen_url = self._remove_template_parameter(content_el.attrib['url']) |
dbaf6016 | 138 | mediagen_url = mediagen_url.replace('device={device}', '') |
f7e02595 | 139 | if 'acceptMethods' not in mediagen_url: |
56f447be | 140 | mediagen_url += '&' if '?' in mediagen_url else '?' |
dbaf6016 PH |
141 | mediagen_url += 'acceptMethods=' |
142 | mediagen_url += 'hls' if use_hls else 'fms' | |
6562df76 | 143 | |
e0f1fb0a S |
144 | mediagen_doc = self._download_xml( |
145 | mediagen_url, video_id, 'Downloading video urls', fatal=False) | |
146 | ||
147 | if mediagen_doc is False: | |
148 | return None | |
f7e02595 | 149 | |
0dfe9bc9 S |
150 | item = mediagen_doc.find('./video/item') |
151 | if item is not None and item.get('type') == 'text': | |
152 | message = '%s returned error: ' % self.IE_NAME | |
153 | if item.get('code') is not None: | |
154 | message += '%s - ' % item.get('code') | |
155 | message += item.text | |
156 | raise ExtractorError(message, expected=True) | |
157 | ||
7cdfc4c9 | 158 | description = strip_or_none(xpath_text(itemdoc, 'description')) |
f13d0933 | 159 | |
712c7530 YCH |
160 | timestamp = timeconvert(xpath_text(itemdoc, 'pubDate')) |
161 | ||
90834c78 PH |
162 | title_el = None |
163 | if title_el is None: | |
164 | title_el = find_xpath_attr( | |
165 | itemdoc, './/{http://search.yahoo.com/mrss/}category', | |
166 | 'scheme', 'urn:mtvn:video_title') | |
90834c78 | 167 | if title_el is None: |
20a6a154 | 168 | title_el = itemdoc.find(compat_xpath('.//{http://search.yahoo.com/mrss/}title')) |
96cb10a5 | 169 | if title_el is None: |
20a6a154 | 170 | title_el = itemdoc.find(compat_xpath('.//title')) |
1df4229b PH |
171 | if title_el.text is None: |
172 | title_el = None | |
1df4229b | 173 | |
90834c78 PH |
174 | title = title_el.text |
175 | if title is None: | |
176 | raise ExtractorError('Could not find video title') | |
780ee4e5 | 177 | title = title.strip() |
90834c78 | 178 | |
340b0468 JMF |
179 | # This a short id that's used in the webpage urls |
180 | mtvn_id = None | |
181 | mtvn_id_node = find_xpath_attr(itemdoc, './/{http://search.yahoo.com/mrss/}category', | |
9e1a5b84 | 182 | 'scheme', 'urn:mtvn:id') |
340b0468 JMF |
183 | if mtvn_id_node is not None: |
184 | mtvn_id = mtvn_id_node.text | |
185 | ||
dbaf6016 PH |
186 | formats = self._extract_video_formats(mediagen_doc, mtvn_id, video_id) |
187 | ||
e0f1fb0a S |
188 | # Some parts of complete video may be missing (e.g. missing Act 3 in |
189 | # http://www.southpark.de/alle-episoden/s14e01-sexual-healing) | |
190 | if not formats: | |
191 | return None | |
192 | ||
193 | self._sort_formats(formats) | |
194 | ||
fb7abb31 | 195 | return { |
90834c78 | 196 | 'title': title, |
dbaf6016 | 197 | 'formats': formats, |
e525d9a3 | 198 | 'subtitles': self._extract_subtitles(mediagen_doc, mtvn_id), |
f13d0933 PH |
199 | 'id': video_id, |
200 | 'thumbnail': self._get_thumbnail_url(uri, itemdoc), | |
201 | 'description': description, | |
04cbc498 | 202 | 'duration': float_or_none(content_el.attrib.get('duration')), |
712c7530 | 203 | 'timestamp': timestamp, |
f13d0933 PH |
204 | } |
205 | ||
c1e90619 | 206 | def _get_feed_query(self, uri): |
207 | data = {'uri': uri} | |
208 | if self._LANG: | |
209 | data['lang'] = self._LANG | |
0c75abbb | 210 | return data |
c1e90619 | 211 | |
67fc365b | 212 | def _get_videos_info(self, uri, use_hls=True): |
f7e02595 | 213 | video_id = self._id_from_uri(uri) |
8940c1c0 | 214 | feed_url = self._get_feed_url(uri) |
0c75abbb | 215 | info_url = update_url_query(feed_url, self._get_feed_query(uri)) |
dbaf6016 | 216 | return self._get_videos_info_from_url(info_url, video_id, use_hls) |
79fa9db0 | 217 | |
67fc365b | 218 | def _get_videos_info_from_url(self, url, video_id, use_hls=True): |
e2b38da9 | 219 | idoc = self._download_xml( |
79fa9db0 | 220 | url, video_id, |
32dac694 | 221 | 'Downloading info', transform_source=fix_xml_ampersands) |
712c7530 YCH |
222 | |
223 | title = xpath_text(idoc, './channel/title') | |
224 | description = xpath_text(idoc, './channel/description') | |
225 | ||
e0f1fb0a S |
226 | entries = [] |
227 | for item in idoc.findall('.//item'): | |
228 | info = self._get_video_info(item, use_hls) | |
229 | if info: | |
230 | entries.append(info) | |
231 | ||
5239075b | 232 | return self.playlist_result( |
e0f1fb0a | 233 | entries, playlist_title=title, playlist_description=description) |
fc287219 | 234 | |
adf063da S |
235 | def _extract_triforce_mgid(self, webpage, data_zone=None, video_id=None): |
236 | triforce_feed = self._parse_json(self._search_regex( | |
f1e70fc2 | 237 | r'triforceManifestFeed\s*=\s*({.+?})\s*;\s*\n', webpage, |
adf063da S |
238 | 'triforce feed', default='{}'), video_id, fatal=False) |
239 | ||
240 | data_zone = self._search_regex( | |
241 | r'data-zone=(["\'])(?P<zone>.+?_lc_promo.*?)\1', webpage, | |
242 | 'data zone', default=data_zone, group='zone') | |
243 | ||
244 | feed_url = try_get( | |
245 | triforce_feed, lambda x: x['manifest']['zones'][data_zone]['feed'], | |
246 | compat_str) | |
247 | if not feed_url: | |
248 | return | |
249 | ||
250 | feed = self._download_json(feed_url, video_id, fatal=False) | |
251 | if not feed: | |
252 | return | |
253 | ||
254 | return try_get(feed, lambda x: x['result']['data']['id'], compat_str) | |
255 | ||
256 | def _extract_mgid(self, webpage): | |
8d9453b9 | 257 | try: |
4bbf139a JMF |
258 | # the url can be http://media.mtvnservices.com/fb/{mgid}.swf |
259 | # or http://media.mtvnservices.com/{mgid} | |
260 | og_url = self._og_search_video_url(webpage) | |
261 | mgid = url_basename(og_url) | |
262 | if mgid.endswith('.swf'): | |
263 | mgid = mgid[:-4] | |
8d9453b9 | 264 | except RegexNotFoundError: |
b1298d8e AMW |
265 | mgid = None |
266 | ||
267 | if mgid is None or ':' not in mgid: | |
b9381e43 | 268 | mgid = self._search_regex( |
197224b7 | 269 | [r'data-mgid="(.*?)"', r'swfobject\.embedSWF\(".*?(mgid:.*?)"'], |
fc42bc6e S |
270 | webpage, 'mgid', default=None) |
271 | ||
272 | if not mgid: | |
273 | sm4_embed = self._html_search_meta( | |
274 | 'sm4:video:embed', webpage, 'sm4 embed', default='') | |
275 | mgid = self._search_regex( | |
adf063da S |
276 | r'embed/(mgid:.+?)["\'&?/]', sm4_embed, 'mgid', default=None) |
277 | ||
278 | if not mgid: | |
279 | mgid = self._extract_triforce_mgid(webpage) | |
280 | ||
c1e90619 | 281 | return mgid |
e525d9a3 | 282 | |
c1e90619 | 283 | def _real_extract(self, url): |
284 | title = url_basename(url) | |
285 | webpage = self._download_webpage(url, title) | |
286 | mgid = self._extract_mgid(webpage) | |
e525d9a3 | 287 | videos_info = self._get_videos_info(mgid) |
e525d9a3 | 288 | return videos_info |
8d9453b9 | 289 | |
84db8181 | 290 | |
8940c1c0 JMF |
291 | class MTVServicesEmbeddedIE(MTVServicesInfoExtractor): |
292 | IE_NAME = 'mtvservices:embedded' | |
293 | _VALID_URL = r'https?://media\.mtvnservices\.com/embed/(?P<mgid>.+?)(\?|/|$)' | |
294 | ||
295 | _TEST = { | |
296 | # From http://www.thewrap.com/peter-dinklage-sums-up-game-of-thrones-in-45-seconds-video/ | |
297 | 'url': 'http://media.mtvnservices.com/embed/mgid:uma:video:mtv.com:1043906/cp~vid%3D1043906%26uri%3Dmgid%3Auma%3Avideo%3Amtv.com%3A1043906', | |
298 | 'md5': 'cb349b21a7897164cede95bd7bf3fbb9', | |
299 | 'info_dict': { | |
300 | 'id': '1043906', | |
301 | 'ext': 'mp4', | |
302 | 'title': 'Peter Dinklage Sums Up \'Game Of Thrones\' In 45 Seconds', | |
303 | 'description': '"Sexy sexy sexy, stabby stabby stabby, beautiful language," says Peter Dinklage as he tries summarizing "Game of Thrones" in under a minute.', | |
712c7530 YCH |
304 | 'timestamp': 1400126400, |
305 | 'upload_date': '20140515', | |
8940c1c0 JMF |
306 | }, |
307 | } | |
308 | ||
fe1d858e S |
309 | @staticmethod |
310 | def _extract_url(webpage): | |
311 | mobj = re.search( | |
312 | r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//media.mtvnservices.com/embed/.+?)\1', webpage) | |
313 | if mobj: | |
314 | return mobj.group('url') | |
315 | ||
8940c1c0 JMF |
316 | def _get_feed_url(self, uri): |
317 | video_id = self._id_from_uri(uri) | |
0c75abbb YCH |
318 | config = self._download_json( |
319 | 'http://media.mtvnservices.com/pmt/e1/access/index.html?uri=%s&configtype=edge' % uri, video_id) | |
320 | return self._remove_template_parameter(config['feedWithQueryParams']) | |
8940c1c0 JMF |
321 | |
322 | def _real_extract(self, url): | |
323 | mobj = re.match(self._VALID_URL, url) | |
324 | mgid = mobj.group('mgid') | |
325 | return self._get_videos_info(mgid) | |
326 | ||
327 | ||
84db8181 | 328 | class MTVIE(MTVServicesInfoExtractor): |
a54ffb8a | 329 | IE_NAME = 'mtv' |
cf0cabbe | 330 | _VALID_URL = r'https?://(?:www\.)?mtv\.com/(?:video-clips|(?:full-)?episodes)/(?P<id>[^/?#.]+)' |
8add4bfe RA |
331 | _FEED_URL = 'http://www.mtv.com/feeds/mrss/' |
332 | ||
333 | _TESTS = [{ | |
334 | 'url': 'http://www.mtv.com/video-clips/vl8qof/unlocking-the-truth-trailer', | |
335 | 'md5': '1edbcdf1e7628e414a8c5dcebca3d32b', | |
336 | 'info_dict': { | |
337 | 'id': '5e14040d-18a4-47c4-a582-43ff602de88e', | |
338 | 'ext': 'mp4', | |
339 | 'title': 'Unlocking The Truth|July 18, 2016|1|101|Trailer', | |
340 | 'description': '"Unlocking the Truth" premieres August 17th at 11/10c.', | |
341 | 'timestamp': 1468846800, | |
342 | 'upload_date': '20160718', | |
343 | }, | |
344 | }, { | |
345 | 'url': 'http://www.mtv.com/full-episodes/94tujl/unlocking-the-truth-gates-of-hell-season-1-ep-101', | |
346 | 'only_matching': True, | |
cf0cabbe S |
347 | }, { |
348 | 'url': 'http://www.mtv.com/episodes/g8xu7q/teen-mom-2-breaking-the-wall-season-7-ep-713', | |
349 | 'only_matching': True, | |
8add4bfe RA |
350 | }] |
351 | ||
352 | ||
3cdcebf5 RA |
353 | class MTVJapanIE(MTVServicesInfoExtractor): |
354 | IE_NAME = 'mtvjapan' | |
355 | _VALID_URL = r'https?://(?:www\.)?mtvjapan\.com/videos/(?P<id>[0-9a-z]+)' | |
008f2470 S |
356 | |
357 | _TEST = { | |
3cdcebf5 | 358 | 'url': 'http://www.mtvjapan.com/videos/prayht/fresh-info-cadillac-escalade', |
008f2470 | 359 | 'info_dict': { |
3cdcebf5 | 360 | 'id': 'bc01da03-6fe5-4284-8880-f291f4e368f5', |
008f2470 | 361 | 'ext': 'mp4', |
3cdcebf5 RA |
362 | 'title': '【Fresh Info】Cadillac ESCALADE Sport Edition', |
363 | }, | |
364 | 'params': { | |
365 | 'skip_download': True, | |
008f2470 S |
366 | }, |
367 | } | |
3cdcebf5 RA |
368 | _GEO_COUNTRIES = ['JP'] |
369 | _FEED_URL = 'http://feeds.mtvnservices.com/od/feed/intl-mrss-player-feed' | |
008f2470 | 370 | |
3cdcebf5 RA |
371 | def _get_feed_query(self, uri): |
372 | return { | |
373 | 'arcEp': 'mtvjapan.com', | |
374 | 'mgid': uri, | |
375 | } | |
008f2470 S |
376 | |
377 | ||
8add4bfe | 378 | class MTVVideoIE(MTVServicesInfoExtractor): |
a54ffb8a | 379 | IE_NAME = 'mtv:video' |
5c541b2c JMF |
380 | _VALID_URL = r'''(?x)^https?:// |
381 | (?:(?:www\.)?mtv\.com/videos/.+?/(?P<videoid>[0-9]+)/[^/]+$| | |
382 | m\.mtv\.com/videos/video\.rbml\?.*?id=(?P<mgid>[^&]+))''' | |
84db8181 JMF |
383 | |
384 | _FEED_URL = 'http://www.mtv.com/player/embed/AS3/rss/' | |
385 | ||
386 | _TESTS = [ | |
387 | { | |
32dac694 | 388 | 'url': 'http://www.mtv.com/videos/misc/853555/ours-vh1-storytellers.jhtml', |
32dac694 PH |
389 | 'md5': '850f3f143316b1e71fa56a4edfd6e0f8', |
390 | 'info_dict': { | |
ca0f500e PH |
391 | 'id': '853555', |
392 | 'ext': 'mp4', | |
32dac694 PH |
393 | 'title': 'Taylor Swift - "Ours (VH1 Storytellers)"', |
394 | 'description': 'Album: Taylor Swift performs "Ours" for VH1 Storytellers at Harvey Mudd College.', | |
712c7530 YCH |
395 | 'timestamp': 1352610000, |
396 | 'upload_date': '20121111', | |
84db8181 JMF |
397 | }, |
398 | }, | |
84db8181 JMF |
399 | ] |
400 | ||
401 | def _get_thumbnail_url(self, uri, itemdoc): | |
402 | return 'http://mtv.mtvnimages.com/uri/' + uri | |
403 | ||
fc287219 PH |
404 | def _real_extract(self, url): |
405 | mobj = re.match(self._VALID_URL, url) | |
fc287219 | 406 | video_id = mobj.group('videoid') |
c801b205 | 407 | uri = mobj.groupdict().get('mgid') |
5c541b2c JMF |
408 | if uri is None: |
409 | webpage = self._download_webpage(url, video_id) | |
5f6a1245 | 410 | |
5c541b2c | 411 | # Some videos come from Vevo.com |
ca0f500e PH |
412 | m_vevo = re.search( |
413 | r'(?s)isVevoVideo = true;.*?vevoVideoId = "(.*?)";', webpage) | |
5c541b2c | 414 | if m_vevo: |
8bcc8756 | 415 | vevo_id = m_vevo.group(1) |
32dac694 | 416 | self.to_screen('Vevo video detected: %s' % vevo_id) |
5c541b2c | 417 | return self.url_result('vevo:%s' % vevo_id, ie='Vevo') |
5f6a1245 | 418 | |
32dac694 | 419 | uri = self._html_search_regex(r'/uri/(.*?)\?', webpage, 'uri') |
f7e02595 | 420 | return self._get_videos_info(uri) |
bc4ba05f JMF |
421 | |
422 | ||
071c1013 PH |
423 | class MTVDEIE(MTVServicesInfoExtractor): |
424 | IE_NAME = 'mtv.de' | |
cfabc505 | 425 | _VALID_URL = r'https?://(?:www\.)?mtv\.de/(?:musik/videoclips|folgen|news)/(?P<id>[0-9a-z]+)' |
79fa9db0 | 426 | _TESTS = [{ |
cfabc505 | 427 | 'url': 'http://www.mtv.de/musik/videoclips/2gpnv7/Traum', |
79fa9db0 | 428 | 'info_dict': { |
cfabc505 RA |
429 | 'id': 'd5d472bc-f5b7-11e5-bffd-a4badb20dab5', |
430 | 'ext': 'mp4', | |
431 | 'title': 'Traum', | |
432 | 'description': 'Traum', | |
071c1013 | 433 | }, |
79fa9db0 S |
434 | 'params': { |
435 | # rtmp download | |
436 | 'skip_download': True, | |
437 | }, | |
35f6e0ff | 438 | 'skip': 'Blocked at Travis CI', |
c3c9f879 S |
439 | }, { |
440 | # mediagen URL without query (e.g. http://videos.mtvnn.com/mediagen/e865da714c166d18d6f80893195fcb97) | |
cfabc505 | 441 | 'url': 'http://www.mtv.de/folgen/6b1ylu/teen-mom-2-enthuellungen-S5-F1', |
c3c9f879 | 442 | 'info_dict': { |
cfabc505 RA |
443 | 'id': '1e5a878b-31c5-11e7-a442-0e40cf2fc285', |
444 | 'ext': 'mp4', | |
445 | 'title': 'Teen Mom 2', | |
446 | 'description': 'md5:dc65e357ef7e1085ed53e9e9d83146a7', | |
c3c9f879 S |
447 | }, |
448 | 'params': { | |
449 | # rtmp download | |
450 | 'skip_download': True, | |
451 | }, | |
35f6e0ff | 452 | 'skip': 'Blocked at Travis CI', |
65488b82 | 453 | }, { |
cfabc505 | 454 | 'url': 'http://www.mtv.de/news/glolix/77491-mtv-movies-spotlight--pixels--teil-3', |
65488b82 S |
455 | 'info_dict': { |
456 | 'id': 'local_playlist-4e760566473c4c8c5344', | |
457 | 'ext': 'mp4', | |
458 | 'title': 'Article_mtv-movies-spotlight-pixels-teil-3_short-clips_part1', | |
459 | 'description': 'MTV Movies Supercut', | |
460 | }, | |
461 | 'params': { | |
462 | # rtmp download | |
463 | 'skip_download': True, | |
464 | }, | |
712c7530 | 465 | 'skip': 'Das Video kann zur Zeit nicht abgespielt werden.', |
79fa9db0 | 466 | }] |
cfabc505 RA |
467 | _GEO_COUNTRIES = ['DE'] |
468 | _FEED_URL = 'http://feeds.mtvnservices.com/od/feed/intl-mrss-player-feed' | |
071c1013 | 469 | |
cfabc505 RA |
470 | def _get_feed_query(self, uri): |
471 | return { | |
472 | 'arcEp': 'mtv.de', | |
473 | 'mgid': uri, | |
474 | } |