brave pagination fix from upstream
All checks were successful
Build and publish the docker image / build (push) Successful in 21s
All checks were successful
Build and publish the docker image / build (push) Successful in 21s
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
parent
8e125c2eb5
commit
e9bbc0f307
@ -400,13 +400,13 @@ class brave{
|
||||
if($nextpage){
|
||||
|
||||
$this->fuckhtml->load($nextpage);
|
||||
|
||||
|
||||
$nextpage =
|
||||
$this->fuckhtml
|
||||
->getElementsByClassName("btn", "a");
|
||||
|
||||
->getElementsByClassName("button", "a");
|
||||
|
||||
if(count($nextpage) !== 0){
|
||||
|
||||
|
||||
$nextpage =
|
||||
$nextpage[count($nextpage) - 1];
|
||||
|
||||
@ -1774,48 +1774,63 @@ class brave{
|
||||
}
|
||||
|
||||
private function generatenextpagetoken($q, $nsfw, $country, $spellcheck, $page, $proxy){
|
||||
|
||||
|
||||
$nextpage =
|
||||
$this->fuckhtml
|
||||
->getElementsByClassName("btn", "a");
|
||||
|
||||
if(count($nextpage) !== 0){
|
||||
|
||||
->getElementById(
|
||||
"pagination",
|
||||
"div"
|
||||
);
|
||||
|
||||
if($nextpage){
|
||||
|
||||
$this->fuckhtml->load($nextpage);
|
||||
|
||||
$nextpage =
|
||||
$nextpage[count($nextpage) - 1];
|
||||
|
||||
if(
|
||||
strtolower(
|
||||
$this->fuckhtml
|
||||
->getTextContent(
|
||||
$nextpage
|
||||
)
|
||||
) == "next"
|
||||
){
|
||||
|
||||
preg_match(
|
||||
'/offset=([0-9]+)/',
|
||||
$this->fuckhtml->getTextContent($nextpage["attributes"]["href"]),
|
||||
$nextpage
|
||||
$this->fuckhtml
|
||||
->getElementsByClassName(
|
||||
"button",
|
||||
"a"
|
||||
);
|
||||
|
||||
return
|
||||
$this->backend->store(
|
||||
json_encode(
|
||||
[
|
||||
"q" => $q,
|
||||
"offset" => (int)$nextpage[1],
|
||||
"nsfw" => $nsfw,
|
||||
"country" => $country,
|
||||
"spellcheck" => $spellcheck
|
||||
]
|
||||
),
|
||||
$page,
|
||||
$proxy
|
||||
|
||||
if(count($nextpage) !== 0){
|
||||
|
||||
$nextpage =
|
||||
$nextpage[count($nextpage) - 1];
|
||||
|
||||
if(
|
||||
strtolower(
|
||||
$this->fuckhtml
|
||||
->getTextContent(
|
||||
$nextpage
|
||||
)
|
||||
) == "next"
|
||||
){
|
||||
|
||||
preg_match(
|
||||
'/offset=([0-9]+)/',
|
||||
$this->fuckhtml->getTextContent($nextpage["attributes"]["href"]),
|
||||
$nextpage
|
||||
);
|
||||
|
||||
return
|
||||
$this->backend->store(
|
||||
json_encode(
|
||||
[
|
||||
"q" => $q,
|
||||
"offset" => (int)$nextpage[1],
|
||||
"nsfw" => $nsfw,
|
||||
"country" => $country,
|
||||
"spellcheck" => $spellcheck
|
||||
]
|
||||
),
|
||||
$page,
|
||||
$proxy
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user