Repository: youtube-dl
Issue: HiDive - fails to download correct subtitle file or detect multiple subtitle files
Labels: geo-restricted

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2020.01.24. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that all URLs and arguments with special characters are properly quoted or escaped as explained in http://yt-dl.org/escape.
- Search the bugtracker for similar issues: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a broken site support
- [x] I've verified that I'm running youtube-dl version **2020.01.24**
- [x] I've checked that all provided URLs are alive and playable in a browser
- [x] I've checked that all URLs and arguments with special characters are properly quoted or escaped
- [x] I've searched the bugtracker for similar issues including closed ones


## Verbose log

<!--
Provide the complete verbose output of youtube-dl that clearly demonstrates the problem.
Add the `-v` flag to your command line you run youtube-dl with (`youtube-dl -v <your command line>`), copy the WHOLE output and insert it below. It should look similar to this:
 [debug] System config: []
 [debug] User config: []
 [debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
 [debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
 [debug] youtube-dl version 2020.01.24
 [debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
 [debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
 [debug] Proxy map: {}
 <more lines>
-->

```
$ youtube-dl -v --write-sub --all-subs -f worst "https://www.hidive.com/stream/food-wars/s01e001"
[debug] System config: []
[debug] User config: [u'--no-call-home']
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--write-sub', u'--all-subs', u'-f', u'worst', u'https://www.hidive.com/stream/food-wars/s01e001']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.01.24
[debug] Python version 2.7.17 (CPython) - Linux-4.15.0-74-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[HiDive] food-wars/s01e001: Downloading JSON metadata
[HiDive] food-wars/s01e001: Downloading m3u8 information
[HiDive] food-wars/s01e001: Downloading m3u8 information
[HiDive] food-wars/s01e001: Downloading m3u8 information
[info] Writing video subtitles to: food-wars_s01e001-food-wars_s01e001.en.vtt
[debug] Invoking downloader on u'https://www.hidive.com/manifest/child/44e859ea5112f40a78407113c08a1dd9a0fd6096/FDW_s01e001_tv_or_na_ja_xx_HLS360p_16x9_00_v.m3u8'
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 151
[download] Destination: food-wars_s01e001-food-wars_s01e001.mp4
[download] 100% of 145.63MiB in 03:31
[debug] ffmpeg command line: ffprobe -show_streams 'file:food-wars_s01e001-food-wars_s01e001.mp4'
[ffmpeg] Fixing malformed AAC bitstream in "food-wars_s01e001-food-wars_s01e001.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:food-wars_s01e001-food-wars_s01e001.mp4' -c copy -f mp4 '-bsf:a' aac_adtstoasc 'file:food-wars_s01e001-food-wars_s01e001.temp.mp4'
```

## Description

<!--
Provide an explanation of your issue in an arbitrary form. Provide any additional information, suggested solution and as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

I'm trying to download a video from HiDive with the Japanese audio and English subtitles. However, it only downloads a limited subtitle file intended to accompany the English dub audio. This .vtt file contains Caption lines (for translating on-screen text and song lyrics) but not Subtitle lines (for translating spoken text).

Even using --all-subs, it only detects and downloads this Captions subtitle file. The full Subtitle file definitely exists, and appears in the browser requests. For comparison, it can be found at
<https://www.hidive.com/caption/vtt/d40c35ce045ef78d47fe727b3690ad27b4d1f8a9/FDW_s01e001_tv_hv_or_ja_en_v02.vtt>.

The output of --list-subs only shows one entry for English. If you look at the example URL, there are not only multiple English subtitles but other foreign-language versions which the youtube-dl extractor doesn't detect. Example:

```
$ youtube-dl --list-subs "https://www.hidive.com/stream/food-wars/s01e001"
[HiDive] food-wars/s01e001: Downloading JSON metadata
[HiDive] food-wars/s01e001: Downloading m3u8 information
[HiDive] food-wars/s01e001: Downloading m3u8 information
[HiDive] food-wars/s01e001: Downloading m3u8 information
Available subtitles for food-wars/s01e001:
Language formats
en       vtt, vtt, vtt
```

My guess is that "vtt, vtt, vtt" means it's interpreting three separate English-language .vtt subtitle files as if they were separate formats of the same file (a problem, since you can't select between them using --sub-lang), and it's failing to detect the Portuguese and Spanish subs entirely.