Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TikTok cookie #428

Open
SilverBull opened this issue Sep 17, 2024 · 7 comments
Open

TikTok cookie #428

SilverBull opened this issue Sep 17, 2024 · 7 comments

Comments

@SilverBull
Copy link

I just tried a TikTok link and the bot responded with

Download failed!❌
[TikTok] 7414439153384820001: TikTok is requiring login for access to this content. Use --cookies-from-browser or --cookies for the > authentication. See https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp for how to manually pass cookies

How can I pass the cookie to the bot? Is there already a configuration or is this a new feature?
I read in others issues that for Instagram it could lead to ban, It's the same for TikTok?

@SanujaNS
Copy link
Collaborator

Is there already a configuration or is this a new feature?

Currently bot doesn't have a specific way to pass a cookie for TikTok.

it could lead to ban, It's the same for TikTok?

Yes, it's possible. Passing your TikTok account cookie to download content can lead to your account being banned. Downloading content like this is considered a violation of their ToS, so using your cookie can result in a temporary or permanent ban on your account.

@kang000feng
Copy link

Passing your TikTok account cookie to download content can lead to your account being banned.

dear SanujaNS, may i ask How can I pass the youtube cookie to the bot? and will Downloading youtube content like this be considered a violation of their ToS?

@SanujaNS
Copy link
Collaborator

dear SanujaNS, may i ask How can I pass the youtube cookie to the bot? and will Downloading youtube content like this be considered a violation of their ToS?

Hey @kang000feng ,

Yes, downloading media from YouTube using cookies is generally considered a violation of their Terms of Service. YouTube's terms explicitly state that "Streaming" means a real-time transmission of content, not downloading or storing it.

In case you absolutely need to pass cookies to the bot (This may lead to your account being banned), there isn't a direct method available at the moment. However, you can manually add by creating a cookies.txt file and adding 'cookiefile': 'cookies.txt' to the ydl_opts = {} section within the downloader.py file.

@kang000feng
Copy link

dear SanujaNS, may i ask How can I pass the youtube cookie to the bot? and will Downloading youtube content like this be considered a violation of their ToS?

Hey @kang000feng ,

Yes, downloading media from YouTube using cookies is generally considered a violation of their Terms of Service. YouTube's terms explicitly state that "Streaming" means a real-time transmission of content, not downloading or storing it.

In case you absolutely need to pass cookies to the bot (This may lead to your account being banned), there isn't a direct method available at the moment. However, you can manually add by creating a cookies.txt file and adding 'cookiefile': 'cookies.txt' to the ydl_opts = {} section within the downloader.py file.

Thanks so much SanujaNS, how about Twitter video/audio? How can I pass the x.com cookie to the bot? and will Downloading x.com content like this be considered a violation of their ToS?

@SanujaNS
Copy link
Collaborator

dear SanujaNS, may i ask How can I pass the youtube cookie to the bot? and will Downloading youtube content like this be considered a violation of their ToS?

Hey @kang000feng ,
Yes, downloading media from YouTube using cookies is generally considered a violation of their Terms of Service. YouTube's terms explicitly state that "Streaming" means a real-time transmission of content, not downloading or storing it.
In case you absolutely need to pass cookies to the bot (This may lead to your account being banned), there isn't a direct method available at the moment. However, you can manually add by creating a cookies.txt file and adding 'cookiefile': 'cookies.txt' to the ydl_opts = {} section within the downloader.py file.

Thanks so much SanujaNS, how about Twitter video/audio? How can I pass the x.com cookie to the bot? and will Downloading x.com content like this be considered a violation of their ToS?

You're welcome!

Yes. In general most of the services doesn't legally provide holes to scrape their data. If you want specific details, consider using AI chatbots that work with real-time data like perplexity.ai

As for passing cookies, it is same as above. Once you pass cookiefile it will be used with every download.

@kang000feng
Copy link

dear SanujaNS, may i ask How can I pass the youtube cookie to the bot? and will Downloading youtube content like this be considered a violation of their ToS?

Hey @kang000feng ,

Yes, downloading media from YouTube using cookies is generally considered a violation of their Terms of Service. YouTube's terms explicitly state that "Streaming" means a real-time transmission of content, not downloading or storing it.

In case you absolutely need to pass cookies to the bot (This may lead to your account being banned), there isn't a direct method available at the moment. However, you can manually add by creating a cookies.txt file and adding 'cookiefile': 'cookies.txt' to the ydl_opts = {} section within the downloader.py file.

Thanks so much SanujaNS, how about Twitter video/audio? How can I pass the x.com cookie to the bot? and will Downloading x.com content like this be considered a violation of their ToS?

You're welcome!

Yes. In general most of the services doesn't legally provide holes to scrape their data. If you want specific details, consider using AI chatbots that work with real-time data like perplexity.ai

As for passing cookies, it is same as above. Once you pass cookiefile it will be used with every download.

Thanks so much for your help! Could you clarify the format of the cookies.txt file? Also, if the cookies.txt file contains cookies for both X.com and YouTube.com, how does downloader.py decide which cookies are valid for the correct website?

Happy new year in advance.

@SanujaNS
Copy link
Collaborator

yt-dlp supports the Netscape HTTP Cookie File format for cookies.

yt-dlp decides which cookies are valid for the correct website based on the domain name specified in the cookie file. When you provide a cookies.txt file containing cookies for both X.com and YouTube.com, yt-dlp will only consider cookies where the domain attribute matches the website you're trying to download from.

Thanks. Happy New Year to you too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants