Repository: yt-dlp
Issue: [ArteTV] ParseError for webvtt subtitles
Labels: site-bug,patch-available

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.11.11** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [x] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

DE

### Provide a description that is worded well enough to be understood

Most videos download just fine, but I found this one, which fails to download (but plays back in the browser):
https://www.arte.tv/de/videos/073107-004-A/naturparadiese-mit-zukunft/

Any ideas?

Thanks :-)

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
$ yt-dlp -vU  --download-archive archive.txt -- https://www.arte.tv/de/videos/073107-004-A/naturparadiese-mit-zukunft/
[debug] Command-line config: ['-vU', '--download-archive', 'archive.txt', '--', 'https://www.arte.tv/de/videos/073107-004-A/naturparadiese-mit-zukunft/']
[debug] User config "/home/philcerf/.config/yt-dlp/config": ['--abort-on-error', '--abort-on-unavailable-fragment', '--no-ignore-no-formats-error', '--no-overwrites', '--mtime', '--restrict-filenames', '--output', '%(title)s__[%(extractor)s:%(id)s].%(ext)s', '--no-cookies-from-browser', '--no-split-chapters', '--no-remove-chapters', '--no-force-keyframes-at-cuts', '--no-prefer-free-formats', '--no-sponsorblock', '--embed-chapters', '--no-embed-metadata', '--no-embed-info-json', '--no-embed-subs', '--no-embed-thumbnail', '--write-description', '--write-info-json', '--no-write-comments', '--no-clean-info-json', '--write-all-thumbnails', '--write-subs', '--sub-langs', 'all', '--write-annotations', '--write-playlist-metafiles']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.11.11 [8b644025b] (debian*)
[debug] Python 3.10.9 (CPython x86_64 64bit) - Linux-6.0.0-5-amd64-x86_64-with-glibc2.36 (OpenSSL 3.0.7 1 Nov 2022, glibc 2.36)
[debug] exe versions: ffmpeg 5.1.2-1 (setts), ffprobe 5.1.2-1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.11.0, brotli-1.0.9, certifi-2022.09.24, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.2, xattr-0.9.9
[debug] Proxy map: {}
[debug] Loaded 1723 extractors
[debug] Loading archive file 'archive.txt'
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.11.11, Current version: 2022.11.11
yt-dlp is up to date (2022.11.11)
[debug] [ArteTV] Extracting URL: https://www.arte.tv/de/videos/073107-004-A/naturparadiese-mit-zukunft/
[ArteTV] 073107-004-A: Downloading JSON metadata
[ArteTV] 073107-004-A: Downloading m3u8 information
[ArteTV] 073107-004-A: Downloading m3u8 information
[ArteTV] 073107-004-A: Downloading m3u8 information
[ArteTV] 073107-004-A: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[info] 073107-004-A: Downloading subtitles: de, fr
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 073107-004-A: Downloading 1 format(s): VOA-2333+VOA-program_audio_0-VOA
[info] Video description is already present
[info] Video subtitle de.vtt is already present
[info] Writing video subtitles to: Ecuador_-_Hoffnung_fur_die_Nebelwalder__[ArteTV:073107-004-A].fr.vtt
[debug] Invoking hlsnative downloader on "https://arte-cmafhls.akamaized.net/am/cmaf/073000/073100/073107-004-A/221026063730/medias/073107-004-A_st_VF-MAL.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 1
[download] Destination: Ecuador_-_Hoffnung_fur_die_Nebelwalder__[ArteTV:073107-004-A].fr.vtt
[download] Ecuador_-_Hoffnung_fur_die_Nebelwalder__[ArteTV:073107-004-A].fr.vtt.part-Frag1 has already been downloaded
[download] 100.0% of ~  77.89KiB at  Unknown B/s ETA Unknown (frag 1/1)Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 33, in <module>
    sys.exit(load_entry_point('yt-dlp==2022.11.11', 'console_scripts', 'yt-dlp')())
  File "/usr/lib/python3/dist-packages/yt_dlp/__init__.py", line 968, in main
    _exit(*variadic(_real_main(argv)))
  File "/usr/lib/python3/dist-packages/yt_dlp/__init__.py", line 958, in _real_main
    return ydl.download(all_urls)
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 3322, in download
    self.__download_wrapper(self.extract_info)(
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 3297, in wrapper
    res = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 1474, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 1485, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 1582, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 1641, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 2737, in process_video_result
    self.process_info(new_info)
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 2983, in process_info
    sub_files = self._write_subtitles(info_dict, temp_filename)
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 3950, in _write_subtitles
    self.dl(sub_filename, sub_copy, subtitle=True)
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 2924, in dl
    return fd.download(name, new_info, subtitle)
  File "/usr/lib/python3/dist-packages/yt_dlp/downloader/common.py", line 446, in download
    ret = self.real_download(filename, info_dict)
  File "/usr/lib/python3/dist-packages/yt_dlp/downloader/hls.py", line 351, in real_download
    self.download_and_append_fragments(
  File "/usr/lib/python3/dist-packages/yt_dlp/downloader/fragment.py", line 520, in download_and_append_fragments
    result = append_fragment(
  File "/usr/lib/python3/dist-packages/yt_dlp/downloader/fragment.py", line 479, in append_fragment
    self._append_fragment(ctx, pack_func(frag_content, frag_index))
  File "/usr/lib/python3/dist-packages/yt_dlp/downloader/hls.py", line 266, in pack_fragment
    for block in webvtt.parse_fragment(frag_content):
  File "/usr/lib/python3/dist-packages/yt_dlp/webvtt.py", line 397, in parse_fragment
    raise ParseError(parser)
yt_dlp.webvtt.ParseError: Parse error at position 27366 (near '<c.green.bg_black>un')
```