diff options
| author | lolcat <will@lolcat.ca> | 2024-07-27 11:43:10 -0400 |
|---|---|---|
| committer | lolcat <will@lolcat.ca> | 2024-07-27 11:43:10 -0400 |
| commit | 143c0c136435f424d3871d8022784992368d1b75 (patch) | |
| tree | 978266cabd8d98edc595e6586a99d1c2ab11b7cd | |
| parent | 497dacd42efdb5e4b7330e277653c0eb53b02a6c (diff) | |
fix yandex image scraper
| -rw-r--r-- | scraper/yandex.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scraper/yandex.php b/scraper/yandex.php index 2e81cee..c3728e8 100644 --- a/scraper/yandex.php +++ b/scraper/yandex.php @@ -751,6 +751,13 @@ class yandex{ "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){ $tmp["source"][] = [ @@ -767,8 +774,8 @@ class yandex{ "https://", htmlspecialchars_decode($image["viewerData"]["thumb"]["url"]) ), - "width" => (int)$image["viewerData"]["thumb"]["size"]["width"], - "height" => (int)$image["viewerData"]["thumb"]["size"]["height"] + "width" => (int)$image["viewerData"]["thumb"]["w"], + "height" => (int)$image["viewerData"]["thumb"]["h"] ]; $out["image"][] = $tmp; |
