diff options
| author | lolcat <will@lolcat.ca> | 2025-05-24 20:49:49 -0400 |
|---|---|---|
| committer | lolcat <will@lolcat.ca> | 2025-05-24 20:49:49 -0400 |
| commit | a0545b60063c72db4322da78cf8529640346dcf1 (patch) | |
| tree | 4c92f33f45217d1dc9b2f2523c8b7e1bf55c32a4 /scraper/startpage.php | |
| parent | 78aa2e198f11ca928891ec83ef97d2445147414a (diff) | |
fix startpage videos
Diffstat (limited to 'scraper/startpage.php')
| -rw-r--r-- | scraper/startpage.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scraper/startpage.php b/scraper/startpage.php index ebb1737..e48a429 100644 --- a/scraper/startpage.php +++ b/scraper/startpage.php @@ -1226,7 +1226,12 @@ class startpage{ // get results foreach($json["render"]["presenter"]["regions"]["mainline"] as $category){ - if($category["display_type"] == "video-youtube"){ + if( + preg_match( + '/^video-/i', + $category["display_type"] + ) + ){ foreach($category["results"] as $video){ @@ -1248,7 +1253,7 @@ class startpage{ } $out["video"][] = [ - "title" => $video["title"], + "title" => str_replace(["", ""], "", $video["title"]), "description" => $this->limitstrlen($video["description"]), "author" => [ "name" => $video["channelTitle"], @@ -1256,7 +1261,7 @@ class startpage{ "avatar" => null ], "date" => strtotime($video["publishDate"]), - "duration" => $this->hms2int($video["duration"]), + "duration" => $this->hms2int($category["display_type"] == "video-youtube" ? $video["duration"] : $video["duration"] / 1000), "views" => (int)$video["viewCount"], "thumb" => $thumb, "url" => $video["clickUrl"] |
