]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/zype.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
9 class ZypeIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://player\.zype\.com/embed/(?P<id>[\da-fA-F]+)\.js\?.*?api_key=[^&]+'
12 'url': 'https://player.zype.com/embed/5b400b834b32992a310622b9.js?api_key=jZ9GUhRmxcPvX7M3SlfejB6Hle9jyHTdk2jVxG7wOHPLODgncEKVdPYBhuz9iWXQ&autoplay=false&controls=true&da=false',
13 'md5': 'eaee31d474c76a955bdaba02a505c595',
15 'id': '5b400b834b32992a310622b9',
17 'title': 'Smoky Barbecue Favorites',
18 'thumbnail': r
're:^https?://.*\.jpe?g',
23 def _extract_urls(webpage
):
26 for mobj
in re
.finditer(
27 r
'<script[^>]+\bsrc=(["\'])(?P
<url
>(?
:https?
:)?
//player\
.zype\
.com
/embed
/[\da
-fA
-F
]+\
.js
\?.*?api_key
=.+?
)\
1',
30 def _real_extract(self, url):
31 video_id = self._match_id(url)
33 webpage = self._download_webpage(url, video_id)
35 title = self._search_regex(
36 r'video_title\s
*[:=]\s
*(["\'])(?P<value>(?:(?!\1).)+)\1', webpage,
37 'title', group='value')
39 m3u8_url = self._search_regex(
40 r'(["\'])(?P
<url
>(?
:(?
!\
1).)+\
.m3u8(?
:(?
!\
1).)*)\
1', webpage,
41 'm3u8 url
', group='url
')
43 formats = self._extract_m3u8_formats(
44 m3u8_url, video_id, 'mp4
', entry_protocol='m3u8_native
',
46 self._sort_formats(formats)
48 thumbnail = self._search_regex(
49 r'poster\s
*[:=]\s
*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage, 'thumbnail',
50 default=False, group='url')
55 'thumbnail': thumbnail,