@@ -7,11 +7,13 @@ use warnings;
77use Memoize;
88use Memoize::Expire;
99
10- tie my %youtubei_cache => ' Memoize::Expire' ,
11- LIFETIME => 600, # in seconds
12- NUM_USES => 2;
10+ # <<<
11+ # ~ tie my %youtubei_cache => 'Memoize::Expire',
12+ # ~ LIFETIME => 600, # in seconds
13+ # ~ NUM_USES => 2;
1314
14- memoize ' _get_youtubei_content' , SCALAR_CACHE => [HASH => \%youtubei_cache ];
15+ # ~ memoize '_get_youtubei_content', SCALAR_CACHE => [HASH => \%youtubei_cache];
16+ # >>>
1517
1618# memoize('_get_video_info');
1719memoize(' _ytdl_is_available' );
@@ -1079,14 +1081,16 @@ sub _get_youtubei_content {
10791081 $self -> {lwp }-> agent($android_useragent );
10801082 }
10811083
1084+ my $client_version = sprintf (" 2.%s .00.00" , Time::Piece-> new(time )-> strftime(" %Y%m%d " ));
1085+
10821086 my %web = (
10831087 " videoId" => $videoID ,
10841088 " context" => {
10851089 " client" => {
10861090 " hl" => " en" ,
10871091 " gl" => " US" ,
10881092 " clientName" => " WEB" ,
1089- " clientVersion" => sprintf ( " 2. %s .00.00 " , Time::Piece -> new( time ) -> strftime( " %Y%m%d " )) ,
1093+ " clientVersion" => $client_version ,
10901094 %args ,
10911095 },
10921096 },
@@ -1099,25 +1103,14 @@ sub _get_youtubei_content {
10991103 " hl" => " en" ,
11001104 " gl" => " US" ,
11011105 " clientName" => " MWEB" ,
1102- " clientVersion" => sprintf ( " 2. %s .00.00 " , Time::Piece -> new( time ) -> strftime( " %Y%m%d " )) ,
1106+ " clientVersion" => $client_version ,
11031107 %args ,
11041108 },
11051109 },
11061110 );
11071111
11081112 if (0) {
1109- %android = (
1110- " videoId" => $videoID ,
1111- " context" => {
1112- " client" => {
1113- " hl" => " en" ,
1114- " gl" => " US" ,
1115- " clientName" => " MWEB" ,
1116- " clientVersion" => sprintf (" 2.%s .03.00" , Time::Piece-> new(time )-> strftime(" %Y%m%d " )),
1117- %args ,
1118- }
1119- },
1120- );
1113+ %android = %mweb ;
11211114 }
11221115
11231116 local $self -> {access_token } = undef ;
0 commit comments