yt-dlp / yt-dlp

A feature-rich command-line audio/video downloader
https://discord.gg/H5MNcFW63r
The Unlicense
82.87k stars 6.46k forks source link

Twitch VODs: preserve category #4421

Closed mpeter50 closed 2 years ago

mpeter50 commented 2 years ago

Checklist

Region

No response

Example URLs

http://www.twitch.tv/riotgames/v/6528877

Provide a description that is worded well enough to be understood

The category of the downloaded stream is archived as chapters, but only when the stream had multiple categories over its lifetime. If the category was the same from the start to the end, the chapter information returned by Twitch will be empty.

Currently this means, that if the category didn't change in a stream, then its category is not saved.

I was thinking on how to fix this, but I'm not sure which approach would be appropriate:

The 3rd option is probably not an option. The first would be better because then every downloaded VOD would consistently have chapters with the appropriate category. The second might be more appropriate, though, but a few things are not clear to me in how would they be appropriate:

Something to consider: Twitch seems to handle the Creative and IRL main categories as the Game category: check the URLs of listed subcategories of them. This means that differentiating between Games, IRL and Creative subcategories might not be straightforward.

Provide verbose output that clearly demonstrates the problem

Complete Verbose Output

[debug] Command-line config: ['http://www.twitch.tv/riotgames/v/6528877', '--sub-langs', 'all,live_chat', '--verbose', '--write-info-json', '--output', 'H:\\temp\\%(extractor_key)s\\%(uploader)s\\%(upload_date)s_%(uploader)s_%(title)s_%(resolution)s-%(fps)dfps.%(ext)s', '--skip-download']
[debug] User config "C:\Users\XXXX\AppData\Roaming\yt-dlp\config.txt": ['--output', 'H:\\Videos-Streams\\%(extractor_key)s\\%(uploader)s\\%(upload_date)s_%(uploader)s_%(title)s_%(resolution)s-%(fps)dfps.%(ext)s', '-f', 'bestvideo[height<=?1080]+bestaudio/best', '--no-overwrites', '--write-description', '--write-info-json', '--console-title', '--merge-output-format', 'mkv', '--add-metadata', '--ignore-errors', '--retries', '200', '--fragment-retries', 'infinite', '--write-sub', '--write-auto-sub', '--sub-lang', 'en,en-us,hu,live_chat', '--sub-format', 'vtt', '--embed-subs', '--embed-metadata', '--embed-thumbnail', '--concurrent-fragments', '4', '--prefer-free-formats', '--remux-video', 'mkv', '--write-comments', '-N', '32']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out UTF-8 (No ANSI), error UTF-8 (No ANSI), screen UTF-8 (No ANSI)
[debug] yt-dlp version 2022.07.18 [135f05ef6] (source)
[debug] Lazy loading extractors is disabled
[debug] Plugins: ['SamplePluginIE', 'SamplePluginPP']
[debug] Git HEAD: 7de38008f
[debug] Python 3.7.2 (CPython 64bit) - Windows-10-XXXXXX-SP0 
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 4.3.2-2021-02-27-full_build-www.gyan.dev, ffprobe 4.3.2-2021-02-27-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.11.0, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.0
[debug] Proxy map: {}
[debug] [twitch:vod] Extracting URL: http://www.twitch.tv/riotgames/v/6528877
[twitch:vod] 6528877: Downloading stream metadata GraphQL
[twitch:vod] 6528877: Downloading video access token GraphQL
[twitch:vod] 6528877: Downloading m3u8 information
[twitch:vod] 6528877: Downloading storyboard metadata JSON
[twitch:vod] Downloading chat fragment JSONs
[twitch:vod] 6528877: Downloading chat fragment JSON page 1
[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
[twitch:vod] Extracted 0 chat messages
[info] v6528877: Downloading 1 format(s): 720p-1
WARNING: There's no video description to write
[info] Downloading video thumbnail 0 ...
[info] Writing video thumbnail 0 to: H:\temp\TwitchVod\Riot Games\20150624_Riot Games_LCK Summer Split - Week 6 Day 1_1280x720-29fps.jpg
[info] Writing video metadata as JSON to: H:\temp\TwitchVod\Riot Games\20150624_Riot Games_LCK Summer Split - Week 6 Day 1_1280x720-29fps.info.json
pukkandan commented 2 years ago

I think the chapter idea makes sense and is the most consistent with what we already have