Skip to content

Conversation

@Bullfrog098
Copy link

I'm pretty sure you only need to put it here but i'm not 100% sure, everything works for me after putting this here.

@KL13NT
Copy link

KL13NT commented Sep 21, 2021

I can't verify whether this works or not right now, but I've been getting 410 on literally every video since I woke up today. My code is deployed in a EU region on Heroku.

@KMoszczyc
Copy link

Damn I'm so waiting for this bug to be fixed :((

@KAAquilla
Copy link

KAAquilla commented Sep 26, 2021

tried it just now. doesnt work unfortunately. idk why. it should though. if you add "&bpctr=9999999999&has_verified=1" to the URL inside your browser it works. but when trying to request it through ytdl it doesnt work somehow

before
image

with PR improvement i guess
image

Edit: yes i tried it with the pull-request as node-package

@Bullfrog098 Bullfrog098 reopened this Sep 26, 2021
@Bullfrog098
Copy link
Author

oops miss click

@Bullfrog098
Copy link
Author

Bullfrog098 commented Sep 26, 2021

tried it just now. doesnt work unfortunately. idk why. it should though. if you add "&bpctr=9999999999&has_verified=1" to the URL inside your browser it works. but when trying to request it through ytdl it doesnt work somehow

I tested this video out and it also needs a cookie to be able to download since it is an age-restricted video @KAAquilla
Videos that are just flagged like https://www.youtube.com/watch?v=hc0ZDaAZQT0 are working with my fix

@KAAquilla
Copy link

tried it just now. doesnt work unfortunately. idk why. it should though. if you add "&bpctr=9999999999&has_verified=1" to the URL inside your browser it works. but when trying to request it through ytdl it doesnt work somehow

I tested this video out and it also needs a cookie to be able to download since it is an age-restricted video @KAAquilla
Videos that are just flagged like https://www.youtube.com/watch?v=hc0ZDaAZQT0 are working with my fix

Yea i specifically wanted to test a video that is flagged and restricted. I am passing cookies btw. Just restricted videos work.

@Bullfrog098
Copy link
Author

Yea i specifically wanted to test a video that is flagged and restricted. I am passing cookies btw. Just restricted videos work.

huh really now, I'm getting all my restricted and flagged videos to download. You have any different code or videos that I can test?

@KMoszczyc
Copy link

Hmm interesting, ytdl-core just started working on restricted videos even without this fix, I just had to add proper cookies to the request.
example:
const ytdl=require('ytdl-core')
const info = await ytdl.getInfo('https://www.youtube.com/watch?v=ljztzALEqCg',
{
requestOptions: {
headers: {
Cookie: 'cookie',
"x-youtube-identity-token": 'yt token'
}
}
});

To get the cookie I used this chrome addon: https://chrome.google.com/webstore/detail/get-cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid?hl=en. After export add '=' in proper places and ';' after every line. So you get something like: 'CONSENT=YES..; VISITORINFO1_LIVE=0_Sha..; PREF=tz=Europe...; ...' etc.

@KAAquilla
Copy link

KAAquilla commented Sep 27, 2021

Yea i specifically wanted to test a video that is flagged and restricted. I am passing cookies btw. Just restricted videos work.

huh really now, I'm getting all my restricted and flagged videos to download. You have any different code or videos that I can test?

This is the code i am using now. I am passing cookies and the id_token which are defined in a const at the start of the code. sent in every request (getInfo and ytdl). as i said, it works when the video is only age-restricted. idk just strange. also playlists just stopped working for me since 2 days. using another package though

EDIT: tested it just now again. now age-restricted videos dont work anymore as well. wtf. i will try getting a fresh cookie
EDIT2: even fresh cookies didnt work now. wtf is this random bullshit

image

@Bullfrog098
Copy link
Author

Bullfrog098 commented Sep 27, 2021

Hmm interesting, ytdl-core just started working on restricted videos even without this fix, I just had to add proper cookies to the request.

This fix isn't for age-restricted video, it's for videos that are flagged "The following content has been identified by the YouTube community as inappropriate or offensive to some audiences."

@KAAquilla
Copy link

Hmm interesting, ytdl-core just started working on restricted videos even without this fix, I just had to add proper cookies to the request.
example:
const ytdl=require('ytdl-core')
const info = await ytdl.getInfo('https://www.youtube.com/watch?v=ljztzALEqCg',
{
requestOptions: {
headers: {
Cookie: 'cookie',
"x-youtube-identity-token": 'yt token'
}
}
});

To get the cookie I used this chrome addon: https://chrome.google.com/webstore/detail/get-cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid?hl=en. After export add '=' in proper places and ';' after every line. So you get something like: 'CONSENT=YES..; VISITORINFO1_LIVE=0_Sha..; PREF=tz=Europe...; ...' etc.

no need for a stupid addon that requires you to re-format everything. Just do CTRL+SHIFT+I inside Chrome/Firefox go to console and enter "document.cookie" -> voila cookies get!

@Bullfrog098
Copy link
Author

Bullfrog098 commented Sep 30, 2021

EDIT: tested it just now again. now age-restricted videos dont work anymore as well. wtf. i will try getting a fresh cookie
EDIT2: even fresh cookies didnt work now. wtf is this random bullshit

any update on this @KAAquilla?

@Xaypanya
Copy link

The same issue, any solution?

@KAAquilla
Copy link

EDIT: tested it just now again. now age-restricted videos dont work anymore as well. wtf. i will try getting a fresh cookie
EDIT2: even fresh cookies didnt work now. wtf is this random bullshit

any update on this @KAAquilla?

Nope still not working. I feel like its not passing my cookies correctly.

@Bullfrog098
Copy link
Author

Nope still not working. I feel like its not passing my cookies correctly.

try only using the cookie "__Secure-3PSID"

@KAAquilla
Copy link

KAAquilla commented Oct 2, 2021

Nope still not working. I feel like its not passing my cookies correctly.

try only using the cookie "__Secure-3PSID"

still not working. just tried... :/

This is correct how i pass the cookies right? COOKIE and ID_TOKEN are defined above
image

@KMoszczyc
Copy link

Nope still not working. I feel like its not passing my cookies correctly.

try only using the cookie "__Secure-3PSID"

still not working. just tried... :/

This is correct how i pass the cookies right? COOKIE and ID_TOKEN are defined above image

Yup looks good. And thanks for the document.cookie trick.

@Bullfrog098
Copy link
Author

Bullfrog098 commented Oct 2, 2021

This is correct how i pass the cookies right? COOKIE and ID_TOKEN are defined above

try without "x-youtube-identity-token"

@KAAquilla
Copy link

KAAquilla commented Oct 3, 2021

This is correct how i pass the cookies right? COOKIE and ID_TOKEN are defined above

try without "x-youtube-identity-token"

i already did once but tried again now with only 3PSID. same result though. cant find the ID Token
image

I also just tried with my second youtube account. so fresh cookie and id_token. also same result

@stale
Copy link

stale bot commented Dec 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issues that were closed for inactivity label Dec 9, 2021
@TimeForANinja
Copy link
Collaborator

should be fixed with #1022
thanks though for the pr
feel free to reopen if not fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Issues that were closed for inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants