Upgrade yt_dlp and download script
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
from .common import InfoExtractor
|
||||
from ..utils import (
|
||||
parse_duration,
|
||||
int_or_none,
|
||||
parse_count,
|
||||
unified_strdate
|
||||
parse_duration,
|
||||
unified_strdate,
|
||||
urljoin,
|
||||
)
|
||||
from ..utils.traversal import traverse_obj
|
||||
|
||||
|
||||
class NoodleMagazineIE(InfoExtractor):
|
||||
@@ -22,8 +25,8 @@ class NoodleMagazineIE(InfoExtractor):
|
||||
'description': 'Aria alexander manojob',
|
||||
'tags': ['aria', 'alexander', 'manojob'],
|
||||
'upload_date': '20190218',
|
||||
'age_limit': 18
|
||||
}
|
||||
'age_limit': 18,
|
||||
},
|
||||
}
|
||||
|
||||
def _real_extract(self, url):
|
||||
@@ -37,26 +40,35 @@ class NoodleMagazineIE(InfoExtractor):
|
||||
like_count = parse_count(self._html_search_meta('ya:ovs:likes', webpage, default=None))
|
||||
upload_date = unified_strdate(self._html_search_meta('ya:ovs:upload_date', webpage, default=''))
|
||||
|
||||
key = self._html_search_regex(rf'/{video_id}\?(?:.*&)?m=([^&"\'\s,]+)', webpage, 'key')
|
||||
playlist_info = self._download_json(f'https://adult.noodlemagazine.com/playlist/{video_id}?m={key}', video_id)
|
||||
thumbnail = self._og_search_property('image', webpage, default=None) or playlist_info.get('image')
|
||||
def build_url(url_or_path):
|
||||
return urljoin('https://adult.noodlemagazine.com', url_or_path)
|
||||
|
||||
formats = [{
|
||||
'url': source.get('file'),
|
||||
'quality': source.get('label'),
|
||||
'ext': source.get('type'),
|
||||
} for source in playlist_info.get('sources')]
|
||||
playlist_info = self._search_json(
|
||||
r'window\.playlist\s*=', webpage, video_id, 'playlist info')
|
||||
|
||||
formats = []
|
||||
for source in traverse_obj(playlist_info, ('sources', lambda _, v: v['file'])):
|
||||
if source.get('type') == 'hls':
|
||||
formats.extend(self._extract_m3u8_formats(
|
||||
build_url(source['file']), video_id, 'mp4', fatal=False, m3u8_id='hls'))
|
||||
else:
|
||||
formats.append(traverse_obj(source, {
|
||||
'url': ('file', {build_url}),
|
||||
'format_id': 'label',
|
||||
'height': ('label', {int_or_none}),
|
||||
'ext': 'type',
|
||||
}))
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'formats': formats,
|
||||
'title': title,
|
||||
'thumbnail': thumbnail,
|
||||
'thumbnail': self._og_search_property('image', webpage, default=None) or playlist_info.get('image'),
|
||||
'duration': duration,
|
||||
'description': description,
|
||||
'tags': tags,
|
||||
'view_count': view_count,
|
||||
'like_count': like_count,
|
||||
'upload_date': upload_date,
|
||||
'age_limit': 18
|
||||
'age_limit': 18,
|
||||
}
|
||||
|
Reference in New Issue
Block a user