YouTube doesn't have Access-Control-Allow-Origin header
See original GitHub issueSo 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:
- Created 7 years ago
- Reactions:1
- Comments:19 (8 by maintainers)
Top GitHub Comments
Yes, like that. Looks like even the actual video is restricted by CORS too.
Some formats have both video and audio, some have only video or audio.