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

Code before:
            'view_count': view_count,
            'is_live': is_live,
        }

        def find_dmu(x):
            data_movie_url = self._search_regex(
                r'data-movie-url=(["\'])(?P<url>(?:(?!\1).)+)\1',
                x, 'm3u8 url', group='url', default=None)
            if data_movie_url:
                return [data_movie_url]

        m3u8_urls = (try_get(webpage, find_dmu, list)
                     or traverse_obj(video_js_data, (..., 'source', 'url')))

        if is_live:
            stream_data = self._download_json(
                'https://twitcasting.tv/streamserver.php',
                video_id, 'Downloading live info', query={
                    'target': uploader_id,
                    'mode': 'client',
                    'player': 'pc_web',
                })

            password_params = {
                'word': hashlib.md5(video_password.encode()).hexdigest(),
            } if video_password else {}

            formats = []
            # low: 640x360, medium: 1280x720, high: 1920x1080
            qq = qualities(['low', 'medium', 'high'])
            for quality, m3u8_url in traverse_obj(stream_data, (
                'tc-hls', 'streams', {dict.items}, lambda _, v: url_or_none(v[1]),
            )):
                formats.append({
                    'url': update_url_query(m3u8_url, password_params),
                    'format_id': f'hls-{quality}',
                    'ext': 'mp4',
                    'quality': qq(quality),
                    'protocol': 'm3u8',
                    'http_headers': self._M3U8_HEADERS,
                })

            if websockets:
                qq = qualities(['base', 'mobilesource', 'main'])
                for mode, ws_url in traverse_obj(stream_data, (
                    'llfmp4', 'streams', {dict.items}, lambda _, v: url_or_none(v[1]),
                )):
                    formats.append({
                        'url': update_url_query(ws_url, password_params),
                        'format_id': f'ws-{mode}',
                        'ext': 'mp4',

Review comment (suggestion):
```suggestion
            } if video_password else None
```

Code after:
            'view_count': view_count,
            'is_live': is_live,
        }

        def find_dmu(x):
            data_movie_url = self._search_regex(
                r'data-movie-url=(["\'])(?P<url>(?:(?!\1).)+)\1',
                x, 'm3u8 url', group='url', default=None)
            if data_movie_url:
                return [data_movie_url]

        m3u8_urls = (try_get(webpage, find_dmu, list)
                     or traverse_obj(video_js_data, (..., 'source', 'url')))

        if is_live:
            stream_data = self._download_json(
                'https://twitcasting.tv/streamserver.php',
                video_id, 'Downloading live info', query={
                    'target': uploader_id,
                    'mode': 'client',
                    'player': 'pc_web',
                })

            password_params = {
                'word': hashlib.md5(video_password.encode()).hexdigest(),
            } if video_password else None

            formats = []
            # low: 640x360, medium: 1280x720, high: 1920x1080
            qq = qualities(['low', 'medium', 'high'])
            for quality, m3u8_url in traverse_obj(stream_data, (
                'tc-hls', 'streams', {dict.items}, lambda _, v: url_or_none(v[1]),
            )):
                formats.append({
                    'url': update_url_query(m3u8_url, password_params),
                    'format_id': f'hls-{quality}',
                    'ext': 'mp4',
                    'quality': qq(quality),
                    'protocol': 'm3u8',
                    'http_headers': self._M3U8_HEADERS,
                })

            if websockets:
                qq = qualities(['base', 'mobilesource', 'main'])
                for mode, ws_url in traverse_obj(stream_data, (
                    'llfmp4', 'streams', {dict.items}, lambda _, v: url_or_none(v[1]),
                )):
                    formats.append({
                        'url': update_url_query(ws_url, password_params),
                        'format_id': f'ws-{mode}',
                        'ext': 'mp4',