diff options
Diffstat (limited to 'scraper/ddg.php')
| -rw-r--r-- | scraper/ddg.php | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/scraper/ddg.php b/scraper/ddg.php index 95039fa..2729028 100644 --- a/scraper/ddg.php +++ b/scraper/ddg.php @@ -1958,23 +1958,15 @@ class ddg{ 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; } - } - - if(is_array($id)){ - // fuck off, let proxy.php deal with it - return $url; + $id = $id[1]; } return "https://" . $image["host"] . "/th/id/" . $id; |
