1 from .common
import InfoExtractor
9 from ..utils
.traversal
import traverse_obj
12 class NoodleMagazineIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www|adult\.)?noodlemagazine\.com/watch/(?P<id>[0-9-_]+)'
15 'url': 'https://adult.noodlemagazine.com/watch/-67421364_456239604',
16 'md5': '9e02aa763612929d0b4b850591a9248b',
18 'id': '-67421364_456239604',
19 'title': 'Aria alexander manojob',
20 'thumbnail': r
're:^https://.*\.jpg',
25 'description': 'Aria alexander manojob',
26 'tags': ['aria', 'alexander', 'manojob'],
27 'upload_date': '20190218',
32 def _real_extract(self
, url
):
33 video_id
= self
._match
_id
(url
)
34 webpage
= self
._download
_webpage
(url
, video_id
)
35 title
= self
._og
_search
_title
(webpage
)
36 duration
= parse_duration(self
._html
_search
_meta
('video:duration', webpage
, 'duration', default
=None))
37 description
= self
._og
_search
_property
('description', webpage
, default
='').replace(' watch online hight quality video', '')
38 tags
= self
._html
_search
_meta
('video:tag', webpage
, default
='').split(', ')
39 view_count
= parse_count(self
._html
_search
_meta
('ya:ovs:views_total', webpage
, default
=None))
40 like_count
= parse_count(self
._html
_search
_meta
('ya:ovs:likes', webpage
, default
=None))
41 upload_date
= unified_strdate(self
._html
_search
_meta
('ya:ovs:upload_date', webpage
, default
=''))
43 def build_url(url_or_path
):
44 return urljoin('https://adult.noodlemagazine.com', url_or_path
)
46 headers
= {'Referer': url
}
47 player_path
= self
._html
_search
_regex
(
48 r
'<iframe[^>]+\bid="iplayer"[^>]+\bsrc="([^"]+)"', webpage
, 'player path')
49 player_iframe
= self
._download
_webpage
(
50 build_url(player_path
), video_id
, 'Downloading iframe page', headers
=headers
)
51 playlist_url
= self
._search
_regex
(
52 r
'window\.playlistUrl\s*=\s*["\']([^
"\']+)["\']', player_iframe, 'playlist url
')
53 playlist_info = self._download_json(build_url(playlist_url), video_id, headers=headers)
56 for source in traverse_obj(playlist_info, ('sources
', lambda _, v: v['file'])):
57 if source.get('type') == 'hls
':
58 formats.extend(self._extract_m3u8_formats(
59 build_url(source['file']), video_id, 'mp4
', fatal=False, m3u8_id='hls
'))
61 formats.append(traverse_obj(source, {
62 'url
': ('file', {build_url}),
64 'height
': ('label
', {int_or_none}),
72 'thumbnail
': self._og_search_property('image
', webpage, default=None) or playlist_info.get('image
'),
74 'description
': description,
76 'view_count
': view_count,
77 'like_count
': like_count,
78 'upload_date
': upload_date,