fix duckduckgo infinite pagination bug xd rawr

This commit is contained in:
2026-10-13 01:16:11 -04:00
parent a837c0c248
commit 90eccc386c
+7 -7
View File
@@ -29,14 +29,14 @@ class ddg{
curl_setopt($curlproc, CURLOPT_URL, $url); curl_setopt($curlproc, CURLOPT_URL, $url);
// http2 bypass // http2 bypass
curl_setopt($curlproc, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); curl_setopt($curlproc, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2);
switch($reqtype){ switch($reqtype){
case self::req_web: case self::req_web:
$headers = $headers =
["User-Agent: " . config::USER_AGENT, ["User-Agent: " . config::USER_AGENT,
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language: en-US,en;q=0.5", "Accept-Language: en-US,en;q=0.9",
"Accept-Encoding: gzip", "Accept-Encoding: gzip",
"DNT: 1", "DNT: 1",
"Sec-GPC: 1", "Sec-GPC: 1",
@@ -46,8 +46,7 @@ class ddg{
"Sec-Fetch-Mode: navigate", "Sec-Fetch-Mode: navigate",
"Sec-Fetch-Site: same-origin", "Sec-Fetch-Site: same-origin",
"Sec-Fetch-User: ?1", "Sec-Fetch-User: ?1",
"Priority: u=0, i", "Priority: u=0, i"];
"TE: trailers"];
break; break;
case self::req_xhr: case self::req_xhr:
@@ -484,7 +483,7 @@ class ddg{
$this->fuckhtml->load($html); $this->fuckhtml->load($html);
// //
// Get next page token // Detect captcha
// //
$forms = $forms =
$this->fuckhtml $this->fuckhtml
@@ -509,8 +508,9 @@ class ddg{
$input_probe = $input_probe =
$this->fuckhtml $this->fuckhtml
->getElementsByClassName( ->getElementsByAttributeValue(
"btn--alt", "value",
"Next",
"input" "input"
); );