algolia / youtube-captions-scraper

Fetch youtube user submitted or fallback to auto-generated captions
249 stars 67 forks source link

How to deal with Access-Control-Allow-Origin issue? #2

Closed r6047736 closed 6 years ago

r6047736 commented 6 years ago

Failed to load https://youtube.com/get_video_info?video_id=xxxxxxx: Redirect from 'https://youtube.com/get_video_info?video_id=xxxxxxx' to 'https://www.youtube.com/get_video_info?video_id=xxxxxxx' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.

iam4x commented 6 years ago

Hi @r6047736 this is not meant to be used in a browser, Youtube will never add CORS headers to allow you the usage.

Haroenv commented 6 years ago

Note that there are some services that act as a reverse proxy to prevent this kind of issue. Here's a small list (not endorsing any of them)

iam4x commented 6 years ago

With @Haroenv solution, that would imply to fork and update manually the URL of youtube.

Cheers.