fix yt blurry thumbnails
This commit is contained in:
+20
-5
@@ -587,6 +587,25 @@ class yt{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$thumbnail =
|
||||||
|
$video["thumbnail"]
|
||||||
|
["thumbnails"]
|
||||||
|
[0]
|
||||||
|
["url"];
|
||||||
|
|
||||||
|
$filename = basename(parse_url($thumbnail, PHP_URL_PATH));
|
||||||
|
|
||||||
|
if(
|
||||||
|
$filename == "hq720.jpg" ||
|
||||||
|
$filename == "mqdefault.jpg"
|
||||||
|
){
|
||||||
|
|
||||||
|
// fetch trackerless version
|
||||||
|
// its bigger and consumes more bandwidth, but it wont serve
|
||||||
|
// blurred out thumbnails
|
||||||
|
$thumbnail = "https://i.ytimg.com/vi/{$video["videoId"]}/{$filename}";
|
||||||
|
}
|
||||||
|
|
||||||
$out[$type][] = [
|
$out[$type][] = [
|
||||||
"title" =>
|
"title" =>
|
||||||
$this->assemble_runs(
|
$this->assemble_runs(
|
||||||
@@ -666,11 +685,7 @@ class yt{
|
|||||||
) : null,
|
) : null,
|
||||||
"thumb" => [
|
"thumb" => [
|
||||||
"ratio" => "16:9",
|
"ratio" => "16:9",
|
||||||
"url" =>
|
"url" => $thumbnail
|
||||||
$video["thumbnail"]
|
|
||||||
["thumbnails"]
|
|
||||||
[0]
|
|
||||||
["url"]
|
|
||||||
],
|
],
|
||||||
"url" => "https://www.youtube.com/watch?v=" . $video["videoId"]
|
"url" => "https://www.youtube.com/watch?v=" . $video["videoId"]
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user