throwie's docker debug instructions + more shit (01cea014d7)
(7d391fe3ef) (9f7f294f39) (eaf66511f5) (bd04cf25d7) (c3b450eed9)
detect yt captcha, added a shit ton of archive shortcuts to hidden menu (311c99f298) (c0823c84f3) (e2e76fd007) (13c335dbdb) (b37802e8f1) (b328530951) (bdc3cffc7b) (a210f77c99) (31a9ef4e13)
This commit is contained in:
FbIN Support 2026-09-08 17:29:31 +05:30
commit 3e56bbc23b

View file

@ -6,6 +6,9 @@ class yt{
include "lib/backend.php";
$this->backend = new backend("yt");
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
}
public function getfilters($page){
@ -496,6 +499,8 @@ class yt{
throw new Exception("Could not fetch search page");
}
$this->detect_sorry($json);
//$json = file_get_contents("scraper/yt.html");
// get next page data, unique to first page
@ -1402,4 +1407,33 @@ class yt{
return $text;
}
private function detect_sorry($html){
$this->fuckhtml->load($html);
$as =
$this->fuckhtml
->getElementsByTagName(
"a"
);
foreach($as as $a){
// https://www.google.com/sorry/index?continue=https://www.youtube.com/results%3Fsearch_query%3Dhigurashi&q=EhAmBm0ADxn8AAAAAAAAAAEBGOuP_tQGIjDfNp10wvoKdz1WVrgH0F9RjWm2DrJNrPEJl642dSbds6QXWka0rtTlh2s8o0_c5nwyBz5qY25kclJaAUM
if(
stripos(
$this->fuckhtml
->getTextContent(
$a["attributes"]["href"]
),
"https://www.google.com/sorry/index?continue="
) !== false
){
throw new Exception("YouTube returned a captcha");
}
}
}
}