]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/faz.py
cebdd0193a82eaccc673dffe9d001f766e9e31d1
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
7 class FazIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?faz\.net/(?:[^/]+/)*.*?-(?P<id>\d+)\.html'
12 'url': 'http://www.faz.net/multimedia/videos/stockholm-chemie-nobelpreis-fuer-drei-amerikanische-forscher-12610585.html',
16 'title': 'Stockholm: Chemie-Nobelpreis für drei amerikanische Forscher',
17 'description': 'md5:1453fbf9a0d041d985a47306192ea253',
20 'url': 'http://www.faz.net/aktuell/politik/berlin-gabriel-besteht-zerreissprobe-ueber-datenspeicherung-13659345.html',
21 'only_matching': True,
23 'url': 'http://www.faz.net/berlin-gabriel-besteht-zerreissprobe-ueber-datenspeicherung-13659345.html',
24 'only_matching': True,
26 'url': 'http://www.faz.net/-13659345.html',
27 'only_matching': True,
29 'url': 'http://www.faz.net/aktuell/politik/-13659345.html',
30 'only_matching': True,
32 'url': 'http://www.faz.net/foobarblafasel-13659345.html',
33 'only_matching': True,
36 def _real_extract(self
, url
):
37 video_id
= self
._match
_id
(url
)
39 webpage
= self
._download
_webpage
(url
, video_id
)
40 config_xml_url
= self
._search
_regex
(
41 r
'writeFLV\(\'(.+?
)\',', webpage, 'config xml url
')
42 config = self._download_xml(
43 config_xml_url, video_id, 'Downloading config xml
')
45 encodings = config.find('ENCODINGS
')
47 for pref, code in enumerate(['LOW
', 'HIGH
', 'HQ
']):
48 encoding = encodings.find(code)
51 encoding_url = encoding.find('FILENAME
').text
54 'format_id
': code.lower(),
57 self._sort_formats(formats)
59 descr = self._html_search_regex(
60 r'<p
class="Content Copy">(.*?
)</p
>', webpage, 'description
', fatal=False)
63 'title
': self._og_search_title(webpage),
66 'thumbnail
': config.find('STILL
/STILL_BIG
').text,