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

Code before:
            request, None, False, 'Wrong login info')
        if not re.search(r'id="tubi-logout"', login_page):
            raise ExtractorError(
                'Login failed (invalid username/password)', expected=True)

    def _real_extract(self, url):
        video_id = self._match_id(url)
        video_data = self._download_json(f'https://tubitv.com/oz/videos/{video_id}/content', video_id, query={
            'video_resources': ['dash', 'hlsv3', 'hlsv6', *self._UNPLAYABLE_FORMATS],
        })
        title = video_data['title']

        formats = []
        drm_formats = False

        for resource in video_data['video_resources']:
            if resource['type'] in ('dash', ):
                formats += self._extract_mpd_formats(resource['manifest']['url'], video_id, mpd_id=resource['type'], fatal=False)
            elif resource['type'] in ('hlsv3', 'hlsv6'):
                formats += self._extract_m3u8_formats(resource['manifest']['url'], video_id, 'mp4', m3u8_id=resource['type'], fatal=False)
            elif resource['type'] in self._UNPLAYABLE_FORMATS:
                drm_formats = True

        if not formats and drm_formats:
            self.report_drm(video_id)
        elif not formats and not video_data['policy_match']:  # policy_match is False if content was removed
            raise ExtractorError('This content is currently unavailable', expected=True)

        self._sort_formats(formats)

        thumbnails = []
        for thumbnail_url in video_data.get('thumbnails', []):
            if not thumbnail_url:
                continue
            thumbnails.append({
                'url': self._proto_relative_url(thumbnail_url),
            })

        subtitles = {}
        for sub in video_data.get('subtitles', []):
            sub_url = sub.get('url')
            if not sub_url:
                continue
            subtitles.setdefault(sub.get('lang', 'English'), []).append({
                'url': self._proto_relative_url(sub_url),
            })

        season_number, episode_number, episode_title = self._search_regex(
            r'^S(\d+):E(\d+) - (.+)', title, 'episode info', fatal=False, group=(1, 2, 3), default=(None, None, None))

        return {

Review comment (suggestion):
```suggestion
        elif not formats and not video_data.get('policy_match'):  # policy_match is False if content was removed
```

Code after:
            request, None, False, 'Wrong login info')
        if not re.search(r'id="tubi-logout"', login_page):
            raise ExtractorError(
                'Login failed (invalid username/password)', expected=True)

    def _real_extract(self, url):
        video_id = self._match_id(url)
        video_data = self._download_json(f'https://tubitv.com/oz/videos/{video_id}/content', video_id, query={
            'video_resources': ['dash', 'hlsv3', 'hlsv6', *self._UNPLAYABLE_FORMATS],
        })
        title = video_data['title']

        formats = []
        drm_formats = False

        for resource in video_data['video_resources']:
            if resource['type'] in ('dash', ):
                formats += self._extract_mpd_formats(resource['manifest']['url'], video_id, mpd_id=resource['type'], fatal=False)
            elif resource['type'] in ('hlsv3', 'hlsv6'):
                formats += self._extract_m3u8_formats(resource['manifest']['url'], video_id, 'mp4', m3u8_id=resource['type'], fatal=False)
            elif resource['type'] in self._UNPLAYABLE_FORMATS:
                drm_formats = True

        if not formats and drm_formats:
            self.report_drm(video_id)
        elif not formats and not video_data.get('policy_match'):  # policy_match is False if content was removed
            raise ExtractorError('This content is currently unavailable', expected=True)

        self._sort_formats(formats)

        thumbnails = []
        for thumbnail_url in video_data.get('thumbnails', []):
            if not thumbnail_url:
                continue
            thumbnails.append({
                'url': self._proto_relative_url(thumbnail_url),
            })

        subtitles = {}
        for sub in video_data.get('subtitles', []):
            sub_url = sub.get('url')
            if not sub_url:
                continue
            subtitles.setdefault(sub.get('lang', 'English'), []).append({
                'url': self._proto_relative_url(sub_url),
            })

        season_number, episode_number, episode_title = self._search_regex(
            r'^S(\d+):E(\d+) - (.+)', title, 'episode info', fatal=False, group=(1, 2, 3), default=(None, None, None))

        return {