Skip to content

Commit

Permalink
Add "html5=1" to the get_video_info url. (fixes trizen/youtube-view…
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed May 20, 2021
1 parent f66db94 commit 4643610
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/WWW/PipeViewer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ my %valid_options = (
api_path => {valid => q[], default => '/api/v1/'},
video_info_url => {valid => q[], default => 'https://www.youtube.com/get_video_info'},
oauth_url => {valid => q[], default => 'https://accounts.google.com/o/oauth2/'},
video_info_args => {valid => q[], default => '?video_id=%s&el=detailpage&eurl=&gl=US&hl=en'},
video_info_args => {valid => q[], default => '?video_id=%s&el=detailpage&ps=default&eurl=&gl=US&hl=en&html5=1'},
www_content_type => {valid => q[], default => 'application/x-www-form-urlencoded'},
m_youtube_url => {valid => q[], default => 'https://m.youtube.com'},

Expand Down Expand Up @@ -461,7 +461,7 @@ sub lwp_get {
$opt{depth} ||= 0;

# Try again on 500+ HTTP errors
if ( $opt{depth} < 2
if ( $opt{depth} < 1
and $response->code() >= 500
and $response->status_line() =~ /(?:Temporary|Server) Error|Timeout|Service Unavailable/i) {
return $self->lwp_get($url, %opt, depth => $opt{depth} + 1);
Expand Down

0 comments on commit 4643610

Please sign in to comment.