diff options
| author | lolcat <will@lolcat.ca> | 2025-08-04 00:18:38 -0400 |
|---|---|---|
| committer | lolcat <will@lolcat.ca> | 2025-08-04 00:18:38 -0400 |
| commit | 74f7c920f6aa5b5d44959ffa6ba07a49c241e2b5 (patch) | |
| tree | 1a285de3211668dd5f89e910981b56db7d9c62b7 | |
| parent | 3dbcf60a3ed4baf74fc80fa8c30427cbfcedd753 (diff) | |
handle vimeo captchas
| -rw-r--r-- | scraper/vimeo.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scraper/vimeo.php b/scraper/vimeo.php index 028a222..f9fdb84 100644 --- a/scraper/vimeo.php +++ b/scraper/vimeo.php @@ -614,6 +614,25 @@ class vimeo{ false ); + $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"); + } + $html = explode( '<script id="viewer-bootstrap" type="application/json">', |
