Skip to content

Commit 6a21aed

Browse files
committed
- gtk3: added the "Video License" combobox.
Allows searching for videos that have the "Creative Common" license. - Added a few more tooltips in the gtk3 version.
1 parent bc5aca4 commit 6a21aed

File tree

3 files changed

+97
-35
lines changed

3 files changed

+97
-35
lines changed

bin/gtk3-youtube-viewer

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#-------------------------------------------------------
1616
# GTK YouTube Viewer
1717
# Created on: 12 September 2010
18-
# Latest edit on: 15 October 2020
18+
# Latest edit on: 01 November 2020
1919
# https://github.com/trizen/youtube-viewer
2020
#-------------------------------------------------------
2121

@@ -352,6 +352,7 @@ my %objects = (
352352
'comboboxtext8' => \my $duration_combobox,
353353
'comboboxtext3' => \my $caption_combobox,
354354
'comboboxtext4' => \my $definition_combobox,
355+
'comboboxtext10' => \my $license_combobox,
355356
'comboboxtext5' => \my $safesearch_combobox,
356357
'comboboxtext1' => \my $published_within_combobox,
357358
'comboboxtext13' => \my $subscriptions_order_combobox,
@@ -879,6 +880,7 @@ $definition_combobox->set_active(0);
879880
$duration_combobox->set_active(0);
880881
$caption_combobox->set_active(0);
881882
$order_combobox->set_active(0);
883+
$license_combobox->set_active(0);
882884

883885
# Spin button start with page
884886
$spin_start_with_page->set_value(1);
@@ -895,7 +897,7 @@ sub apply_configuration {
895897
$audio_only_checkbutton->set_active($CONFIG{audio_only});
896898

897899
# DASH mode
898-
$dash_checkbutton->set_active($CONFIG{dash_support});
900+
$dash_checkbutton->set_active($CONFIG{dash_segmented});
899901

900902
$clear_list_checkbutton->set_active($CONFIG{clear_search_list});
901903
$panel_account_type_combobox->set_active($CONFIG{active_panel_account_combobox});
@@ -1795,6 +1797,11 @@ sub combobox_definition_changed {
17951797
$yv_obj->set_videoDefinition($text);
17961798
}
17971799

1800+
sub combobox_license_changed {
1801+
my $text = $license_combobox->get_active_text;
1802+
$yv_obj->set_videoLicense($text);
1803+
}
1804+
17981805
sub combobox_published_within_changed {
17991806
my $period = $published_within_combobox->get_active_text;
18001807

@@ -1848,7 +1855,7 @@ sub toggled_audio_only {
18481855

18491856
# DASH mode
18501857
sub toggled_dash_support {
1851-
$CONFIG{dash_support} = $dash_checkbutton->get_active() || 0;
1858+
$CONFIG{dash_segmented} = $dash_checkbutton->get_active() || 0;
18521859
}
18531860

18541861
# Check buttons toggles
@@ -3360,12 +3367,12 @@ sub run_cli_youtube_viewer {
33603367
sub get_options_as_arguments {
33613368
my @args;
33623369
my %options = (
3363-
'no-interactive' => q{},
3364-
'resolution' => $CONFIG{resolution},
3365-
'download-dir' => quotemeta(rel2abs($CONFIG{downloads_dir})),
3366-
'fullscreen' => $CONFIG{fullscreen} ? q{} : undef,
3367-
'no-dash' => $CONFIG{dash_support} ? undef : q{},
3368-
'no-video' => $CONFIG{audio_only} ? q{} : undef,
3370+
'no-interactive' => q{},
3371+
'resolution' => $CONFIG{resolution},
3372+
'download-dir' => quotemeta(rel2abs($CONFIG{downloads_dir})),
3373+
'fullscreen' => $CONFIG{fullscreen} ? q{} : undef,
3374+
'no-dash-segmented' => $CONFIG{dash_segmented} ? undef : q{},
3375+
'no-video' => $CONFIG{audio_only} ? q{} : undef,
33693376
);
33703377

33713378
while (my ($argv, $value) = each %options) {

lib/WWW/YoutubeViewer.pm

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,21 @@ my %valid_options = (
6060
channelType => {valid => [qw(any show)], default => undef},
6161

6262
# Video only options
63-
videoCaption => {valid => [qw(any closedCaption none)], default => undef},
64-
videoDefinition => {valid => [qw(any high standard)], default => undef},
65-
videoCategoryId => {valid => qr/^\d+\z/, default => undef},
66-
videoDimension => {valid => [qw(any 2d 3d)], default => undef},
67-
videoDuration => {valid => [qw(any short medium long)], default => undef},
68-
videoEmbeddable => {valid => [qw(any true)], default => undef},
69-
videoLicense => {valid => [qw(any creativeCommon youtube)], default => undef},
70-
videoSyndicated => {valid => [qw(any true)], default => undef},
71-
eventType => {valid => [qw(completed live upcoming)], default => undef},
72-
chart => {valid => [qw(mostPopular)], default => undef},
63+
videoCaption => {valid => [qw(closedCaption none)], default => undef},
64+
videoDefinition => {valid => [qw(high standard)], default => undef},
65+
videoCategoryId => {valid => qr/^\d+\z/, default => undef},
66+
videoDimension => {valid => [qw(2d 3d)], default => undef},
67+
videoDuration => {valid => [qw(short medium long)], default => undef},
68+
videoEmbeddable => {valid => [qw(true)], default => undef},
69+
videoLicense => {valid => [qw(creativeCommon youtube)], default => undef},
70+
videoSyndicated => {valid => [qw(true)], default => undef},
71+
eventType => {valid => [qw(completed live upcoming)], default => undef},
72+
chart => {valid => [qw(mostPopular)], default => undef},
7373

7474
regionCode => {valid => qr/^[A-Z]{2}\z/i, default => undef},
7575
relevanceLanguage => {valid => qr/^[a-z]+(?:\-\w+)?\z/i, default => undef},
7676
safeSearch => {valid => [qw(none moderate strict)], default => undef},
77-
videoType => {valid => [qw(any episode movie)], default => undef},
77+
videoType => {valid => [qw(episode movie)], default => undef},
7878

7979
comments_order => {valid => [qw(time relevance)], default => 'time'},
8080
subscriptions_order => {valid => [qw(alphabetical relevance unread)], default => undef},

0 commit comments

Comments
 (0)