]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/ynet.py
2 from __future__
import unicode_literals
7 from .common
import InfoExtractor
8 from ..compat
import compat_urllib_parse
11 class YnetIE(InfoExtractor
):
12 _VALID_URL
= r
'http://(?:.+?\.)?ynet\.co\.il/(?:.+?/)?0,7340,(?P<id>L(?:-[0-9]+)+),00\.html'
15 'url': 'http://hot.ynet.co.il/home/0,7340,L-11659-99244,00.html',
17 'id': 'L-11659-99244',
19 'title': 'איש לא יודע מאיפה באנו',
20 'thumbnail': 're:^https?://.*\.jpg',
23 'url': 'http://hot.ynet.co.il/home/0,7340,L-8859-84418,00.html',
27 'title': "צפו: הנשיקה הלוהטת של תורגי' ויוליה פלוטקין",
28 'thumbnail': 're:^https?://.*\.jpg',
33 def _real_extract(self
, url
):
34 video_id
= self
._match
_id
(url
)
35 webpage
= self
._download
_webpage
(url
, video_id
)
37 content
= compat_urllib_parse
.unquote_plus(self
._og
_search
_video
_url
(webpage
))
38 config
= json
.loads(self
._search
_regex
(r
'config=({.+?})$', content
, 'video config'))
39 f4m_url
= config
['clip']['url']
40 title
= self
._og
_search
_title
(webpage
)
41 m
= re
.search(r
'ynet - HOT -- (["\']+)(?P
<title
>.+?
)\
1', title)
43 title = m.group('title
')
48 'formats
': self._extract_f4m_formats(f4m_url, video_id),
49 'thumbnail
': self._og_search_thumbnail(webpage),