aboutsummaryrefslogtreecommitdiffstats
path: root/scraper/qwant.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2025-04-17 20:05:58 -0400
committerlolcat <will@lolcat.ca>2025-04-17 20:05:58 -0400
commit077692db4904df65302be05da64a0cbcddf18fbb (patch)
treed045db8decf156fab82763c8c06cc6cf92bed0c8 /scraper/qwant.php
parente4bf53cdaac607bd6d9bc4fe3adf84af0ec531c0 (diff)
i fucking hate bing
Diffstat (limited to 'scraper/qwant.php')
-rw-r--r--scraper/qwant.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/scraper/qwant.php b/scraper/qwant.php
index 93a6607..da2afca 100644
--- a/scraper/qwant.php
+++ b/scraper/qwant.php
@@ -971,17 +971,15 @@ class qwant{
if($id === null){
- // fallback to getting ID from path
- $id = explode("/", $image["path"]);
-
- for($i=count($id) - 1; $i>0; $i--){
+ $id = explode("/th/id/", $image["path"], 2);
+
+ if(count($id) !== 2){
- if(trim($id[$i]) != ""){
-
- $id = $id[$i];
- break;
- }
+ // malformed
+ return $url;
}
+
+ $id = $id[1];
}
if(is_array($id)){
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage