kkdai / youtube

Download Youtube Video in Golang
MIT License
3.26k stars 429 forks source link

Age restriction bypass fails #241

Open corny opened 2 years ago

corny commented 2 years ago

The age restriction bypass fails again. Youtube must have changed something. Reproducable with:

go test -timeout 30s -run ^TestDownload_SensitiveContent$
corny commented 2 years ago

You find it in the test TestDownload_SensitiveContent(). It's the video MS91knuzoOA.

Lumostr commented 9 months ago

This problem continues... while downloading an age-restricted video in Termox, I get this message: can't bypass age restriction: embedding of this video has been disabled ! Is it possible to solve this problem by adding a login page?

3052 commented 9 months ago

personally I got tired of the hacks. I try a normal ANDROID request, then ANDROID_EMBEDDED_PLAYER. if those both fail, then I just use OAuth:

POST /youtubei/v1/player HTTP/1.1
Host: www.youtube.com
Authorization: Bearer ya29.a0AfB_byBXjabItN3g_zxyh-9dGNx-tQefkn8hxpbLO_1aYbKlB...
User-Agent: com.google.android.youtube/18.43.39

{
   "contentCheckOk": true,
   "context": {
      "client": {
         "clientName": "ANDROID",
         "clientVersion": "18.43.39"
      }
   },
   "racyCheckOk": true,
   "videoId": "MS91knuzoOA"
}
namlh-braly commented 2 months ago

@3052 How do you get the OAuth token? Thank you.

3052 commented 2 months ago

https://github.com/3052/platform/tree/v1.4.7/youtube

gamersindo1223 commented 2 months ago

@3052 and how do u use it?

3052 commented 2 months ago

post issue on my repo or contact me privately