YouTube Cookies Setup
This document explains how to retrieve and use cookies from YouTube authentication for getting the subtitles from the available YouTube videos. Cookies are essential for accessing certain YouTube features and content that may be restricted or unavailable without proper authentication.
Why Cookies are Needed
YouTube uses cookies to authenticate users and manage sessions. By providing these cookies to our application, we can:
- Access age-restricted content
- Retrieve private videos (if the authenticated user has access)
- Access region-restricted content (based on the authenticated user's location)
- Potentially bypass some rate-limiting restrictions
Step-by-Step Guide to Retrieve Cookies
1. Install the EditThisCookie (opens in a new tab) Extension
- Open your preferred browser (Chrome, Firefox, or Edge).
- Go to the browser's extension store. For Google Chrome visit the extension here (opens in a new tab).
2. Create a New YouTube Account
It's recommended to create a new YouTube account specifically for this purpose to keep your personal account separate.
3. Log in to YouTube
4. Export Cookies
- Make sure you're on a YouTube page.
- Click on the EditThisCookie extension icon in your browser toolbar.
- In the extension popup, click on the export button (usually looks like an arrow pointing outward).
- The cookies will be copied to your clipboard in JSON format.
5. Update the Youtube Cookies File
- Open the
src/utils/youtube-cookies.ts
file in your project. - Replace the example cookie array with the actual cookies you exported:
Security Considerations
- Never share your cookies: They provide access to your YouTube account.
- Use a dedicated account: Don't use cookies from your personal YouTube account.
- Regularly rotate cookies: Update your cookies periodically to maintain security.
- Store securely: Never commit cookies to public repositories. Use environment variables or secure secret management systems in production.
Remember, using cookies responsibly and ethically is crucial. Always respect YouTube's terms of service and content creators' rights.