Glossary · protocol

What is CORS (Cross-Origin Resource Sharing)?

CORS (Cross-Origin Resource Sharing) is the browser security rule that prevents JavaScript on one domain from making requests to a different domain unless the target explicitly allows it. YouTube's i.ytimg.com thumbnail CDN allows CORS (so any site can show YouTube thumbnails); googlevideo.com largely doesn't (so random sites can't scrape video bytes).

Also called:cross-origin resource sharing · cors policy

CORS exists to prevent malicious sites from making authenticated requests to your bank, email, etc. on your behalf. The rule: a script running on evil.com can't fetch data from bank.com unless bank.com explicitly responds with an Access-Control-Allow-Origin header naming evil.com (or * for any origin).

For YouTube downloaders: video bytes come from googlevideo.com. Standard fetch from a JS environment on vidpickr.com would be blocked unless googlevideo.com sent the CORS header. It does for some specific use cases (the YouTube player itself) but not for everyone.

VidPickr's architecture works around this by having the user's browser fetch from our /stream endpoint on vidpickr.com, which proxies to googlevideo.com from the server side (where CORS doesn't apply). The user's browser only ever sees same-origin requests. From the browser's perspective, no CORS issue exists.

Common questions

Why can I display a YouTube thumbnail on my site but not embed the video?
Thumbnails have CORS headers that allow any origin. Video bytes don't. To embed a video you use the YouTube IFrame API (loads YouTube in an iframe — different CORS context). To use the actual bytes you need a server-side proxy.

Related terms

VidPickr is a free, browser-based YouTube downloader. Every term in this glossary either describes how YouTube delivers video or why your downloads behave the way they do. Try the downloader →