-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print video information in the CLI (#951)
* Store clip framerate as decimal instead of double * Use null instead of default to represent lack of value for M3U8.Metadata * Create initial streaminfo arguments * Create Table.cs * Create initial implementation for StreamInfo.cs * Make M3U8.Metadata properties init * Refactor * Use progress reporter where appropriate * Provide at least 3 digits when stringifying byte count * Fetch clip curator & clip/vod broadcaster login * Switch from TwitchDownloaderCLI.Tools.Table to Spectre.Console.Table * Hide JSON format from help text * Extract code into dedicated methods * Cleanup * More cleanup * Fix tests * Add video chapter table * Oops * Better timestamp strings * Display ASCII login for users with non-ASCII usernames, cleanup * Ensure output encoding is UTF-8 * Add README entry * StreamInfo -> Info * Only link user page if login is present * Fix NRE * Info -> InfoHandler * Remove redundant cast
- Loading branch information
Showing
14 changed files
with
624 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using CommandLine; | ||
using TwitchDownloaderCLI.Models; | ||
|
||
namespace TwitchDownloaderCLI.Modes.Arguments | ||
{ | ||
[Verb("info", HelpText = "Prints stream information about a VOD or clip to stdout")] | ||
internal sealed class InfoArgs : ITwitchDownloaderArgs | ||
{ | ||
[Option('u', "id", Required = true, HelpText = "The ID or URL of the VOD or clip to print the stream info about.")] | ||
public string Id { get; set; } | ||
|
||
[Option('f', "format", Default = InfoPrintFormat.Table, HelpText = "The format in which the information should be printed. When using table format, use a terminal that supports ANSI escape sequences for best results. Valid values are: Raw, Table, and M3U/M3U8")] | ||
public InfoPrintFormat Format { get; set; } | ||
|
||
[Option("use-utf8", Default = true, HelpText = "Ensures UTF-8 encoding is used when writing results to standard output.")] | ||
public bool? UseUtf8 { get; set; } | ||
|
||
[Option("oauth", HelpText = "OAuth access token to access subscriber only VODs. DO NOT SHARE THIS WITH ANYONE.")] | ||
public string Oauth { get; set; } | ||
|
||
// Interface args | ||
public bool? ShowBanner { get; set; } | ||
public LogLevel LogLevel { get; set; } | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.