From c3819da2036e1cfa79b67ec9b865c93c336c9fa6 Mon Sep 17 00:00:00 2001 From: trizen Date: Tue, 25 Feb 2020 11:20:50 +0200 Subject: [PATCH] Removed the default API key and the client ID/SECRET values, as they will no longer work. (https://github.com/trizen/youtube-viewer/issues/308) --- bin/gtk2-youtube-viewer | 17 +---------------- bin/gtk3-youtube-viewer | 17 +---------------- bin/youtube-viewer | 17 +---------------- lib/WWW/YoutubeViewer.pm | 2 +- 4 files changed, 4 insertions(+), 49 deletions(-) diff --git a/bin/gtk2-youtube-viewer b/bin/gtk2-youtube-viewer index ca5c64e3..d8dbc136 100755 --- a/bin/gtk2-youtube-viewer +++ b/bin/gtk2-youtube-viewer @@ -15,7 +15,7 @@ #------------------------------------------------------- # GTK YouTube Viewer # Created on: 12 September 2010 -# Latest edit on: 15 February 2020 +# Latest edit on: 25 February 2020 # https://github.com/trizen/youtube-viewer #------------------------------------------------------- @@ -54,9 +54,6 @@ my $share_dir = $DEVEL ? '../share' : dist_dir('WWW-YoutubeViewer'); sub VIDEO_PART () { 'contentDetails,statistics,snippet' } -# Developer key -my $key = 'aXalQYmzI8gPkMSLyMhpApfMAiU2b23Qz2nE3mq'; - # Configuration dir/file my $home_dir; my $xdg_config_home = $ENV{XDG_CONFIG_HOME}; @@ -734,11 +731,6 @@ if (not defined $CONFIG{terminal}) { $CONFIG{terminal} //= $ENV{TERM} || 'xterm'; } -{ - my $i = length $key; - $key =~ s/(.{$i})(.)/$2$1/g while --$i; -} - my %ResultsHistory = ( current => -1, results => [], @@ -749,7 +741,6 @@ $CONFIG{youtube_viewer} //= which_command('youtube-viewer') // 'youtube-viewer'; my $yv_obj = WWW::YoutubeViewer->new( escape_utf8 => 1, - key => $key, config_dir => $config_dir, hl => $CONFIG{hl}, lwp_env_proxy => $CONFIG{env_proxy}, @@ -758,12 +749,6 @@ my $yv_obj = WWW::YoutubeViewer->new( authentication_file => $authentication_file, ); -{ - $yv_obj->set_client_id("x{IVfHx\0heYZI,)\22+\x1D2\\\6\n\35\25\31?(\32\23\t#L\b\x141\@Q]<" ^ $key); - $yv_obj->set_client_secret("\26/Ae]3\b\6\x186a:*#0\32\t\f\n\27\17GC`" ^ substr($key, -24)); - $yv_obj->set_redirect_uri('urn:ietf:wg:oauth:2.0:oob'); -} - if (-f $api_file) { open(my $fh, '<', $api_file) or die "[!] Can't open file <<$api_file>> for reading: $!\n"; diff --git a/bin/gtk3-youtube-viewer b/bin/gtk3-youtube-viewer index 9c64d1ef..422d7a1d 100755 --- a/bin/gtk3-youtube-viewer +++ b/bin/gtk3-youtube-viewer @@ -15,7 +15,7 @@ #------------------------------------------------------- # GTK YouTube Viewer # Created on: 12 September 2010 -# Latest edit on: 15 February 2020 +# Latest edit on: 25 February 2020 # https://github.com/trizen/youtube-viewer #------------------------------------------------------- @@ -54,9 +54,6 @@ my $share_dir = $DEVEL ? '../share' : dist_dir('WWW-YoutubeViewer'); sub VIDEO_PART () { 'contentDetails,statistics,snippet' } -# Developer key -my $key = 'aXalQYmzI8gPkMSLyMhpApfMAiU2b23Qz2nE3mq'; - # Configuration dir/file my $home_dir; my $xdg_config_home = $ENV{XDG_CONFIG_HOME}; @@ -797,11 +794,6 @@ if (not defined $CONFIG{terminal}) { $CONFIG{terminal} //= $ENV{TERM} || 'xterm'; } -{ - my $i = length $key; - $key =~ s/(.{$i})(.)/$2$1/g while --$i; -} - my %ResultsHistory = ( current => -1, results => [], @@ -812,7 +804,6 @@ $CONFIG{youtube_viewer} //= which_command('youtube-viewer') // 'youtube-viewer'; my $yv_obj = WWW::YoutubeViewer->new( escape_utf8 => 1, - key => $key, config_dir => $config_dir, hl => $CONFIG{hl}, lwp_env_proxy => $CONFIG{env_proxy}, @@ -821,12 +812,6 @@ my $yv_obj = WWW::YoutubeViewer->new( authentication_file => $authentication_file, ); -{ - $yv_obj->set_client_id("x{IVfHx\0heYZI,)\22+\x1D2\\\6\n\35\25\31?(\32\23\t#L\b\x141\@Q]<" ^ $key); - $yv_obj->set_client_secret("\26/Ae]3\b\6\x186a:*#0\32\t\f\n\27\17GC`" ^ substr($key, -24)); - $yv_obj->set_redirect_uri('urn:ietf:wg:oauth:2.0:oob'); -} - if (-f $api_file) { open(my $fh, '<', $api_file) or die "[!] Can't open file <<$api_file>> for reading: $!\n"; diff --git a/bin/youtube-viewer b/bin/youtube-viewer index c570749a..0f6fc383 100755 --- a/bin/youtube-viewer +++ b/bin/youtube-viewer @@ -15,7 +15,7 @@ #------------------------------------------------------- # youtube-viewer # Created on: 02 June 2010 -# Latest edit on: 15 February 2020 +# Latest edit on: 25 February 2020 # https://github.com/trizen/youtube-viewer #------------------------------------------------------- @@ -97,9 +97,6 @@ my $execname = 'youtube-viewer'; require Term::ReadLine; my $term = Term::ReadLine->new("$appname $version"); -# Developer key -my $key = 'aXalQYmzI8gPkMSLyMhpApfMAiU2b23Qz2nE3mq'; - sub VIDEO_PART () { 'contentDetails,statistics,snippet' } # Options (key=>value) goes here @@ -626,14 +623,8 @@ if ($opt{history}) { } } -{ - my $i = length $key; - $key =~ s/(.{$i})(.)/$2$1/g while --$i; -} - my $yv_obj = WWW::YoutubeViewer->new( escape_utf8 => 1, - key => $key, config_dir => $config_dir, cache_dir => $opt{cache_dir}, lwp_env_proxy => $opt{env_proxy}, @@ -641,12 +632,6 @@ my $yv_obj = WWW::YoutubeViewer->new( authentication_file => $authentication_file, ); -{ - $yv_obj->set_client_id("x{IVfHx\0heYZI,)\22+\x1D2\\\6\n\35\25\31?(\32\23\t#L\b\x141\@Q]<" ^ $key); - $yv_obj->set_client_secret("\26/Ae]3\b\6\x186a:*#0\32\t\f\n\27\17GC`" ^ substr($key, -24)); - $yv_obj->set_redirect_uri('urn:ietf:wg:oauth:2.0:oob'); -} - if (-f $api_file) { open(my $fh, '<', $api_file) or die "[!] Can't open file <<$api_file>> for reading: $!\n"; diff --git a/lib/WWW/YoutubeViewer.pm b/lib/WWW/YoutubeViewer.pm index 9f0b54f4..06615aa2 100644 --- a/lib/WWW/YoutubeViewer.pm +++ b/lib/WWW/YoutubeViewer.pm @@ -90,7 +90,7 @@ my %valid_options = ( key => {valid => [qr/^.{15}/], default => undef}, client_id => {valid => [qr/^.{15}/], default => undef}, client_secret => {valid => [qr/^.{15}/], default => undef}, - redirect_uri => {valid => [qr/^.{15}/], default => undef}, + redirect_uri => {valid => [qr/^.{15}/], default => 'urn:ietf:wg:oauth:2.0:oob'}, access_token => {valid => [qr/^.{15}/], default => undef}, refresh_token => {valid => [qr/^.{15}/], default => undef},