mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	@@ -1,7 +1,5 @@
 | 
				
			|||||||
from .common import InfoExtractor
 | 
					from .common import InfoExtractor
 | 
				
			||||||
from ..utils import (
 | 
					from ..utils import (
 | 
				
			||||||
    extract_attributes,
 | 
					 | 
				
			||||||
    get_element_html_by_id,
 | 
					 | 
				
			||||||
    int_or_none,
 | 
					    int_or_none,
 | 
				
			||||||
    parse_count,
 | 
					    parse_count,
 | 
				
			||||||
    parse_duration,
 | 
					    parse_duration,
 | 
				
			||||||
@@ -42,27 +40,36 @@ class NoodleMagazineIE(InfoExtractor):
 | 
				
			|||||||
        like_count = parse_count(self._html_search_meta('ya:ovs:likes', webpage, default=None))
 | 
					        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=''))
 | 
					        upload_date = unified_strdate(self._html_search_meta('ya:ovs:upload_date', webpage, default=''))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        player_path = extract_attributes(get_element_html_by_id('iplayer', webpage) or '')['src']
 | 
					        def build_url(url_or_path):
 | 
				
			||||||
 | 
					            return urljoin('https://adult.noodlemagazine.com', url_or_path)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        headers = {'Referer': url}
 | 
				
			||||||
 | 
					        player_path = self._html_search_regex(
 | 
				
			||||||
 | 
					            r'<iframe[^>]+\bid="iplayer"[^>]+\bsrc="([^"]+)"', webpage, 'player path')
 | 
				
			||||||
        player_iframe = self._download_webpage(
 | 
					        player_iframe = self._download_webpage(
 | 
				
			||||||
            urljoin('https://adult.noodlemagazine.com', player_path), video_id, 'Downloading iframe page')
 | 
					            build_url(player_path), video_id, 'Downloading iframe page', headers=headers)
 | 
				
			||||||
        playlist_url = self._search_regex(
 | 
					        playlist_url = self._search_regex(
 | 
				
			||||||
            r'window\.playlistUrl\s*=\s*["\']([^"\']+)["\']', player_iframe, 'playlist url')
 | 
					            r'window\.playlistUrl\s*=\s*["\']([^"\']+)["\']', player_iframe, 'playlist url')
 | 
				
			||||||
        playlist_info = self._download_json(
 | 
					        playlist_info = self._download_json(build_url(playlist_url), video_id, headers=headers)
 | 
				
			||||||
            urljoin('https://adult.noodlemagazine.com', playlist_url), video_id, headers={'Referer': url})
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        thumbnail = self._og_search_property('image', webpage, default=None) or playlist_info.get('image')
 | 
					        formats = []
 | 
				
			||||||
        formats = traverse_obj(playlist_info, ('sources', lambda _, v: v['file'], {
 | 
					        for source in traverse_obj(playlist_info, ('sources', lambda _, v: v['file'])):
 | 
				
			||||||
            'url': 'file',
 | 
					            if source.get('type') == 'hls':
 | 
				
			||||||
            'format_id': 'label',
 | 
					                formats.extend(self._extract_m3u8_formats(
 | 
				
			||||||
            'height': ('label', {int_or_none}),
 | 
					                    build_url(source['file']), video_id, 'mp4', fatal=False, m3u8_id='hls'))
 | 
				
			||||||
            'ext': 'type',
 | 
					            else:
 | 
				
			||||||
        }))
 | 
					                formats.append(traverse_obj(source, {
 | 
				
			||||||
 | 
					                    'url': ('file', {build_url}),
 | 
				
			||||||
 | 
					                    'format_id': 'label',
 | 
				
			||||||
 | 
					                    'height': ('label', {int_or_none}),
 | 
				
			||||||
 | 
					                    'ext': 'type',
 | 
				
			||||||
 | 
					                }))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            'id': video_id,
 | 
					            'id': video_id,
 | 
				
			||||||
            'formats': formats,
 | 
					            'formats': formats,
 | 
				
			||||||
            'title': title,
 | 
					            'title': title,
 | 
				
			||||||
            'thumbnail': thumbnail,
 | 
					            'thumbnail': self._og_search_property('image', webpage, default=None) or playlist_info.get('image'),
 | 
				
			||||||
            'duration': duration,
 | 
					            'duration': duration,
 | 
				
			||||||
            'description': description,
 | 
					            'description': description,
 | 
				
			||||||
            'tags': tags,
 | 
					            'tags': tags,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user