1
Fork 0
mirror of https://git.lolcat.ca/lolcat/4get.git synced 2024-12-24 23:56:34 -05:00

fix yandex image scraper

This commit is contained in:
lolcat 2024-07-27 11:43:10 -04:00
parent 497dacd42e
commit 143c0c1364

View file

@ -751,6 +751,13 @@ class yandex{
"url" => htmlspecialchars_decode($image["snippet"]["url"]) "url" => htmlspecialchars_decode($image["snippet"]["url"])
]; ];
// add preview URL
$tmp["source"][] = [
"url" => htmlspecialchars_decode($image["viewerData"]["preview"][0]["url"]),
"width" => (int)$image["viewerData"]["preview"][0]["w"],
"height" => (int)$image["viewerData"]["preview"][0]["h"],
];
foreach($image["viewerData"]["dups"] as $dup){ foreach($image["viewerData"]["dups"] as $dup){
$tmp["source"][] = [ $tmp["source"][] = [
@ -767,8 +774,8 @@ class yandex{
"https://", "https://",
htmlspecialchars_decode($image["viewerData"]["thumb"]["url"]) htmlspecialchars_decode($image["viewerData"]["thumb"]["url"])
), ),
"width" => (int)$image["viewerData"]["thumb"]["size"]["width"], "width" => (int)$image["viewerData"]["thumb"]["w"],
"height" => (int)$image["viewerData"]["thumb"]["size"]["height"] "height" => (int)$image["viewerData"]["thumb"]["h"]
]; ];
$out["image"][] = $tmp; $out["image"][] = $tmp;