diff options
author | trizen <trizen@protonmail.com> | 2020-03-13 16:22:25 +0200 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-03-14 12:03:00 -0500 |
commit | d2c82222588f72f2313c2d1658b30ac611d69d06 (patch) | |
tree | 9c3ac0902495c810b0d88212b848433f4a649aeb /bin/fair-viewer | |
parent | fa551c2d122cff235ef79e24833a1223fd7458d0 (diff) | |
download | fair-viewer-d2c82222588f72f2313c2d1658b30ac611d69d06.tar.lz fair-viewer-d2c82222588f72f2313c2d1658b30ac611d69d06.tar.xz fair-viewer-d2c82222588f72f2313c2d1658b30ac611d69d06.zip |
- Extract URLs in description from `descriptionHtml` field. (https://github.com/trizen/fair-viewer/issues/6) - Added the `--api-host=<...>` command-line option for changing the API host. - Fixed the `--info=<URL>` option.
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'bin/fair-viewer')
-rwxr-xr-x | bin/fair-viewer | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/fair-viewer b/bin/fair-viewer index bbd18fc..f6159bc 100755 --- a/bin/fair-viewer +++ b/bin/fair-viewer @@ -796,7 +796,7 @@ usage: $execname [options] ([url] | [keywords]) --use-colors! : enable or disable the ANSI colors for text * Other - --invidious! : use the API of invidio.us to get the streaming URLs + --api-host=s : set an API host from https://instances.invidio.us/ --proxy=s : set HTTP(S)/SOCKS proxy: 'proto://domain.tld:port/' If authentication required, use 'proto://user:pass\@domain.tld:port/' @@ -1593,7 +1593,8 @@ sub parse_arguments { 'merge-into-mkv|mkv-merge!' => \$opt{merge_into_mkv}, 'merge-with-captions|merge-captions!' => \$opt{merge_with_captions}, - 'invidious!' => \$opt{use_invidious_api}, + 'api-host=s' => \$opt{api_host}, + 'convert-command|convert-cmd=s' => \$opt{convert_cmd}, 'dash-m4a|dash-mp4-audio|dash-mp4a!' => \$opt{dash_mp4_audio}, 'dash-segmented!' => \$opt{dash_segmented}, @@ -2127,7 +2128,7 @@ sub get_and_print_video_info { if ($yv_utils->has_entries($info)) { local $opt{show_video_info} = 1; - print_video_info($info->{results}{items}[0]); + print_video_info($info->{results}); } else { warn_cant_do('get info for', $videoID); @@ -2279,7 +2280,7 @@ sub general_options { $callback->($request); } elsif ($option =~ /^(?:R|refresh)\z/ and defined $url) { - @{$results} = @{$yv_obj->_get_results($url)->{results}{items}}; + @{$results} = @{$yv_obj->_get_results($url)->{results}}; } elsif ($option eq 'login') { authenticate(); @@ -3374,7 +3375,7 @@ sub autoplay { while (1) { get_and_play_video_ids($video_id) || return; my $related = $yv_obj->related_to_videoID($video_id); - (my @video_ids = grep { !$seen{$_}++ } map { $yv_utils->get_video_id($_) } @{$related->{results}{items}}) || return; + (my @video_ids = grep { !$seen{$_}++ } map { $yv_utils->get_video_id($_) } @{$related->{results}}) || return; $video_id = $opt{shuffle} ? $video_ids[rand @video_ids] : $video_ids[0]; } @@ -3878,7 +3879,7 @@ sub print_videos { #} } elsif ($opt =~ /^(?:R|refresh)\z/) { - @{$videos} = @{$yv_obj->_get_results($url)->{results}{items}}; + @{$videos} = @{$yv_obj->_get_results($url)->{results}}; $results->{has_extra_info} = 0; } elsif ($opt =~ /^(?:r|return)\z/) { |