]>
Commit | Line | Data |
---|---|---|
b3eaeded RA |
1 | # coding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
4 | import re | |
5 | ||
6 | from .turner import TurnerBaseIE | |
c38f0681 | 7 | from ..utils import extract_attributes |
b3eaeded RA |
8 | |
9 | ||
10 | class TBSIE(TurnerBaseIE): | |
85f5a74b YCH |
11 | # https://github.com/rg3/youtube-dl/issues/13658 |
12 | _WORKING = False | |
13 | ||
b3eaeded RA |
14 | _VALID_URL = r'https?://(?:www\.)?(?P<site>tbs|tntdrama)\.com/videos/(?:[^/]+/)+(?P<id>[^/?#]+)\.html' |
15 | _TESTS = [{ | |
16 | 'url': 'http://www.tbs.com/videos/people-of-earth/season-1/extras/2007318/theatrical-trailer.html', | |
17 | 'md5': '9e61d680e2285066ade7199e6408b2ee', | |
18 | 'info_dict': { | |
19 | 'id': '2007318', | |
20 | 'ext': 'mp4', | |
21 | 'title': 'Theatrical Trailer', | |
22 | 'description': 'Catch the latest comedy from TBS, People of Earth, premiering Halloween night--Monday, October 31, at 9/8c.', | |
85f5a74b YCH |
23 | }, |
24 | 'skip': 'TBS videos are deleted after a while', | |
b3eaeded RA |
25 | }, { |
26 | 'url': 'http://www.tntdrama.com/videos/good-behavior/season-1/extras/1538823/you-better-run.html', | |
27 | 'md5': 'ce53c6ead5e9f3280b4ad2031a6fab56', | |
28 | 'info_dict': { | |
29 | 'id': '1538823', | |
30 | 'ext': 'mp4', | |
31 | 'title': 'You Better Run', | |
32 | 'description': 'Letty Raines must figure out what she\'s running toward while running away from her past. Good Behavior premieres November 15 at 9/8c.', | |
85f5a74b YCH |
33 | }, |
34 | 'skip': 'TBS videos are deleted after a while', | |
b3eaeded RA |
35 | }] |
36 | ||
37 | def _real_extract(self, url): | |
38 | domain, display_id = re.match(self._VALID_URL, url).groups() | |
39 | site = domain[:3] | |
40 | webpage = self._download_webpage(url, display_id) | |
41 | video_params = extract_attributes(self._search_regex(r'(<[^>]+id="page-video"[^>]*>)', webpage, 'video params')) | |
b3eaeded RA |
42 | query = None |
43 | clip_id = video_params.get('clipid') | |
44 | if clip_id: | |
45 | query = 'id=' + clip_id | |
46 | else: | |
47 | query = 'titleId=' + video_params['titleid'] | |
48 | return self._extract_cvp_info( | |
49 | 'http://www.%s.com/service/cvpXml?%s' % (domain, query), display_id, { | |
50 | 'default': { | |
51 | 'media_src': 'http://ht.cdn.turner.com/%s/big' % site, | |
52 | }, | |
53 | 'secure': { | |
bdcc046d | 54 | 'media_src': 'http://androidhls-secure.cdn.turner.com/%s/big' % site, |
b3eaeded RA |
55 | 'tokenizer_src': 'http://www.%s.com/video/processors/services/token_ipadAdobe.do' % domain, |
56 | }, | |
c38f0681 RA |
57 | }, { |
58 | 'url': url, | |
59 | 'site_name': site.upper(), | |
60 | 'auth_required': video_params.get('isAuthRequired') != 'false', | |
b3eaeded | 61 | }) |