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

Code before:
            'full_title': 'Monstruoso',
            'description': 'md5:333fc19ee327b457b980e54a911ea4a3',
            'ext': 'mp4',
        }
    }]

    def _extract_video(self, contentId, action="olyott_video_play"):
        request_body = {
            'action': action,
            'contentID': contentId,
        }

        response = self._download_json(
            'https://www.freetv.com/wordpress/wp-admin/admin-ajax.php',
            contentId,
            'Downloading %s video JSON' % contentId,
            data=urlencode_postdata(request_body),
            fatal=False
        )

        if response is False:
            return False

        if response.get('success') is False:
            return False

        response_data = response.get('data')

        if response_data is False:
            return False

        video_metadata = response_data.get('displayMeta')

        video_id = video_metadata.get('contentID')
        title = video_metadata.get('title')
        full_title = video_metadata.get('fullTitle')
        description = video_metadata.get('desc')
        video_url = video_metadata.get('streamURLVideo')

        formats = []
        subtitles = []

        ext = determine_ext(video_url)

        if ext == "m3u8":
            fmts, subs = self._extract_m3u8_formats_and_subtitles(
                video_url, video_id, 'mp4',
                entry_protocol='m3u8_native',
                fatal=False)
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)

Review comment (refactor):
1. read our coding conventions
2. errors should be thrown, not `return False`
3. Why is this non-fatal?
4. the `note` you added is no better than the default

```py
        response = self._download_json(
            'https://www.freetv.com/wordpress/wp-admin/admin-ajax.php',
            contentId, fatal=False data=urlencode_postdata({
            'action': action,
            'contentID': contentId,
        })
        if response.get('success') is False:
            raise ExtractorError(..., expected=True)  # Parse whatever error message the API gave
```

Code after:
            'id': '428021',
            'title': 'Atrápame Si Puedes',
            'description': 'md5:ca63bc00898aeb2f64ec87c6d3a5b982',
            'ext': 'mp4',
        }
    }, {
        'url': 'https://www.freetv.com/peliculas/monstruoso/',
        'md5': '509c15c68de41cb708d1f92d071f20aa',
        'info_dict': {
            'id': '377652',
            'title': 'Monstruoso',
            'description': 'md5:333fc19ee327b457b980e54a911ea4a3',
            'ext': 'mp4',
        }
    }]

    def _extract_video(self, content_id, action='olyott_video_play'):
        api_response = self._get_api_response(content_id, 'video', {
            'action': action,
            'contentID': content_id,
        })

        video_id, video_url = api_response['displayMeta']['contentID'], api_response['displayMeta']['streamURLVideo']
        formats, subtitles = self._extract_m3u8_formats_and_subtitles(video_url, video_id, 'mp4')
        self._sort_formats(formats)

        return {
            'id': video_id,
            'title': traverse_obj(api_response, ('displayMeta', 'title')),
            'description': traverse_obj(api_response, ('displayMeta', 'desc')),
            'formats': formats,
            'subtitles': subtitles,
        }

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)

        return self._extract_video(
            self._search_regex((
                r'class=["\'][^>]+postid-(?P<video_id>\d+)',
                r'<link[^>]+freetv.com/\?p=(?P<video_id>\d+)',
                r'<div[^>]+data-params=["\'][^>]+post_id=(?P<video_id>\d+)',
            ), webpage, 'video id', group='video_id'))


class FreeTvIE(FreeTvBaseIE):
    IE_NAME = 'freetv:series'
    _VALID_URL = r'https?://(?:www\.)?freetv\.com/series/(?P<id>[^/]+)'
    _TESTS = [{
        'url': 'https://www.freetv.com/series/el-detective-l/',