-
Notifications
You must be signed in to change notification settings - Fork 822
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
How do add cookies? #661
Comments
ytdl(url, {
requestOptions: {
headers: {
Cookie: 'a=1;b=2'
}
}
}); |
request options is not available for ytdl.getInfo(). I just want the info but without cookies it just keeps getting 429s.
So, according to your answer my cookie would be like this?
|
it is available, it takes similar options as calling
I've edited your post. be careful about posting sensitive information, even cookies. someone could login to your account with that.
use |
Okay! Thanks for the info but it still isn't working.
I tried with this code:
|
try adding a space after each
|
Still nothing. I logged the body in info.js at 43rd line. The body has this output:
|
hmm, I'll have to investigate this. this was also noticed in this issue #632 (comment) |
I tried using cookies myself, everything worked, didn't get |
Alright. I think I can tell you how to replicate this. I generated my cookie file using the cookie.txt extension in chrome. Then I generated this string:
Used these keys in my code as:
When I run this code, its throws this error:
To verify the cookie file. I've used the ytdl command line utility and it works fine. Can you verify if the cookies you used were obtained using the same process and/or are an youtube account's cookies? Thanks! Edit 1: I tried another method to extract cookies here and add it to header.
Edit 2: |
ok, I was able to replicate it by using the cookies.txt extension to extract cookies, and I did get a if I try the 2nd method you posted, I don't get an error and all the requests go through fine. but, I'm also not sure if I'm really logged in. |
Okay! I can understand if the first method doesn't work. But I'm getting error with the second method as well. Just to confirm if this is the procedure you followed.
|
I found a way, it needs the |
Even with the I wrote a small and dirty nightmare.js script which extract the values from YouTube:
I'm sending now these headers to the info request
And get the error "Error parsing info: parsedBody.reduce is not a function" Am i doing smth. wrong? @fent |
are you defining those yourself in the options to |
I define them myself in the headers, if i let it do itself it says that it can't find the identity token. |
does the cookie work for you in your browser? are you using a proxy or a custom user-agent? |
Yes it works in my browser, while login i'm usung the UA 'Chrome' otherway the login is not working. I'm using the script above to generate/read the header values. Then i set them in getInfo requestOptions... Edit: Yes sure i'm using more than 1000 different proxies - for login i'am using no proxy. Then i send the cookie with the getInfo request and a proxy. |
How do I add cookies, extracted from chrome (cookies.txt). Also how do I verify that the cookies are working?
The text was updated successfully, but these errors were encountered: