Skip to content

Commit

Permalink
Fix metadata fetching for YouTube URLs
Browse files Browse the repository at this point in the history
YouTube responds with a redirect if it thinks that the user agent is too
old. This commit changes the user agent string to that of a current
version of Firefox. See also
#531 (comment).
  • Loading branch information
puppe committed Jan 30, 2024
1 parent 391ea43 commit d713053
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/http/HttpUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ function get_http_response(
}

$userAgent =
'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:45.0)'
. ' Gecko/20100101 Firefox/45.0';
'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:115.0)'
. ' Gecko/20100101 Firefox/115.0';
$acceptLanguage =
substr(get_locale(LC_COLLATE), 0, 2) . ',en-US;q=0.7,en;q=0.3';
$maxRedirs = 3;
Expand Down

0 comments on commit d713053

Please sign in to comment.