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

Code before:
import json
from .common import InfoExtractor
from ..utils import traverse_obj, unified_strdate, url_or_none


class CNBCVideoIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?cnbc\.com/video/(?:[^/]+/)+(?P<id>[^./?#&]+)\.html'

    _TESTS = [
        {
            'url': 'https://www.cnbc.com/video/2023/12/07/mcdonalds-just-unveiled-cosmcsits-new-spinoff-brand.html',
            'info_dict': {
                'author': 'Sean Conlon',
                'channel': 'News Videos',
                'description': 'McDonald\'s unveiled its new spinoff brand known as CosMc\'s this week, announcing that the new brand\'s first location will open in Bolingbrook, Illinois. CosMc\'s drive-thru focused menu features brand new lemonades and teas, blended beverages, and cold coffee, as well as a small lineup of food. The burger chain first revealed it was creating CosMc\'s as a spinoff during its second-quarter earnings call in July.',
                'duration': 65.0,
                'ext': 'mp4',
                'id': 'mcdonalds-just-unveiled-cosmcsits-new-spinoff-brand',
                'title': 'Here\'s a first look at McDonald\'s new spinoff brand, CosMc\'s',
                'thumbnail': 'https://image.cnbcfm.com/api/v1/image/107344192-1701894812493-CosMcsskyHero_2336x1040_hero-desktop.jpg?v=1701894855',
                'thumbnails': [
                    {
                        'url': 'https://image.cnbcfm.com/api/v1/image/107344192-1701894812493-CosMcsskyHero_2336x1040_hero-desktop.jpg?v=1701894855'
                    }
                ],
                'timestamp': 1701977810,
                'upload_date': '20231207',
            },

Review comment (suggestion):
```suggestion
from ..utils import int_or_none, parse_iso8601, str_or_none, url_or_none
from ..utils.traversal import traverse_obj
```

Code after:
from .common import InfoExtractor
from ..utils import int_or_none, parse_iso8601, str_or_none, url_or_none
from ..utils.traversal import traverse_obj


class CNBCVideoIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?cnbc\.com/video/(?:[^/?#]+/)+(?P<id>[^./?#&]+)\.html'

    _TESTS = [{
        'url': 'https://www.cnbc.com/video/2023/12/07/mcdonalds-just-unveiled-cosmcsits-new-spinoff-brand.html',
        'info_dict': {
            'ext': 'mp4',
            'id': '107344774',
            'display_id': 'mcdonalds-just-unveiled-cosmcsits-new-spinoff-brand',
            'modified_timestamp': 1702053483,
            'timestamp': 1701977810,
            'channel': 'News Videos',
            'upload_date': '20231207',
            'description': 'md5:882c001d85cb43d7579b514307b3e78b',
            'release_timestamp': 1701977375,
            'modified_date': '20231208',
            'release_date': '20231207',
            'duration': 65,
            'author': 'Sean Conlon',
            'title': 'Here\'s a first look at McDonald\'s new spinoff brand, CosMc\'s',
            'thumbnail': 'https://image.cnbcfm.com/api/v1/image/107344192-1701894812493-CosMcsskyHero_2336x1040_hero-desktop.jpg?v=1701894855',
        },
        'expected_warnings': ['Unable to download f4m manifest'],