# Buggy code
def extract_format(page, version):
    json_str = self._search_regex(
        r'player_data=(\\?["\'])(?P<player_data>.+?)\1',
        page,
        "%s player_json" % version,
        fatal=False,
        group="player_data",
    )
    if not json_str:
        return
    player_data = self._parse_json(json_str, "%s player_data" % version, fatal=False)
    if not player_data:
        return
    video = player_data.get("video")
    if not video or "file" not in video:
        self.report_warning("Unable to extract %s version information" % version)
        return
    if video["file"].startswith("uggc"):
        video["file"] = codecs.decode(video["file"], "rot_13")
        if video["file"].endswith("adc.mp4"):
            video["file"] = video["file"].replace("adc.mp4", ".mp4")
    f = {
        "url": video["file"],
    }
    m = re.search(
        r'<a[^>]+data-quality="(?P<format_id>[^"]+)"[^>]+href="[^"]+"[^>]+class="[^"]*quality-btn-active[^"]*">(?P<height>[0-9]+)p',
        page,
    )
    if m:
        f.update(
            {
                "format_id": m.group("format_id"),
                "height": int(m.group("height")),
            }
        )
    info_dict["formats"].append(f)
    if not info_dict["duration"]:
        info_dict["duration"] = parse_duration(video.get("duration"))


# Traceback (ExtractorError)
youtube-dl -gvv https://www.cda.pl/video/9443700b
[debug] System config: [u'--prefer-free-formats']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-gvv', u'https://www.cda.pl/video/9443700b']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.08.13
[debug] Python version 2.7.13 - Linux-4.11.12-200.fc25.x86_64-x86_64-with-fedora-25-Gurgle
[debug] exe versions: ffmpeg 3.1.9, ffprobe 3.1.9
[debug] Proxy map: {}
WARNING: [CDA] default player_data: Failed to parse JSON Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
WARNING: [CDA] 480p player_data: Failed to parse JSON Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
WARNING: [CDA] 720p player_data: Failed to parse JSON Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
WARNING: [CDA] 1080p player_data: Failed to parse JSON Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 776, in extract_info
ie_result = ie.extract(url)
File "/usr/bin/youtube-dl/youtube_dl/extractor/common.py", line 433, in extract
ie_result = self._real_extract(url)
File "/usr/bin/youtube-dl/youtube_dl/extractor/cda.py", line 180, in _real_extract
self._sort_formats(formats)
File "/usr/bin/youtube-dl/youtube_dl/extractor/common.py", line 1057, in _sort_formats
raise ExtractorError('No video formats found')
ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

# Fixed code
def extract_format(page, version):
    json_str = self._html_search_regex(
        r'player_data=(\\?["\'])(?P<player_data>.+?)\1',
        page,
        "%s player_json" % version,
        fatal=False,
        group="player_data",
    )
    if not json_str:
        return
    player_data = self._parse_json(json_str, "%s player_data" % version, fatal=False)
    if not player_data:
        return
    video = player_data.get("video")
    if not video or "file" not in video:
        self.report_warning("Unable to extract %s version information" % version)
        return
    if video["file"].startswith("uggc"):
        video["file"] = codecs.decode(video["file"], "rot_13")
        if video["file"].endswith("adc.mp4"):
            video["file"] = video["file"].replace("adc.mp4", ".mp4")
    f = {
        "url": video["file"],
    }
    m = re.search(
        r'<a[^>]+data-quality="(?P<format_id>[^"]+)"[^>]+href="[^"]+"[^>]+class="[^"]*quality-btn-active[^"]*">(?P<height>[0-9]+)p',
        page,
    )
    if m:
        f.update(
            {
                "format_id": m.group("format_id"),
                "height": int(m.group("height")),
            }
        )
    info_dict["formats"].append(f)
    if not info_dict["duration"]:
        info_dict["duration"] = parse_duration(video.get("duration"))