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

Code before:
    }, {
        'url': 'https://www.trtworld.com/video/africa-matters/locals-learning-to-cope-with-rising-tides-of-kenyas-great-lakes-16059545',
        'info_dict': {
            'id': 'zEns2dWl00w',
            'ext': 'mp4',
            'title': "Locals learning to cope with rising tides of Kenya's Great Lakes",
            "thumbnail": "https://i.ytimg.com/vi/zEns2dWl00w/maxresdefault.jpg",
            "description": "The great lakes of Kenya are a major tourist attraction, and support the livelihoods of millions of residents. But in recent years, their levels have been steadily rising, wreaking havoc. \n\nAlexandria Majalla spoke to locals to find out how they're coping with the changing tides.\r\n\r\nSubscribe:\nhttp://trt.world/subscribe\nLivestream: http://trt.world/ytlive\nFacebook: http://trt.world/facebook\nTwitter: http://trt.world/twitter\nInstagram: http://trt.world/instagram\nVisit our website: http://trt.world",
            "channel_id": "UC7fWeaHhqgM4Ry-RMpM2YYw",
            "channel_url": "https://www.youtube.com/channel/UC7fWeaHhqgM4Ry-RMpM2YYw",
            "duration": 210,
            "view_count": int,
            "average_rating": None,
            "age_limit": 0,
            "webpage_url": "https://www.youtube.com/watch?v=zEns2dWl00w",
            "categories": [
                "News & Politics"
            ],
            "channel": "TRT World",
            "channel_follower_count": int,
            "channel_is_verified": True,
            "uploader": "TRT World",
            "uploader_id": "@trtworld",
            "uploader_url": "https://www.youtube.com/@trtworld",
            "upload_date": "20231202",
            "availability": "public",
            'comment_count': int,
            'playable_in_embed': True,
            'tags': [],
            'live_status': 'not_live',
            'like_count': None

        }
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)
        nuxtjs_data = self._search_nuxt_data(webpage, display_id)['videoData']['content']
        formats = []
        for media_url in traverse_obj(nuxtjs_data, (
                'platforms', ('website', 'ott'), 'metadata', ('hls_url', 'url'), {url_or_none})):
            # Website sometimes serves mp4 files under `hls_url` key
            if media_url.endswith('.m3u8'):
                formats.extend(self._extract_m3u8_formats(media_url, display_id, fatal=False))
            else:
                formats.append({
                    'format_id': 'http',
                    'url': media_url,
                })
        if not formats:

Review comment (suggestion):
Should be single quotes
```suggestion
            'thumbnail': 'https://i.ytimg.com/vi/zEns2dWl00w/maxresdefault.jpg',
            'description': 'md5:3ad9d7c5234d752a4ead4340c79c6b8d',
            'channel_id': 'UC7fWeaHhqgM4Ry-RMpM2YYw',
            'channel_url': 'https://www.youtube.com/channel/UC7fWeaHhqgM4Ry-RMpM2YYw',
            'duration': 210,
            'view_count': int,
            'age_limit': 0,
            'webpage_url': 'https://www.youtube.com/watch?v=zEns2dWl00w',
            'categories': ['News & Politics'],
            'channel': 'TRT World',
            'channel_follower_count': int,
            'channel_is_verified': True,
            'uploader': 'TRT World',
            'uploader_id': '@trtworld',
            'uploader_url': 'https://www.youtube.com/@trtworld',
            'upload_date': '20231202',
            'availability': 'public',
```

Code after:
        'info_dict': {
            'id': 'zEns2dWl00w',
            'ext': 'mp4',
            'title': "Locals learning to cope with rising tides of Kenya's Great Lakes",
            'thumbnail': 'https://i.ytimg.com/vi/zEns2dWl00w/maxresdefault.jpg',
            'description': 'md5:3ad9d7c5234d752a4ead4340c79c6b8d',
            'channel_id': 'UC7fWeaHhqgM4Ry-RMpM2YYw',
            'channel_url': 'https://www.youtube.com/channel/UC7fWeaHhqgM4Ry-RMpM2YYw',
            'duration': 210,
            'view_count': int,
            'age_limit': 0,
            'webpage_url': 'https://www.youtube.com/watch?v=zEns2dWl00w',
            'categories': ['News & Politics'],
            'channel': 'TRT World',
            'channel_follower_count': int,
            'channel_is_verified': True,
            'uploader': 'TRT World',
            'uploader_id': '@trtworld',
            'uploader_url': 'https://www.youtube.com/@trtworld',
            'upload_date': '20231202',
            'availability': 'public',
            'comment_count': int,
            'playable_in_embed': True,
            'tags': [],
            'live_status': 'not_live',
            'like_count': int,
        }
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)
        nuxtjs_data = self._search_nuxt_data(webpage, display_id)['videoData']['content']['platforms']
        formats = []
        for media_url in traverse_obj(nuxtjs_data, (
                ('website', 'ott'), 'metadata', ('hls_url', 'url'), {url_or_none})):
            # NB: Website sometimes serves mp4 files under `hls_url` key
            if determine_ext(media_url) == 'm3u8':
                formats.extend(self._extract_m3u8_formats(media_url, display_id, fatal=False))
            else:
                formats.append({
                    'format_id': 'http',
                    'url': media_url,
                })
        if not formats:
            if youtube_id := traverse_obj(nuxtjs_data, ('youtube', 'metadata', 'youtubeId')):
                return self.url_result(youtube_id, 'Youtube')
            raise ExtractorError('No video found', expected=True)

        return {
            'id': display_id,