aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md14
-rwxr-xr-xbin/fair-viewer54
2 files changed, 30 insertions, 38 deletions
diff --git a/README.md b/README.md
index 3a1121c..ab61121 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
## fair-viewer
-A lightweight application for searching and streaming videos from YouTube, using the [API](https://github.com/omarroth/invidious/wiki/API) of [invidio.us](https://invidio.us/) and [hypervideo](https://framagit.org/heckyel/hypervideo) support.
+A lightweight application for searching and playing videos from YouTube, using the [API](https://github.com/omarroth/invidious/wiki/API) of [invidio.us](https://invidio.us/) and [hypervideo](https://framagit.org/heckyel/hypervideo) support.
### fair-viewer
@@ -41,12 +41,12 @@ To install `gtk-fair-viewer` along with `fair-viewer`, run:
For trying the latest commit of `fair-viewer`, without installing it, execute the following commands:
```console
-cd /tmp
-wget https://libregit.org/heckyel/fair-viewer/archive/master.zip -O fair-viewer-master.zip
-unzip -n fair-viewer-master.zip
-cd fair-viewer-master/bin
-perl -pi -ne 's{DEVEL = 0}{DEVEL = 1}' {gtk-,}fair-viewer
-./fair-viewer
+ cd /tmp
+ wget https://libregit.org/heckyel/fair-viewer/archive/master.zip -O fair-viewer-master.zip
+ unzip -n fair-viewer-master.zip
+ cd fair-viewer-master/bin
+ perl -pi -ne 's{DEVEL = 0}{DEVEL = 1}' {gtk-,}fair-viewer
+ ./fair-viewer
```
### CONFIGURATIONS
diff --git a/bin/fair-viewer b/bin/fair-viewer
index b838f88..6e391ad 100755
--- a/bin/fair-viewer
+++ b/bin/fair-viewer
@@ -3784,28 +3784,24 @@ sub print_videos {
)
) {
if ($opt{play_backwards}) {
- #if (defined $info->{prevPageToken}) {
- if (defined($url)) {
+ if (defined($url)) {
__SUB__->($yv_obj->previous_page($url), auto => 1);
- }
- #}
- #else {
- # $opt{play_backwards} = 0;
- # warn_first_page();
- # return;
- #}
+ }
+ else {
+ $opt{play_backwards} = 0;
+ warn_first_page();
+ return;
+ }
}
else {
- #if (defined $info->{nextPageToken}) {
if (defined($url)) {
__SUB__->($yv_obj->next_page($url), auto => 1);
}
- #}
- #else {
- # $opt{play_all} = 0;
- # warn_last_page();
- # return;
- #}
+ else {
+ $opt{play_all} = 0;
+ warn_last_page();
+ return;
+ }
}
}
else {
@@ -3853,30 +3849,26 @@ sub print_videos {
press_enter_to_continue();
}
elsif ($opt =~ /^(?:n|next)\z/) {
- #if (defined $info->{nextPageToken}) {
if (defined($url)) {
my $request = $yv_obj->next_page($url);
__SUB__->($request, @keywords ? (auto => 1) : ());
}
- #}
- #else {
- # warn_last_page();
- # if ($opt{auto_next_page}) {
- # $opt{auto_next_page} = 0;
- # @copy_of_keywords = ();
- # last;
- # }
- #}
+ else {
+ warn_last_page();
+ if ($opt{auto_next_page}) {
+ $opt{auto_next_page} = 0;
+ @copy_of_keywords = ();
+ last;
+ }
+ }
}
elsif ($opt =~ /^(?:b|back|p|prev|previous)\z/) {
- #if (defined $info->{prevPageToken}) {
if (defined($url)) {
__SUB__->($yv_obj->previous_page($url), @keywords ? (auto => 1) : ());
}
- #}
- #else {
- # warn_first_page();
- #}
+ else {
+ warn_first_page();
+ }
}
elsif ($opt =~ /^(?:R|refresh)\z/) {
@{$videos} = @{$yv_obj->_get_results($url)->{results}};