]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/tlc.py
adc05ed5f077594302482257e35efa764e2d1773
2 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from .brightcove
import BrightcoveLegacyIE
7 from ..compat
import compat_urlparse
10 class TlcDeIE(InfoExtractor
):
12 _VALID_URL
= r
'http://www\.tlc\.de/sendungen/[^/]+/videos/(?P<title>[^/?]+)'
15 'url': 'http://www.tlc.de/sendungen/breaking-amish/videos/#3235167922001',
17 'id': '3235167922001',
19 'title': 'Breaking Amish: Die Welt da draußen',
20 'uploader': 'Discovery Networks - Germany',
22 'Vier Amische und eine Mennonitin wagen in New York'
23 ' den Sprung in ein komplett anderes Leben. Begleitet sie auf'
24 ' ihrem spannenden Weg.'),
28 def _real_extract(self
, url
):
29 mobj
= re
.match(self
._VALID
_URL
, url
)
30 title
= mobj
.group('title')
31 webpage
= self
._download
_webpage
(url
, title
)
32 iframe_url
= self
._search
_regex
(
33 '<iframe src="(http://www\.tlc\.de/wp-content/.+?)"', webpage
,
35 # Otherwise we don't get the correct 'BrightcoveExperience' element,
36 # example: http://www.tlc.de/sendungen/cake-boss/videos/cake-boss-cannoli-drama/
37 iframe_url
= iframe_url
.replace('.htm?', '.php?')
38 url_fragment
= compat_urlparse
.urlparse(url
).fragment
40 # Since the fragment is not send to the server, we always get the same iframe
41 iframe_url
= re
.sub(r
'playlist=(\d+)', 'playlist=%s' % url_fragment
, iframe_url
)
42 iframe
= self
._download
_webpage
(iframe_url
, title
)
46 'url': BrightcoveLegacyIE
._extract
_brightcove
_url
(iframe
),
47 'ie': BrightcoveLegacyIE
.ie_key(),