]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/tvp.py
a645800057fc6dc88850885cba7737243c95574e
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
6 class TvpIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://www\.tvp\.pl/.*?wideo/(?P<date>\d+)/(?P<id>\d+)'
11 'url': 'http://www.tvp.pl/warszawa/magazyny/campusnews/wideo/31102013/12878238',
12 'md5': '148408967a6a468953c0a75cbdaf0d7a',
16 'title': '31.10.2013 - Odcinek 2',
17 'description': '31.10.2013 - Odcinek 2',
19 'skip': 'Download has to use same server IP as extraction. Therefore, a good (load-balancing) DNS resolver will make the download fail.'
22 def _real_extract(self
, url
):
23 video_id
= self
._match
_id
(url
)
24 webpage
= self
._download
_webpage
(url
, video_id
)
25 json_url
= 'http://www.tvp.pl/pub/stat/videofileinfo?video_id=%s' % video_id
26 params
= self
._download
_json
(
27 json_url
, video_id
, "Downloading video metadata")
28 video_url
= params
['video_url']
32 'title': self
._og
_search
_title
(webpage
),
35 'description': self
._og
_search
_description
(webpage
),
36 'thumbnail': self
._og
_search
_thumbnail
(webpage
),