The Wayback Machine - https://web.archive.org/web/20201005082738/https://github.com/oscarotero/Embed/issues/377
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedding domain-level restricted videos from vimeo issue #377

Open
marumehrts opened this issue Aug 12, 2020 · 5 comments
Open

Embedding domain-level restricted videos from vimeo issue #377

marumehrts opened this issue Aug 12, 2020 · 5 comments

Comments

@marumehrts
Copy link

@marumehrts marumehrts commented Aug 12, 2020

Hi!
Turns out, when a video is set to allow embedding on certain domains, the API returns 404. Which got us blocked, but taht was solved.
Now we are trying to embed according this short documentation https://developer.vimeo.com/api/oembed/videos#embedding-videos-with-domain-privacy
We're setting the CURLOPT_HTTPREFERER with the domain from the whitelisted domains in Vimeo, also the headers with referer, but still returns 404. If we try the same in linux terminal, we get the correct response with video info. Any ideas on why this could be happening? is there somewhere on this library which resets the headers/referer?

@oscarotero
Copy link
Owner

@oscarotero oscarotero commented Aug 12, 2020

Can I see the code you're using?

@marumehrts
Copy link
Author

@marumehrts marumehrts commented Aug 12, 2020

It's pretty simple actually

$dispatcher = new \Embed\Http\CurlDispatcher([
      CURLOPT_REFERER => 'https://www.siteurl.com',
]);
$info = Embed::create($url, null, $dispatcher);
@oscarotero
Copy link
Owner

@oscarotero oscarotero commented Aug 13, 2020

It looks ok.
Check if this configuration value is already sent to curl resource (here: https://github.com/oscarotero/Embed/blob/v3.x/src/Http/CurlDispatcher.php#L139), or maybe disabling CURLOPT_AUTOREFERER.

@marumehrts
Copy link
Author

@marumehrts marumehrts commented Aug 14, 2020

Well I've checked and it does apparently send the referer in the header

"request_header" => """
GET /299008939 HTTP/1.1\r\n
User-Agent: Embed PHP library\r\n
Host: vimeo.com\r\n
Accept-Encoding: deflate, gzip\r\n
Referer: https://www.siteurl.com\r\n
Accept: */*\r\n
\r\n

Didn't work, neither disabling CURLOPT_AUTOREFERER, we opted to set video privacy to private link, and this way works.
Thanks anyways!

@oscarotero
Copy link
Owner

@oscarotero oscarotero commented Aug 14, 2020

Try changing the User-Agent for a real browser UA. Some sites blocks request from unknow user agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.