]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/trutv.py
2 from __future__
import unicode_literals
6 from .turner
import TurnerBaseIE
9 class TruTVIE(TurnerBaseIE
):
10 _VALID_URL
= r
'https?://(?:www\.)?trutv\.com(?:(?P<path>/shows/[^/]+/videos/[^/?#]+?)\.html|/full-episodes/[^/]+/(?P<id>\d+))'
12 'url': 'http://www.trutv.com/shows/10-things/videos/you-wont-believe-these-sports-bets.html',
13 'md5': '2cdc844f317579fed1a7251b087ff417',
15 'id': '/shows/10-things/videos/you-wont-believe-these-sports-bets',
17 'title': 'You Won\'t Believe These Sports Bets',
18 'description': 'Jamie Lee sits down with a bookie to discuss the bizarre world of illegal sports betting.',
19 'upload_date': '20130305',
23 def _real_extract(self
, url
):
24 path
, video_id
= re
.match(self
._VALID
_URL
, url
).groups()
27 data_src
= 'http://www.trutv.com/video/cvp/v2/xml/content.xml?id=%s.xml' % path
29 webpage
= self
._download
_webpage
(url
, video_id
)
30 video_id
= self
._search
_regex
(
31 r
"TTV\.TVE\.episodeId\s*=\s*'([^']+)';",
32 webpage
, 'video id', default
=video_id
)
33 auth_required
= self
._search
_regex
(
34 r
'TTV\.TVE\.authRequired\s*=\s*(true|false);',
35 webpage
, 'auth required', default
='false') == 'true'
36 data_src
= 'http://www.trutv.com/tveverywhere/services/cvpXML.do?titleId=' + video_id
37 return self
._extract
_cvp
_info
(
40 'media_src': 'http://androidhls-secure.cdn.turner.com/trutv/big',
41 'tokenizer_src': 'http://www.trutv.com/tveverywhere/processors/services/token_ipadAdobe.do',
46 'auth_required': auth_required
,