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

Code before:
            },
        },
        {
            # new video_id format
            'url': 'https://www.nbc.com/quantum-leap/video/bens-first-leap-nbcs-quantum-leap/NBCE125189978',
            'info_dict': {
                'id': 'NBCE125189978',
                'ext': 'mp4',
                'title': 'Ben\'s First Leap | NBC\'s Quantum Leap',
                'description': 'md5:a82762449b7ec4bb83291a7b355ebf8e',
                'uploader': 'NBCU-COM',
                'series': 'Quantum Leap',
                'season': 'Season 1',
                'season_number': 1,
                'episode': 'Ben\'s First Leap | NBC\'s Quantum Leap',
                'episode_number': 1,
                'duration': 170.171,
                'chapters': [],
                'timestamp': 1663956155,
                'upload_date': '20220923',
                'tags': 'count:10',
                'age_limit': 0,
                'thumbnail': r're:https?://.+\.jpg',
                'categories': [
                    'Series/Quantum Leap 2022',
                ],
                'media_type': 'Highlight',
            },
            'params': {
                'skip_download': 'm3u8',
            },
        },
        {
            'url': 'https://www.nbc.com/classic-tv/charles-in-charge/video/charles-in-charge-pilot/n3310',
            'only_matching': True,
        },
        {
            # Percent escaped url
            'url': 'https://www.nbc.com/up-all-night/video/day-after-valentine%27s-day/n2189',
            'only_matching': True,
        }
    ]

    def _real_extract(self, url):
        permalink, video_id = self._match_valid_url(url).groups()
        permalink = 'http' + compat_urllib_parse_unquote(permalink)
        video_data = self._download_json(
            'https://friendship.nbc.co/v2/graphql', video_id, query={
                'query': '''query bonanzaPage(
  $app: NBCUBrands! = nbc
  $name: String!

Review comment (suggestion):
```suggestion
                'categories': ['Series/Quantum Leap 2022'],
```

Code after:
            # new video_id format
            'url': 'https://www.nbc.com/quantum-leap/video/bens-first-leap-nbcs-quantum-leap/NBCE125189978',
            'info_dict': {
                'id': 'NBCE125189978',
                'ext': 'mp4',
                'title': 'Ben\'s First Leap | NBC\'s Quantum Leap',
                'description': 'md5:a82762449b7ec4bb83291a7b355ebf8e',
                'uploader': 'NBCU-COM',
                'series': 'Quantum Leap',
                'season': 'Season 1',
                'season_number': 1,
                'episode': 'Ben\'s First Leap | NBC\'s Quantum Leap',
                'episode_number': 1,
                'duration': 170.171,
                'chapters': [],
                'timestamp': 1663956155,
                'upload_date': '20220923',
                'tags': 'count:10',
                'age_limit': 0,
                'thumbnail': r're:https?://.+\.jpg',
                'categories': ['Series/Quantum Leap 2022'],
                'media_type': 'Highlight',
            },
            'params': {
                'skip_download': 'm3u8',
            },
        },
        {
            'url': 'https://www.nbc.com/classic-tv/charles-in-charge/video/charles-in-charge-pilot/n3310',
            'only_matching': True,
        },
        {
            # Percent escaped url
            'url': 'https://www.nbc.com/up-all-night/video/day-after-valentine%27s-day/n2189',
            'only_matching': True,
        }
    ]

    def _real_extract(self, url):
        permalink, video_id = self._match_valid_url(url).groups()
        permalink = 'http' + compat_urllib_parse_unquote(permalink)
        video_data = self._download_json(
            'https://friendship.nbc.co/v2/graphql', video_id, query={
                'query': '''query bonanzaPage(
  $app: NBCUBrands! = nbc
  $name: String!
  $oneApp: Boolean
  $platform: SupportedPlatforms! = web
  $type: EntityPageType! = VIDEO
  $userId: String!
) {