]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/noodlemagazine.py
1 from .common
import InfoExtractor
4 get_element_html_by_id
,
11 from ..utils
.traversal
import traverse_obj
14 class NoodleMagazineIE(InfoExtractor
):
15 _VALID_URL
= r
'https?://(?:www|adult\.)?noodlemagazine\.com/watch/(?P<id>[0-9-_]+)'
17 'url': 'https://adult.noodlemagazine.com/watch/-67421364_456239604',
18 'md5': '9e02aa763612929d0b4b850591a9248b',
20 'id': '-67421364_456239604',
21 'title': 'Aria alexander manojob',
22 'thumbnail': r
're:^https://.*\.jpg',
27 'description': 'Aria alexander manojob',
28 'tags': ['aria', 'alexander', 'manojob'],
29 'upload_date': '20190218',
34 def _real_extract(self
, url
):
35 video_id
= self
._match
_id
(url
)
36 webpage
= self
._download
_webpage
(url
, video_id
)
37 title
= self
._og
_search
_title
(webpage
)
38 duration
= parse_duration(self
._html
_search
_meta
('video:duration', webpage
, 'duration', default
=None))
39 description
= self
._og
_search
_property
('description', webpage
, default
='').replace(' watch online hight quality video', '')
40 tags
= self
._html
_search
_meta
('video:tag', webpage
, default
='').split(', ')
41 view_count
= parse_count(self
._html
_search
_meta
('ya:ovs:views_total', webpage
, default
=None))
42 like_count
= parse_count(self
._html
_search
_meta
('ya:ovs:likes', webpage
, default
=None))
43 upload_date
= unified_strdate(self
._html
_search
_meta
('ya:ovs:upload_date', webpage
, default
=''))
45 player_path
= extract_attributes(get_element_html_by_id('iplayer', webpage
) or '')['src']
46 player_iframe
= self
._download
_webpage
(
47 urljoin('https://adult.noodlemagazine.com', player_path
), video_id
, 'Downloading iframe page')
48 playlist_url
= self
._search
_regex
(
49 r
'window\.playlistUrl\s*=\s*["\']([^
"\']+)["\']', player_iframe, 'playlist url
')
50 playlist_info = self._download_json(
51 urljoin('https
://adult
.noodlemagazine
.com
', playlist_url), video_id, headers={'Referer': url})
53 thumbnail = self._og_search_property('image
', webpage, default=None) or playlist_info.get('image
')
54 formats = traverse_obj(playlist_info, ('sources
', lambda _, v: v['file'], {
57 'height
': ('label
', {int_or_none}),
65 'thumbnail
': thumbnail,
67 'description
': description,
69 'view_count
': view_count,
70 'like_count
': like_count,
71 'upload_date
': upload_date,