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

Code before:
            image_url = image.get('url')
            if not image_url:
                continue
            thumbnails.append({
                'url': image_url,
                'width': int_or_none(image.get('width')),
                'height': int_or_none(image.get('height')),
            })

        return {
            'id': media_id,
            'title': art_title,
            'description': art_description,
            'timestamp': timestamp,
            'upload_date': unified_strdate(publication_date),
            'uploader': uploader,
            'creator': creator,
            'duration': duration,
            'formats': formats,
            'subtitles': subtitles,
            'thumbnails': thumbnails,
            'series': series
        }


class NYTimesCookingReceipesIE(InfoExtractor):
    _VALID_URL = r'https?://cooking\.nytimes\.com/recipes/(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://cooking.nytimes.com/recipes/1017817-cranberry-curd-tart',
        'md5': '579e83bbe8e61e9de67f80edba8a78a8',
        'info_dict': {
            'id': '1017817',
            'ext': 'mp4',
            'title': 'Cranberry Curd Tart',
            'description': 'md5:ad77a3fc321db636256d4343c5742152',
            'timestamp': 1447804800,
            'upload_date': '20151118',
            'creator': 'David Tanis',
            'thumbnail': r're:https?://\w+\.nyt.com/images/.*\.jpg',

        },
    }, {
        'url': 'https://cooking.nytimes.com/recipes/1024781-neapolitan-checkerboard-cookies',
        'md5': '58df35998241dcf0620e99e646331b42',
        'info_dict': {
            'id': '1024781',
            'ext': 'mp4',
            'title': 'Neapolitan Checkerboard Cookies',
            'description': 'md5:ba12394c585ababea951cb6d2fcc6631',
            'timestamp': 1701302400,
            'upload_date': '20231130',

Review comment (suggestion):
IMO keep this named `NYTimesCookingIE`
you can add `IE_NAME = 'NYTimesCookingRecipes'` if you want (note the spelling of "Recipes")

Code after:
            'skip_download': 'm3u8',
        },
    }, {
        # multiple videos in the same article
        'url': 'https://www.nytimes.com/2023/12/02/business/air-traffic-controllers-safety.html',
        'info_dict': {
            'id': 'air-traffic-controllers-safety',
            'title': 'Drunk and Asleep on the Job: Air Traffic Controllers Pushed to the Brink',
            'description': 'md5:549e5a5e935bf7d048be53ba3d2c863d',
            'upload_date': '20231202',
            'creator': 'Emily Steel, Sydney Ember',
            'timestamp': 1701511264,
        },
        'playlist_count': 3,
    }, {
        'url': 'https://www.nytimes.com/2023/12/02/business/media/netflix-squid-game-challenge.html',
        'only_matching': True,
    }]

    def _extract_content_from_block(self, block):
        details = traverse_obj(block, {
            'id': ('sourceId', {str}),
            'uploader': ('bylines', ..., 'renderedRepresentation', {str}),
            'duration': (None, (('duration', {lambda x: float_or_none(x, scale=1000)}), ('length', {int_or_none}))),
            'timestamp': ('firstPublished', {parse_iso8601}),
            'series': ('podcastSeries', {str}),
        }, get_all=False)

        formats, subtitles = self._extract_formats_and_subtitles(details.get('id'), block)
        # audio articles will have an url and no formats
        url = traverse_obj(block, ('fileUrl', {url_or_none}))
        if not formats and url:
            formats.append({'url': url, 'vcodec': 'none'})

        return {
            **details,
            'thumbnails': self._extract_thumbnails(traverse_obj(
                block, ('promotionalMedia', 'crops', ..., 'renditions', ...))),
            'formats': formats,
            'subtitles': subtitles
        }

    def _real_extract(self, url):
        page_id = self._match_id(url)
        webpage = self._download_webpage(url, page_id)
        art_json = self._search_json(
            r'window\.__preloadedData\s*=', webpage, 'media details', page_id,
            transform_source=lambda x: x.replace('undefined', 'null'))['initialData']['data']['article']

        blocks = traverse_obj(art_json, (
            'sprinkledBody', 'content', ..., ('ledeMedia', None),