From 706b490bf35db32aaf54c5dc202c0a1aa690e411 Mon Sep 17 00:00:00 2001 From: lolcat Date: Mon, 4 Aug 2025 00:34:06 -0400 Subject: [PATCH] bypass captcha??? hopefullly........ --- scraper/vimeo.php | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/scraper/vimeo.php b/scraper/vimeo.php index f9fdb84..89836a2 100644 --- a/scraper/vimeo.php +++ b/scraper/vimeo.php @@ -152,20 +152,20 @@ class vimeo{ $curlproc, CURLOPT_HTTPHEADER, ["User-Agent: " . config::USER_AGENT, - "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "Accept: */*", "Accept-Language: en-US,en;q=0.5", "Accept-Encoding: gzip, deflate, br, zstd", - "Referer: https://vimeo.com/watch", + "Referer: https://vimeo.com/search", + "X-Requested-With: XMLHttpRequest", "DNT: 1", "Sec-GPC: 1", "Connection: keep-alive", - "Cookie: _dd_s=isExpired=1", // &aid=959c58f0-e5fe-48f6-bd54-e247d92d317a - "Upgrade-Insecure-Requests: 1", - "Sec-Fetch-Dest: document", - "Sec-Fetch-Mode: navigate", + "Sec-Fetch-Dest: empty", + "Sec-Fetch-Mode: cors", "Sec-Fetch-Site: same-origin", - "Priority: u=0, i"] + "Priority: u=4"] ); + }else{ curl_setopt( @@ -605,7 +605,7 @@ class vimeo{ $jwt = apcu_fetch("vimeo_jwt"); if($jwt === false){ - + /* $html = $this->get( $proxy, @@ -665,6 +665,29 @@ class vimeo{ } $jwt = $jwt["jwt"]; + */ + + $json = + $this->get( + $proxy, + "https://vimeo.com/_next/jwt", + [], + false + ); + + $json = json_decode($json, true); + + if($json === null){ + + throw new Exception("The JWT object could not be decoded"); + } + + if(!isset($json["token"])){ + + throw new Exception("Vimeo did not return a JWT"); + } + + $jwt = $json["token"]; apcu_store("vimeo_jwt", $jwt, 300); }