]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/tlc.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
7 from .brightcove
import BrightcoveLegacyIE
14 class TlcDeIE(InfoExtractor
):
16 _VALID_URL
= r
'https?://(?:www\.)?tlc\.de/(?:[^/]+/)*videos/(?P<title>[^/?#]+)?(?:.*#(?P<id>\d+))?'
19 'url': 'http://www.tlc.de/sendungen/breaking-amish/videos/#3235167922001',
21 'id': '3235167922001',
23 'title': 'Breaking Amish: Die Welt da draußen',
25 'Vier Amische und eine Mennonitin wagen in New York'
26 ' den Sprung in ein komplett anderes Leben. Begleitet sie auf'
27 ' ihrem spannenden Weg.'),
28 'timestamp': 1396598084,
29 'upload_date': '20140404',
30 'uploader_id': '1659832546',
33 BRIGHTCOVE_URL_TEMPLATE
= 'http://players.brightcove.net/1659832546/default_default/index.html?videoId=%s'
35 def _real_extract(self
, url
):
36 mobj
= re
.match(self
._VALID
_URL
, url
)
37 brightcove_id
= mobj
.group('id')
39 title
= mobj
.group('title')
40 webpage
= self
._download
_webpage
(url
, title
)
41 brightcove_legacy_url
= BrightcoveLegacyIE
._extract
_brightcove
_url
(webpage
)
42 brightcove_id
= compat_parse_qs(compat_urlparse
.urlparse(brightcove_legacy_url
).query
)['@videoPlayer'][0]
43 return self
.url_result(self
.BRIGHTCOVE_URL_TEMPLATE
% brightcove_id
, 'BrightcoveNew', brightcove_id
)