aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/gtk-fair-viewer29
-rw-r--r--lib/WWW/FairViewer.pm2
-rw-r--r--share/gtk-fair-viewer.glade79
3 files changed, 85 insertions, 25 deletions
diff --git a/bin/gtk-fair-viewer b/bin/gtk-fair-viewer
index b79b547..401a47e 100755
--- a/bin/gtk-fair-viewer
+++ b/bin/gtk-fair-viewer
@@ -16,7 +16,7 @@
#-------------------------------------------------------
# GTK Fair Viewer
# Fork: 14 February 2020
-# Edit: 15 October 2020
+# Edit: 30 October 2020
# https://framagit.org/heckyel/fair-viewer
#-------------------------------------------------------
@@ -342,6 +342,7 @@ my %objects = (
'comboboxtext8' => \my $duration_combobox,
'comboboxtext3' => \my $caption_combobox,
'comboboxtext4' => \my $definition_combobox,
+ 'comboboxtext5' => \my $license_combobox,
'comboboxtext1' => \my $published_within_combobox,
'comboboxtext13' => \my $subscriptions_order_combobox,
'panel_user_entry' => \my $panel_user_entry,
@@ -854,7 +855,7 @@ sub apply_configuration {
$audio_only_checkbutton->set_active($CONFIG{audio_only});
# DASH mode
- $dash_checkbutton->set_active($CONFIG{dash_support});
+ $dash_checkbutton->set_active($CONFIG{dash_segmented});
$clear_list_checkbutton->set_active($CONFIG{clear_search_list});
$panel_account_type_combobox->set_active($CONFIG{active_panel_account_combobox});
@@ -1698,6 +1699,11 @@ sub combobox_definition_changed {
$yv_obj->set_videoDefinition($text);
}
+sub combobox_license_changed {
+ my $text = $license_combobox->get_active_text;
+ $yv_obj->set_videoLicense($text);
+}
+
sub combobox_published_within_changed {
my $period = $published_within_combobox->get_active_text;
@@ -1737,7 +1743,7 @@ sub toggled_audio_only {
# DASH mode
sub toggled_dash_support {
- $CONFIG{dash_support} = $dash_checkbutton->get_active() || 0;
+ $CONFIG{dash_segmented} = $dash_checkbutton->get_active() || 0;
}
# Check buttons toggles
@@ -2474,7 +2480,9 @@ sub display_results {
if (ref($items) ne 'ARRAY') {
my $current_instance = $yv_obj->get_api_host();
- $yv_obj->pick_and_set_random_instance(); # set a random invidious instance
+
+ # Server error. Pick another invidious instance.
+ # $yv_obj->pick_and_set_random_instance();
die "Probably $current_instance is down.\n"
. "\nTry changing the `api_host` in configuration file:\n\n"
@@ -3136,12 +3144,13 @@ sub run_cli_fair_viewer {
sub get_options_as_arguments {
my @args;
my %options = (
- 'no-interactive' => q{},
- 'resolution' => $CONFIG{resolution},
- 'download-dir' => quotemeta(rel2abs($CONFIG{downloads_dir})),
- 'fullscreen' => $CONFIG{fullscreen} ? q{} : undef,
- 'no-dash' => $CONFIG{dash_support} ? undef : q{},
- 'no-video' => $CONFIG{audio_only} ? q{} : undef,
+ 'no-interactive' => q{},
+ 'resolution' => $CONFIG{resolution},
+ 'download-dir' => quotemeta(rel2abs($CONFIG{downloads_dir})),
+ 'fullscreen' => $CONFIG{fullscreen} ? q{} : undef,
+ 'no-dash' => $CONFIG{dash_support} ? undef : q{},
+ 'no-dash-segmented' => $CONFIG{dash_segmented} ? undef : q{},
+ 'no-video' => $CONFIG{audio_only} ? q{} : undef,
);
while (my ($argv, $value) = each %options) {
diff --git a/lib/WWW/FairViewer.pm b/lib/WWW/FairViewer.pm
index 59b2a80..224c415 100644
--- a/lib/WWW/FairViewer.pm
+++ b/lib/WWW/FairViewer.pm
@@ -445,7 +445,7 @@ sub lwp_get {
}
# Too many errors. Pick another invidious instance.
- $self->pick_and_set_random_instance();
+ # $self->pick_and_set_random_instance();
_warn_reponse_error($response, $url);
return;
diff --git a/share/gtk-fair-viewer.glade b/share/gtk-fair-viewer.glade
index 138312b..d8d22d4 100644
--- a/share/gtk-fair-viewer.glade
+++ b/share/gtk-fair-viewer.glade
@@ -909,6 +909,7 @@ Author: Jesus E. https://framagit.org/heckyel
<object class="GtkComboBoxText" id="comboboxtext10">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="tooltip-text" translatable="yes">Type of search results</property>
<property name="active">0</property>
<items>
<item translatable="yes">video</item>
@@ -962,6 +963,7 @@ Author: Jesus E. https://framagit.org/heckyel
<object class="GtkComboBoxText" id="comboboxtext2">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="tooltip-text" translatable="yes">Search order for videos</property>
<property name="active">0</property>
<items>
<item translatable="yes">relevance</item>
@@ -1055,6 +1057,7 @@ long – longer than 20 minutes</property>
<object class="GtkComboBoxText" id="comboboxtext3">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="tooltip-text" translatable="yes">Retrieve only videos that have closed-captions</property>
<property name="active">0</property>
<items>
<item translatable="yes">any</item>
@@ -1095,6 +1098,7 @@ long – longer than 20 minutes</property>
<object class="GtkComboBoxText" id="comboboxtext4">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="tooltip-text" translatable="yes">Retrieve only videos with resolution 720p+</property>
<property name="active">0</property>
<items>
<item translatable="yes">any</item>
@@ -1121,6 +1125,47 @@ long – longer than 20 minutes</property>
</packing>
</child>
<child>
+ <object class="GtkFrame" id="frame15">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment14">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="left-padding">12</property>
+ <child>
+ <object class="GtkComboBoxText" id="comboboxtext5">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="tooltip-text" translatable="yes">Retrieve only videos with Creative-Commons license</property>
+ <property name="active">0</property>
+ <items>
+ <item translatable="yes">any</item>
+ <item translatable="yes">creative_commons</item>
+ </items>
+ <signal name="changed" handler="combobox_license_changed" swapped="no"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label23">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes">&lt;b&gt;Video License:&lt;/b&gt;</property>
+ <property name="use-markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkExpander" id="more_options_expander">
<property name="visible">True</property>
<property name="can-focus">True</property>
@@ -1146,8 +1191,7 @@ long – longer than 20 minutes</property>
<object class="GtkSpinButton" id="spinbutton1">
<property name="visible">True</property>
<property name="can-focus">True</property>
- <property name="tooltip-text" translatable="yes">The maximum number of results per page.
-Recommended: 10</property>
+ <property name="tooltip-text" translatable="yes">The maximum number of results per page.</property>
<property name="max-length">2</property>
<property name="invisible-char">•</property>
<property name="caps-lock-warning">False</property>
@@ -1242,6 +1286,7 @@ Recommended: 10</property>
<object class="GtkComboBoxText" id="comboboxtext1">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="tooltip-text" translatable="yes">Retrieve only videos newer than this.</property>
<items>
<item translatable="yes">anytime</item>
<item translatable="yes">hour</item>
@@ -1343,6 +1388,7 @@ Unless the author name is valid, this field is ignored.</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes">Show thumbnails for videos in search results.</property>
<property name="draw-indicator">True</property>
<signal name="toggled" handler="thumbs_checkbutton_toggled" swapped="no"/>
</object>
@@ -1358,6 +1404,7 @@ Unless the author name is valid, this field is ignored.</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes">Start videos in fullscreen mode.</property>
<property name="draw-indicator">True</property>
<signal name="toggled" handler="toggled_fullscreen" swapped="no"/>
</object>
@@ -1368,28 +1415,31 @@ Unless the author name is valid, this field is ignored.</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="dash_checkbutton">
- <property name="label" translatable="yes">DASH support</property>
+ <object class="GtkCheckButton" id="audio_only_checkbutton">
+ <property name="label" translatable="yes">Audio only</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes">Play videos as audio.</property>
<property name="draw-indicator">True</property>
- <signal name="toggled" handler="toggled_dash_support" swapped="no"/>
+ <signal name="toggled" handler="toggled_audio_only" swapped="no"/>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="audio_only_checkbutton">
- <property name="label" translatable="yes">Audio only</property>
+ <object class="GtkCheckButton" id="dash_checkbutton">
+ <property name="label" translatable="yes">DASH videos</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes">Support for videos in DASH format.
+When disabled, streams in DASH format will be ignored if there exists an alternative.</property>
<property name="draw-indicator">True</property>
- <signal name="toggled" handler="toggled_audio_only" swapped="no"/>
+ <signal name="toggled" handler="toggled_dash_support" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -1403,13 +1453,14 @@ Unless the author name is valid, this field is ignored.</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes">Clear previous search results after each new search.</property>
<property name="draw-indicator">True</property>
<signal name="toggled" handler="toggled_clear_search_list" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
@@ -1444,7 +1495,7 @@ Unless the author name is valid, this field is ignored.</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">6</property>
+ <property name="position">7</property>
</packing>
</child>
<child>
@@ -1473,7 +1524,7 @@ Unless the author name is valid, this field is ignored.</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">14</property>
- <property name="position">7</property>
+ <property name="position">8</property>
</packing>
</child>
<child>
@@ -1522,7 +1573,7 @@ When the specified resolution is not found, the best available resolution is use
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack-type">end</property>
- <property name="position">8</property>
+ <property name="position">9</property>
</packing>
</child>
</object>