lay295 / TwitchDownloader

Twitch VOD/Clip Downloader - Chat Download/Render/Replay
MIT License
2.68k stars 261 forks source link

CLI Tool - Any way to get list of qualities? #942

Closed alvin-xu-5745 closed 2 months ago

alvin-xu-5745 commented 8 months ago

Checklist

Write stuff here

I am using the CLI tool to automate some VOD downloading in a script, however I need my VODs to all be the same quality so I need to know what possible qualities exist for a certain VOD.

In the GUI tool, after you input the VOD ID you get a dropdown box of the possible qualities to download for that VOD. Is there any equivalent way to do this using the CLI tool?

Related to this - is there any way for me to know if the quality I request doesn't exist? The documentation states that if it the specified quality isn't available it just defaults to the highest quality, but I would rather not have silent failure and instead know if it is unavailable so I can choose to just not download that VOD.

ScrubN commented 8 months ago

Is there any equivalent way to do this using the CLI tool?

No, there does not currently exist a way to list the qualities of a given video/clip in the CLI, however I have thought about adding this feature many times.

My thought process is to take in the video link/id and print a table of the video's streams information. i.e.

$ ./TwitchDownloaderCLI streaminfo --id 123456789
[LOG] Fetching Video Info [1/1]
Name       Resolution FPS File Size Bitrate  Source
---------------------------------------------------
1080p60    1920x1080  60  18.35GB   8451kbps True
720p60     1280x720   60  7.48GB    3443kbps False
720p30     1280x720   30  5.27GB    2422kbps False
480p30     852x480    30  3.15GB    1452kbps False
360p30     640x360    30  1.54GB    707kbps  False
160p30     284x160    30  642.1MB   288kbps  False
Audio Only -          -   488.8MB   219kbps  False

I'm aware that tables aren't amazing for machine parsing though, so I could add an argument for switching the printed output to other formats, such as m3u8 or JSON.

$ ./TwitchDownloaderCLI streaminfo --id 123456789 --format m3u8
$ ./TwitchDownloaderCLI streaminfo --id 123456789 --format json

What do you think of this solution?

alvin-xu-5745 commented 8 months ago

Yes, I think this would be a great solution.

superbonaci commented 7 months ago

It can be helpful. Can you print the list of qualities for any video even if it's subscriber-only VOD?

ScrubN commented 2 months ago

It can be helpful. Can you print the list of qualities for any video even if it's subscriber-only VOD?

Yes, sub only VODs are supported.

ScrubN commented 2 months ago

I made a lot of progress on this feature recently and it is almost ready to be released. I just wanted to ask if you think it should be in a single verb: ./TwitchDownloader info --id <id> or in separate verbs: ./TwitchDownloader videoinfo --id <id>, ./TwitchDownloader clipinfo --id <id>.

The advantage of separate verbs is that it mirrors the video/clip downloaders, and allows playlists/collections to be passed (future) by ID instead of needing the full URL as it is not possible to discriminate collection IDs from Clip IDs without a network request.

The advantage of a single verb is that its less for the user to type.

What are your thoughts?

superbonaci commented 2 months ago

I think it would be better to be in a single verb, and show if it's clip, video, or other.