-
-
Notifications
You must be signed in to change notification settings - Fork 22
cookies
Some streams (especially Twitch and YouTube) require authentication via cookies to access private or region-locked content. Synthalingua supports Netscape/Mozilla-style cookies files for this purpose.
Security Note: Storing cookies on your PC can be risky if your system is not secure. Treat your cookies file like a password: keep it private, and delete it after you are done using Synthalingua to be extra safe. While cookies do expire automatically, it’s best to remove them yourself when finished, especially if you share your computer or are concerned about account security.
These are plain text files containing your browser's cookies in a standard format. They are often called "cookies.txt" and are compatible with many tools (like yt-dlp, youtube-dl, and Synthalingua).
- Install the Cookie-Editor Extension from the Chrome Web Store.
- Go to the website (e.g., twitch.tv or youtube.com) and log in.
- Click the Cookie-Editor extension icon.
- Click "Export".
- In the export dialog, select the "Netscape" format.
- Copy the exported text.
- Open Notepad (or any text editor), paste the contents, and save as
cookies.txt
. - Place the file in the
cookies/
folder in your Synthalingua directory (e.g.,cookies/twitch.txt
).
- Install the Cookie-Editor Extension for Firefox.
- Log in to the site you want cookies for.
- Click the Cookie-Editor extension icon.
- Click "Export".
- In the export dialog, select the "Netscape" format.
- Copy the exported text.
- Open Notepad (or any text editor), paste the contents, and save as
cookies.txt
. - Place the file in the
cookies/
folder.
- Opera is Chromium-based, so you can use the same Chrome extension as above.
Synthalingua supports multiple ways to specify cookies for authenticated streams:
Synthalingua can directly extract cookies from your browser using yt-dlp's built-in functionality:
# Extract cookies from Chrome
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies-from-browser chrome
# Extract cookies from Firefox
python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --cookies-from-browser firefox
# Extract cookies from other supported browsers
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies-from-browser edge
Supported browsers:
-
brave
- Brave Browser -
chrome
- Google Chrome -
chromium
- Chromium -
edge
- Microsoft Edge -
firefox
- Mozilla Firefox -
opera
- Opera -
safari
- Safari (macOS only) -
vivaldi
- Vivaldi -
whale
- Whale Browser
Important: The browser must be installed and you must have logged in to the target site (e.g., Twitch, YouTube) for cookie extraction to work.
- Place your cookies file in the
cookies/
folder (e.g.,cookies/twitch.txt
orcookies/youtube.txt
). - Use the
--cookies
argument without the.txt
extension:python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies twitch
- For YouTube:
python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --cookies youtube
- Specify the complete path to your cookie file:
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies "C:\path\to\twitch.txt"
- For YouTube:
python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --cookies "C:\Users\username\Downloads\youtube_cookies.txt"
- Place the cookie file in the same directory as your script and reference it by name:
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies twitch.txt
-
Cannot use both: You cannot use
--cookies
and--cookies-from-browser
together - Browser extraction is temporary: Cookies extracted from browsers are stored in temporary files and automatically cleaned up
-
File-based cookies are permanent: Cookie files you specify with
--cookies
are not modified or deleted
When you specify --cookies
, Synthalingua will search for the file in this order:
-
Absolute path: If you provide a full path (e.g.,
C:\path\to\cookies.txt
), it uses that directly - Current directory: Looks for the file in the current working directory
-
Cookies folder: Looks in
cookies/
folder, automatically adding.txt
if needed
- Always export cookies while logged in to the site you want to access.
- If you change your password or log out, you may need to re-export cookies.
- Never share your cookies file with others—it can be used to access your account!