4 from .common import InfoExtractor
7 class TvpIE(InfoExtractor):
9 _VALID_URL = r'https?://www\.tvp\.pl/.*?wideo/(?P<date>\d+)/(?P<id>\d+)'
12 u'url': u'http://www.tvp.pl/warszawa/magazyny/campusnews/wideo/31102013/12878238',
13 u'md5': u'148408967a6a468953c0a75cbdaf0d7a',
14 u'file': u'12878238.wmv',
16 u'title': u'31.10.2013 - Odcinek 2',
17 u'description': u'31.10.2013 - Odcinek 2',
19 u'skip': u'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 mobj = re.match(self._VALID_URL, url)
24 video_id = mobj.group('id')
25 webpage = self._download_webpage(url, video_id)
26 json_url = 'http://www.tvp.pl/pub/stat/videofileinfo?video_id=%s' % video_id
27 json_params = self._download_webpage(
28 json_url, video_id, u"Downloading video metadata")
30 params = json.loads(json_params)
31 self.report_extraction(video_id)
32 video_url = params['video_url']
34 title = self._og_search_title(webpage, fatal=True)
40 'description': self._og_search_description(webpage),
41 'thumbnail': self._og_search_thumbnail(webpage),