Repository: yt-dlp
Issue: Error when extracting subtitles from PlutoTV
Labels: bug,core:downloader

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.07.18** ([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/ytdl-org/youtube-dl#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

USA and many others

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

When trying to extract either of these videos:

https://pluto.tv/en/on-demand/series/stargate-atlantis/season/2/episode/the-long-goodbye-2006-2-16
https://pluto.tv/en/on-demand/series/stargate-atlantis/season/3/episode/irresistible-2006-3-3

The video and audio extract fine, but I get this error when trying to extract the subs using --embed-subs or --write-subs:

ERROR: Parse error at position 23 (near 'MPEGTS:-6000,LOCAL:0')

That line from the .vtt.part-Frag1 file:

X-TIMESTAMP-MAP=MPEGTS:-6000,LOCAL:00:00:00.000

Compared to the same line from .vtt.part-Frag1 of an episode where the subs extract without error:

X-TIMESTAMP-MAP=MPEGTS:16000,LOCAL:00:00:00.000

Does the webvtt parser not like a negative value?

### 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
[debug] Command-line config: ['-vU', '--check-formats', '--embed-subs', '--remux-video', 'mkv', 'https://pluto.tv/en/on-demand/series/stargate-atlantis/season/2/episode/the-long-goodbye-2006-2-16']
[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.07.18 [135f05e]
[debug] Python 3.8.13 (CPython 64bit) - FreeBSD-12.3-RELEASE-p5-amd64-64bit-ELF (libc 7)
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.05.18.1, mutagen-1.45.1, websockets-10.3
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.07.18, Current version: 2022.07.18
yt-dlp is up to date (2022.07.18)
[debug] [PlutoTV] Extracting URL: https://pluto.tv/en/on-demand/series/stargate-atlantis/season/2/episode/the-long-goodbye-2006-2-16
[PlutoTV] stargate-atlantis: Downloading JSON metadata
[PlutoTV] 6254221adb330c001409511c: Downloading m3u8 information
[PlutoTV] 6254221adb330c001409511c: Downloading m3u8 playlist
[PlutoTV] 6254221adb330c001409511c: Downloading m3u8 playlist
[PlutoTV] 6254221adb330c001409511c: Downloading m3u8 playlist
[PlutoTV] 6254221adb330c001409511c: Downloading m3u8 playlist
[PlutoTV] 6254221adb330c001409511c: Downloading m3u8 playlist
[PlutoTV] 6254221adb330c001409511c: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Downloading subtitles: en
[debug] Default format spec: bestvideo*+bestaudio/best
[info] Testing format hls-2327
[hlsnative] Downloading m3u8 manifest
ERROR: This video is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format
  File "/home/melissa/.local/bin/yt-dlp", line 8, in <module>
    sys.exit(main())
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/__init__.py", line 940, in main
    _exit(*variadic(_real_main(argv)))
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/__init__.py", line 932, in _real_main
    return ydl.download(all_urls)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 3281, in download
    self.__download_wrapper(self.extract_info)(
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 3257, in wrapper
    res = func(*args, **kwargs)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1422, in extract_info
    return self.__extract_info(url, self.get_info_extractor(ie_key), download, extra_info, process)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1431, in wrapper
    return func(self, *args, **kwargs)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1521, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1578, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2608, in process_video_result
    formats_to_download = list(format_selector({
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2120, in selector_function
    yield from f(ctx)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2219, in final_selector
    return selector_function(ctx_copy)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2131, in selector_function
    picked_formats = list(f(ctx))
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2140, in selector_function
    for pair in itertools.product(selector_1(ctx), selector_2(ctx)):
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2209, in selector_function
    yield matches[format_idx - 1]
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/utils.py", line 2696, in __getitem__
    self._cache.extend(itertools.islice(self._iterable, n))
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2112, in _check_formats
    yield from self._check_formats(formats)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1883, in _check_formats
    success, _ = self.dl(temp_file.name, f, test=True)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2860, in dl
    return fd.download(name, new_info, subtitle)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/downloader/common.py", line 444, in download
    ret = self.real_download(filename, info_dict)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/downloader/hls.py", line 82, in real_download
    self.report_error(
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 971, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 903, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())


[info] Unable to download format hls-2327. Skipping...
[info] Testing format hls-2339
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 523
[download] Destination: /tmp/tmp9vynwfat.tmp
[download] 100% of 1.38MiB in 00:00
[info] Testing format hls-2327
[hlsnative] Downloading m3u8 manifest
ERROR: This video is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format
  File "/home/melissa/.local/bin/yt-dlp", line 8, in <module>
    sys.exit(main())
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/__init__.py", line 940, in main
    _exit(*variadic(_real_main(argv)))
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/__init__.py", line 932, in _real_main
    return ydl.download(all_urls)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 3281, in download
    self.__download_wrapper(self.extract_info)(
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 3257, in wrapper
    res = func(*args, **kwargs)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1422, in extract_info
    return self.__extract_info(url, self.get_info_extractor(ie_key), download, extra_info, process)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1431, in wrapper
    return func(self, *args, **kwargs)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1521, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1578, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2608, in process_video_result
    formats_to_download = list(format_selector({
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2120, in selector_function
    yield from f(ctx)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2219, in final_selector
    return selector_function(ctx_copy)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2131, in selector_function
    picked_formats = list(f(ctx))
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2120, in selector_function
    yield from f(ctx)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2209, in selector_function
    yield matches[format_idx - 1]
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/utils.py", line 2696, in __getitem__
    self._cache.extend(itertools.islice(self._iterable, n))
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2112, in _check_formats
    yield from self._check_formats(formats)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1883, in _check_formats
    success, _ = self.dl(temp_file.name, f, test=True)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2860, in dl
    return fd.download(name, new_info, subtitle)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/downloader/common.py", line 444, in download
    ret = self.real_download(filename, info_dict)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/downloader/hls.py", line 82, in real_download
    self.report_error(
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 971, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 903, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())


[info] Unable to download format hls-2327. Skipping...
[info] Testing format hls-2339
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 523
[download] Destination: /tmp/tmp4679xtkt.tmp
[download] 100% of 1.38MiB in 00:00
[info] 6254221adb330c001409511c: Downloading 1 format(s): hls-2339
[info] Writing video subtitles to: The Long Goodbye [6254221adb330c001409511c].en.vtt
[debug] Invoking hlsnative downloader on "https://siloh-aka.plutotv.net/989_MGM_Studios/clip/62542218db330c0014095117_The_Long_Goodbye/720pDRM/20220411_075134/hls/0-end/fp/en.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 515
[download] Destination: The Long Goodbye [6254221adb330c001409511c].en.vtt
[download]   0.2% of ~67.90KiB at    1.37KiB/s ETA 00:48 (frag 1/515)ERROR: Parse error at position 23 (near 'MPEGTS:-6000,LOCAL:0')
Traceback (most recent call last):
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1431, in wrapper
    return func(self, *args, **kwargs)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1521, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1578, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2661, in process_video_result
    self.process_info(new_info)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2919, in process_info
    sub_files = self._write_subtitles(info_dict, temp_filename)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 3897, in _write_subtitles
    self.dl(sub_filename, sub_copy, subtitle=True)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 2860, in dl
    return fd.download(name, new_info, subtitle)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/downloader/common.py", line 444, in download
    ret = self.real_download(filename, info_dict)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/downloader/hls.py", line 351, in real_download
    self.download_and_append_fragments(
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/downloader/fragment.py", line 525, in download_and_append_fragments
    result = append_fragment(
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/downloader/fragment.py", line 484, in append_fragment
    self._append_fragment(ctx, pack_func(frag_content, frag_index))
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/downloader/hls.py", line 266, in pack_fragment
    for block in webvtt.parse_fragment(frag_content):
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/webvtt.py", line 351, in parse_fragment
    yield Magic.parse(parser)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/webvtt.py", line 205, in parse
    local, mpegts = cls.__parse_tsmap(parser)
  File "/home/melissa/.local/lib/python3.8/site-packages/yt_dlp/webvtt.py", line 184, in __parse_tsmap
    raise ParseError(parser)
yt_dlp.webvtt.ParseError: Parse error at position 23 (near 'MPEGTS:-6000,LOCAL:0')
```