brave pagination fix
This commit is contained in:
		
							parent
							
								
									f9f3c919d6
								
							
						
					
					
						commit
						47a7a2a224
					
				| @ -403,7 +403,7 @@ class brave{ | |||||||
| 			 | 			 | ||||||
| 			$nextpage = | 			$nextpage = | ||||||
| 				$this->fuckhtml | 				$this->fuckhtml | ||||||
| 				->getElementsByClassName("btn", "a"); | 				->getElementsByClassName("button", "a"); | ||||||
| 			 | 			 | ||||||
| 			if(count($nextpage) !== 0){ | 			if(count($nextpage) !== 0){ | ||||||
| 				 | 				 | ||||||
| @ -1777,42 +1777,57 @@ class brave{ | |||||||
| 		 | 		 | ||||||
| 		$nextpage = | 		$nextpage = | ||||||
| 			$this->fuckhtml | 			$this->fuckhtml | ||||||
| 			->getElementsByClassName("btn", "a"); | 			->getElementById( | ||||||
|  | 				"pagination", | ||||||
|  | 				"div" | ||||||
|  | 			); | ||||||
| 		 | 		 | ||||||
| 		if(count($nextpage) !== 0){ | 		if($nextpage){ | ||||||
|  | 			 | ||||||
|  | 			$this->fuckhtml->load($nextpage); | ||||||
| 			 | 			 | ||||||
| 			$nextpage = | 			$nextpage = | ||||||
| 				$nextpage[count($nextpage) - 1]; | 				$this->fuckhtml | ||||||
| 			 | 				->getElementsByClassName( | ||||||
| 			if( | 					"button", | ||||||
| 				strtolower( | 					"a" | ||||||
| 					$this->fuckhtml |  | ||||||
| 					->getTextContent( |  | ||||||
| 						$nextpage |  | ||||||
| 					) |  | ||||||
| 				) == "next" |  | ||||||
| 			){ |  | ||||||
| 				 |  | ||||||
| 				preg_match( |  | ||||||
| 					'/offset=([0-9]+)/', |  | ||||||
| 					$this->fuckhtml->getTextContent($nextpage["attributes"]["href"]), |  | ||||||
| 					$nextpage |  | ||||||
| 				); | 				); | ||||||
|  | 			 | ||||||
|  | 			if(count($nextpage) !== 0){ | ||||||
| 				 | 				 | ||||||
| 				return | 				$nextpage = | ||||||
| 					$this->backend->store( | 					$nextpage[count($nextpage) - 1]; | ||||||
| 						json_encode( | 				 | ||||||
| 							[ | 				if( | ||||||
| 								"q" => $q, | 					strtolower( | ||||||
| 								"offset" => (int)$nextpage[1], | 						$this->fuckhtml | ||||||
| 								"nsfw" => $nsfw, | 						->getTextContent( | ||||||
| 								"country" => $country, | 							$nextpage | ||||||
| 								"spellcheck" => $spellcheck | 						) | ||||||
| 							] | 					) == "next" | ||||||
| 						), | 				){ | ||||||
| 						$page, | 					 | ||||||
| 						$proxy | 					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 | ||||||
|  | 						); | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		 | 		 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 lolcat
						lolcat