Skip to content

Commit

Permalink
Removed the default API key and the client ID/SECRET values, as they …
Browse files Browse the repository at this point in the history
…will no longer work. (#308)
  • Loading branch information
trizen committed Feb 25, 2020
1 parent f84942f commit c3819da
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 49 deletions.
17 changes: 1 addition & 16 deletions bin/gtk2-youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -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
#-------------------------------------------------------

Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -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 => [],
Expand All @@ -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},
Expand All @@ -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";
Expand Down
17 changes: 1 addition & 16 deletions bin/gtk3-youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -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
#-------------------------------------------------------

Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -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 => [],
Expand All @@ -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},
Expand All @@ -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";
Expand Down
17 changes: 1 addition & 16 deletions bin/youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -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
#-------------------------------------------------------

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -626,27 +623,15 @@ 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},
use_invidious_api => $opt{use_invidious_api},
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";
Expand Down
2 changes: 1 addition & 1 deletion lib/WWW/YoutubeViewer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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},

Expand Down

0 comments on commit c3819da

Please sign in to comment.