diff options
Diffstat (limited to 'scraper')
-rw-r--r-- | scraper/brave.php | 2 | ||||
-rw-r--r-- | scraper/google.php | 32 | ||||
-rw-r--r-- | scraper/sc.php | 9 |
3 files changed, 22 insertions, 21 deletions
diff --git a/scraper/brave.php b/scraper/brave.php index bf11865..93256a8 100644 --- a/scraper/brave.php +++ b/scraper/brave.php @@ -574,8 +574,6 @@ class brave{ } } - echo "test"; - if($rating !== null){ $table["Rating"] = $rating; diff --git a/scraper/google.php b/scraper/google.php index d0e90ca..ca77231 100644 --- a/scraper/google.php +++ b/scraper/google.php @@ -1616,21 +1616,23 @@ class google{ $imgvl ); - $imgvl = $imgvl[1]; - - $params["async"] = "_id:islrg_c,_fmt:html"; - $params["asearch"] = "ichunklite"; - $params["ved"] = $ved; - $params["vet"] = "1" . $ved . "..i"; - $params["start"] = 100; - $params["ijn"] = 1; - $params["imgvl"] = $imgvl; - - $out["npt"] = - $this->nextpage->store( - json_encode($params), - "images" - ); + if(isset($imgvl[1])){ + $imgvl = $imgvl[1]; + + $params["async"] = "_id:islrg_c,_fmt:html"; + $params["asearch"] = "ichunklite"; + $params["ved"] = $ved; + $params["vet"] = "1" . $ved . "..i"; + $params["start"] = 100; + $params["ijn"] = 1; + $params["imgvl"] = $imgvl; + + $out["npt"] = + $this->nextpage->store( + json_encode($params), + "images" + ); + } } } diff --git a/scraper/sc.php b/scraper/sc.php index f297723..1774c20 100644 --- a/scraper/sc.php +++ b/scraper/sc.php @@ -288,7 +288,7 @@ class sc{ if(count($description) != 0){ - $description = $count . " songs. " . implode(", ", $description); + $description = trim($count . " songs. " . implode(", ", $description)); } if( @@ -320,7 +320,7 @@ class sc{ $out["playlist"][] = [ "title" => $item["title"], - "description" => $description, + "description" => $this->limitstrlen($description), "author" => [ "name" => $item["user"]["username"], "url" => $item["user"]["permalink_url"], @@ -385,13 +385,14 @@ class sc{ "\n", wordwrap( str_replace( - "\n", + ["\n\r", "\r\n", "\n", "\r"], " ", $text ), 300, "\n" - ) + ), + 2 )[0]; } } |