shadowmoose / RedditDownloader

Scrapes Reddit to download media of your choice.
1.11k stars 99 forks source link

Youtube-DL not downloading age-gated videos #222

Open shinji257 opened 3 years ago

shinji257 commented 3 years ago

Describe the bug

YTDL support that is built-in (on Windows at least) isn't able to download age-gated videos. I'm actually in the United States and according to the Youtube-DL github this was originally a UK issue. Apparently you need a cookie or something. Fork YT-DLP could download the same video fine and seems to do this by hopping into Android APIs.

Environment Info

Screenshots/Information

YTDL: ERROR: Sign in to confirm your age This video may be inappropriate for some users. [https://www.youtube.com/watch?v=Lgbt-j7Pq8U]

(Note that since the video is age-gated it is of course NSFW but not for nudity)

Additional context

Youtube-DL won't download it but YT-DLP (A fork of Youtube-DL) has no issue with it. Seems to go over to Android APIs to get the data it needs to download the video.

P:\>youtube-dl.old.exe https://www.youtube.com/watch?v=Lgbt-j7Pq8U
[youtube] Lgbt-j7Pq8U: Downloading webpage
[youtube] Lgbt-j7Pq8U: Refetching age-gated info webpage
WARNING: unable to download video info webpage: HTTP Error 410: Gone
ERROR: Sign in to confirm your age
This video may be inappropriate for some users.

P:\>youtube-dl.old.exe -U
youtube-dl is up-to-date (2021.06.06)

P:\>yt-dlp.exe https://www.youtube.com/watch?v=Lgbt-j7Pq8U
[youtube] Lgbt-j7Pq8U: Downloading webpage
[youtube] Lgbt-j7Pq8U: Downloading android player API JSON
[youtube] Lgbt-j7Pq8U: Downloading android agegate player API JSON
[youtube] Lgbt-j7Pq8U: Downloading web agegate player API JSON
[info] Lgbt-j7Pq8U: Downloading 1 format(s): 247+251
[download] Destination: Bupshi - black latex doll [Lgbt-j7Pq8U].f247.webm
[download] 100% of 25.87MiB in 00:03
[download] Destination: Bupshi - black latex doll [Lgbt-j7Pq8U].f251.webm
[download] 100% of 2.43MiB in 00:00
[Merger] Merging formats into "Bupshi - black latex doll [Lgbt-j7Pq8U].webm"
Deleting original file Bupshi - black latex doll [Lgbt-j7Pq8U].f251.webm (pass -k to keep)
Deleting original file Bupshi - black latex doll [Lgbt-j7Pq8U].f247.webm (pass -k to keep)
shadowmoose commented 3 years ago

Thanks for the report. I'll make sure the RMD rewrite supports the dlp project, since that version also seems to have a number of improvements for speed. I'll also try to implement the changes in the current Python branch.