From 145c1e13888acf6b2b23739ad8973d64ea5ae632 Mon Sep 17 00:00:00 2001 From: vdbhb59 Date: Fri, 8 Aug 2025 10:17:18 +0530 Subject: [PATCH] Synced bypass mojeek bot check (https://git.lolcat.ca/lolcat/4get/commit/7ac53c6e117f5be9461302dcd94dc6acc35d7624) fix broken mojeek instant answer image (https://git.lolcat.ca/lolcat/4get/commit/ad535a16092b765c996858c3fbcdf726df5a0502) --- scraper/mojeek.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scraper/mojeek.php b/scraper/mojeek.php index 1a7fa65..bc28e3d 100644 --- a/scraper/mojeek.php +++ b/scraper/mojeek.php @@ -457,7 +457,7 @@ class mojeek{ "tn" => 7, // number of news results/page "date" => 1, // show date "tlen" => 128, // max length of title - "dlen" => 511, // max length of description + //"dlen" => 511, // max length of description "arc" => ($country == "any" ? "none" : $country) // location. don't use autodetect! ]; @@ -692,17 +692,18 @@ class mojeek{ preg_match( '/\/image\?img=([^&]+)/i', $thumb[0]["attributes"]["src"], - $thumb + $matches ); - if(count($thumb) === 2){ + if(count($matches) === 2){ + // for some reason, if we dont get the image from mojeek + // it sometimes fail to fetch the right image URL $answer["thumb"] = - urldecode( - $this->fuckhtml - ->getTextContent( - $thumb[1] - ) + "https://mojeek.com" . + $this->fuckhtml + ->getTextContent( + $thumb[0]["attributes"]["src"] ); } }