Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/noodlemagazine.py (Python)

Code before:
    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)
        title = self._og_search_title(webpage)
        duration = parse_duration(self._html_search_meta('video:duration', webpage, 'duration', default=None))
        description = self._og_search_property('description', webpage, default='').replace(' watch online hight quality video', '')
        tags = self._html_search_meta('video:tag', webpage, default='').split(', ')
        view_count = parse_count(self._html_search_meta('ya:ovs:views_total', 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=''))

        player_url = self._html_search_regex(rf'(/player/{video_id}[^"\'\s,]+)', webpage, 'player-url')
        player_iframe = self._download_webpage(f'https://adult.noodlemagazine.com{player_url}', video_id)
        playlist_url = self._html_search_regex(rf'(/playlist/{video_id}[^"\'\s,]+)', player_iframe, 'playlist-url')
        playlist_info = self._download_json(f'https://adult.noodlemagazine.com{playlist_url}', video_id)

        thumbnail = self._og_search_property('image', webpage, default=None) or playlist_info.get('image')
        sources = playlist_info.get('sources')
        if not sources:
            raise ExtractorError('Player sources not found!', expected=False, video_id=video_id)

        formats = [{
            'url': source.get('file'),
            'quality': source.get('label'),
            'ext': source.get('type'),
        } for source in sources]

        return {
            'id': video_id,
            'formats': formats,
            'title': title,
            'thumbnail': thumbnail,
            'duration': duration,
            'description': description,
            'tags': tags,
            'view_count': view_count,
            'like_count': like_count,
            'upload_date': upload_date,
            'age_limit': 18
        }


Review comment (suggestion):
let's do this instead
```py
        formats = traverse_obj(playlist_info, ('sources', lambda _, v: v['file'], {
            'url': 'file',
            'format_id': 'label',
            'height': ('label', {int_or_none}),
            'ext': 'type',
        }))
```
import `traverse_obj` from utils.traversal

Code after:
            'age_limit': 18
        }
    }

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)
        title = self._og_search_title(webpage)
        duration = parse_duration(self._html_search_meta('video:duration', webpage, 'duration', default=None))
        description = self._og_search_property('description', webpage, default='').replace(' watch online hight quality video', '')
        tags = self._html_search_meta('video:tag', webpage, default='').split(', ')
        view_count = parse_count(self._html_search_meta('ya:ovs:views_total', 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=''))

        player_path = extract_attributes(get_element_html_by_id('iplayer', webpage) or '')['src']
        player_iframe = self._download_webpage(
            urljoin('https://adult.noodlemagazine.com', player_path), video_id, 'Downloading iframe page')
        playlist_url = self._search_regex(
            r'window\.playlistUrl\s*=\s*["\']([^"\']+)["\']', player_iframe, 'playlist url')
        playlist_info = self._download_json(
            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 = traverse_obj(playlist_info, ('sources', lambda _, v: v['file'], {
            'url': 'file',
            'format_id': 'label',
            'height': ('label', {int_or_none}),
            'ext': 'type',
        }))

        return {
            'id': video_id,
            'formats': formats,
            'title': title,
            'thumbnail': thumbnail,
            'duration': duration,
            'description': description,
            'tags': tags,
            'view_count': view_count,
            'like_count': like_count,
            'upload_date': upload_date,
            'age_limit': 18
        }