Skip to content

Commit

Permalink
cli: added the --audio, --best, --1440p and --2160p command-l…
Browse files Browse the repository at this point in the history
…ine options.
  • Loading branch information
trizen committed May 14, 2021
1 parent 0b54754 commit ab1995f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion bin/gtk-youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -2110,7 +2110,6 @@ set_local_playlists();
'UCseUQK4kC3x2x543nHtGpzw' => 'Brian Will',
'UC9-y-6csu5WGm29I7JiwpnA' => 'Computerphile',
'UCoxcjq-8xIDTYp3uz647V5A' => 'Numberphile',
'UC6nSFpj9HTCZ5t-N3Rm3-HA' => 'Vsauce',
'UCvBqzzvUBLCs8Y7Axb-jZew' => 'Sixty Symbols',
'UC6107grRI4m0o2-emgoDnAA' => 'SmarterEveryDay',
'UCF6F8LdCSWlRwQm_hfA2bcQ' => 'Coding Math',
Expand Down
7 changes: 7 additions & 0 deletions bin/youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,8 @@ usage: $execname [options] ([url] | [keywords])
--results=i : how many results to display per page (max: 50)
--hfr! : prefer high frame rate (HFR) videos
-2 -3 -4 -7 -1 : resolutions: 240p, 360p, 480p, 720p and 1080p
--audio : prefer audio part only (implied by --novideo)
--best : prefer best resolution available
--resolution=s : supported resolutions: best, 2160p, 1440p,
1080p, 720p, 480p, 360p, 240p, 144p, audio.
Expand Down Expand Up @@ -1631,11 +1633,16 @@ sub parse_arguments {
'update-config!' => sub { dump_configuration($config_file) },

# Resolutions
'audio' => sub { $opt{resolution} = 'audio' },
'144p' => sub { $opt{resolution} = 144 },
'240p|2' => sub { $opt{resolution} = 240 },
'360p|3' => sub { $opt{resolution} = 360 },
'480p|4' => sub { $opt{resolution} = 480 },
'720p|7' => sub { $opt{resolution} = 720 },
'1080p|1' => sub { $opt{resolution} = 1080 },
'1440p' => sub { $opt{resolution} = 1440 },
'2160p' => sub { $opt{resolution} = 2160 },
'best' => sub { $opt{resolution} = 'best' },

'hfr!' => \$opt{hfr},
'res|resolution=s' => \$opt{resolution},
Expand Down

0 comments on commit ab1995f

Please sign in to comment.