2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class Zaq1IE(InfoExtractor):
12 _VALID_URL = r'http://(?:www\.)?zaq1\.pl/video/(?P<id>[^/?#&]+)'
14 'url': 'http://zaq1.pl/video/xev0e',
15 'md5': '24a5eb3f052e604ae597c4d0d19b351e',
18 'title': 'DJ NA WESELE. TANIEC Z FIGURAMI.węgrów/sokołów podlaski/siedlce/mińsk mazowiecki/warszawa',
22 'upload_date': '20170330',
25 'url': 'http://zaq1.pl/video/x80nc',
26 'md5': '1245973520adc78139928a820959d9c5',
29 'title': 'DIY Inspiration Challenge #86 | koraliki | gwiazdka na choinkę z koralików i drutu',
33 'upload_date': '20170404',
37 def _real_extract(self, url):
38 video_id = self._match_id(url)
40 webpage = self._download_webpage(url, video_id)
42 title = self._html_search_regex(
43 r'(?s)<h1>\s*<span.+class="watch-title".+title="([^"]+)">\1\s*</span>\s*</h1>', webpage, 'title')
45 div = self._search_regex(r'(?s)(?P<div><div.+id=(["\'])video_player\2.+</div>)', webpage, 'video url', group='div')
46 video_url = self._search_regex(r'data-video-url="(http[^"]+)"', div, 'video url')
48 ext = self._search_regex(r'data-file-extension="([^"]+)"', div, 'ext', None, False)
49 duration = int_or_none(self._search_regex(r'data-duration="([^"]+)"', div, 'duration', None, False))
50 thumbnail = self._search_regex(r'data-photo-url="([^"]+)"', div, 'thumbnail', None, False)
52 upload_date = unified_strdate(self._search_regex(r'<strong\s+class="watch-time-text">\s*Opublikowany\s+([0-9]{4}-[0-9]{2}-[0-9]{2})', webpage, 'upload date'))
53 uploader = self._search_regex(r'<div\s+id="watch7-user-header">.*Wideo dodał:\s*<a[^>]*>\s*([^<]+)\s*</a>', webpage, 'uploader')
61 'http_headers': {'Referer': url},
63 'thumbnail': thumbnail,
65 'upload_date': upload_date,