fixed bing images failing to load, added flickr(ff8b1addf7)

fixed bing images failing to load, added flickr (ff8b1addf7) // (077692db49 // (ff8b1addf7/scraper/qwant.php // (566680fe36) // (8d07e72dfe) // (4b85841a3e)
This commit is contained in:
vdbhb59 2025-04-18 16:33:34 +05:30
commit 5ff2b87c2e
6 changed files with 561 additions and 36 deletions

View file

@ -1943,10 +1943,33 @@ class ddg{
private function bingimg($url){
$parse = parse_url($url);
parse_str($parse["query"], $parts);
$image = parse_url($url);
return "https://" . $parse["host"] . "/th?id=" . urlencode($parts["id"]);
$id = null;
if(isset($image["query"])){
parse_str($image["query"], $str);
if(isset($str["id"])){
$id = $str["id"];
}
}
if($id === null){
$id = explode("/th/id/", $image["path"], 2);
if(count($id) !== 2){
// malformed
return $url;
}
$id = $id[1];
}
return "https://" . $image["host"] . "/th/id/" . $id;
}
private function bingratio($width, $height){