소스 검색

aaaaaa part 2

lolcat 1 년 전
부모
커밋
d3ef1a67c0
1개의 변경된 파일19개의 추가작업 그리고 0개의 파일을 삭제
  1. 19 0
      scraper/vimeo.php

+ 19 - 0
scraper/vimeo.php

@@ -679,6 +679,25 @@ class vimeo{
 				
 				throw new Exception("Failed to fetch JWT token");
 			}
+			
+			$this->fuckhtml->load($html);
+			
+			$captcha =
+				$this->fuckhtml
+				->getElementsByTagName(
+					"title"
+				);
+			
+			if(
+				count($captcha) !== 0 &&
+				$this->fuckhtml
+				->getTextContent(
+					$captcha[0]
+				) == "Vimeo / CAPTCHA Challenge"
+			){
+				
+				throw new Exception("Vimeo returned a Captcha");
+			}
 				
 			$json = json_decode($json, true);