question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

YouTube doesn't have Access-Control-Allow-Origin header

See original GitHub issue

So I tried to do this and failed pretty early: Issue #25

192.168.0.105/:1 Fetch API cannot load https://www.youtube.com/watch?v=A02s8omM_hI. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://192.168.0.105:9966' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

undefined:1 Uncaught (in promise) TypeError: Failed to fetch(…)

192.168.0.105/:1 Fetch API cannot load https://www.youtube.com/get_video_info?video_id=A02s8omM_hI&eurl=https%3A%2F%2Fyoutube.googleapis.com%2Fv%2FA02s8omM_hI&ps=default&gl=US&hl=en. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://192.168.0.105:9966' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

The author of this stackoverflow question had a very similar problem: http://stackoverflow.com/a/9327508

Do you have any idea how/whether we can work around this?

Regards, Spreadyy

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
fentcommented, Jun 3, 2016

Yes, like that. Looks like even the actual video is restricted by CORS too.

0reactions
fentcommented, Jun 8, 2016

Some formats have both video and audio, some have only video or audio.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access-Control-Allow-Origin error solved |2021 - YouTube
Your browser can 't play this video. Learn more. Switch camera ... Access - Control - Allow - Origin error solved | CORS...
Read more >
youtube embeded video error NO ACCESS-CONTROL ...
I just embedded video from youtube using iframe tag and I added at the top of the index file header('Access-Control-Allow-Origin: *'); but still ......
Read more >
YouTube embedded player causes CORS errors - Issue Tracker
(Reason: CORS header 'Access-Control-Allow-Origin' does not match ... been blocked by CORS policy: Response to preflight request doesn't pass access control ...
Read more >
Why CORS error with axios request to youtube/v3/video
Hello, In my @vue/cli 4.0.5 / axios": "^0.19 I got “No 'Access-Control-Allow-Origin' header is present on the requested resource.” when I run get...
Read more >
Solved: CORS policy error - YouTube Video - Adobe ...
Access to XMLHttpRequest at 'https://play.google.com/log?format=json&hasfast=true&authuser=0' from origin 'https://www.youtube-nocookie.com' has been blocked by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found