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

Attempting to download either the "liked videos" or "liked music" playlists on Youtube using cookies from both youtube.com and accounts.google.com results in a 404 #25175

Open
sandrin opened this issue May 7, 2020 · 3 comments · May be fixed by #26618

Comments

@sandrin
Copy link

@sandrin sandrin commented May 7, 2020

Checklist

  • [] I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.05.03
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

PS O:\> youtube-dl https://www.youtube.com/playlist?list=LL --cookies c.txt --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/playlist?list=LL', '--cookies', 'c.txt', '--verbose']
[debug] Encodings: locale cp932, fs mbcs, out cp932, pref cp932
[debug] youtube-dl version 2020.05.03
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.17763
[debug] exe versions: none
[debug] Proxy map: {}
[youtube:user] playlist: Downloading channel page
WARNING: Unable to download webpage: HTTP Error 404: Not Found
[youtube:user] playlist: Downloading page #1
ERROR: Unable to download webpage: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpybwhja3m\build\youtube_dl\extractor\common.py", line 627, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpybwhja3m\build\youtube_dl\YoutubeDL.py", line 2238, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
  File "C:\Python\Python34\lib\urllib\request.py", line 502, in error
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Python\Python34\lib\urllib\request.py", line 685, in http_error_302
  File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
  File "C:\Python\Python34\lib\urllib\request.py", line 508, in error
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default

PS O:\> youtube-dl https://www.youtube.com/playlist?list=LM --cookies c.txt --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/playlist?list=LM', '--cookies', 'c.txt', '--verbose']
[debug] Encodings: locale cp932, fs mbcs, out cp932, pref cp932
[debug] youtube-dl version 2020.05.03
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.17763
[debug] exe versions: none
[debug] Proxy map: {}
[youtube:user] playlist: Downloading channel page
WARNING: Unable to download webpage: HTTP Error 404: Not Found
[youtube:user] playlist: Downloading page #1
ERROR: Unable to download webpage: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpybwhja3m\build\youtube_dl\extractor\common.py", line 627, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpybwhja3m\build\youtube_dl\YoutubeDL.py", line 2238, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
  File "C:\Python\Python34\lib\urllib\request.py", line 502, in error
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Python\Python34\lib\urllib\request.py", line 685, in http_error_302
  File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
  File "C:\Python\Python34\lib\urllib\request.py", line 508, in error
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default

Description

I've been trying to download my liked videos playlist (LL) from youtube using the cookies that I use to download pretty much everything else, including my watch later list (WL), but I keep getting a 404 error on both LL and my liked music playlist (ML). These cookies work for my other private playlists and have never caused errors downloading other playlists either. I've tried logging in using my youtube account ID and an app password, but I keep getting a 400 error from that. I've tried this on multiple machines and the results were the same across them all.

@tathastu871
Copy link

@tathastu871 tathastu871 commented May 8, 2020

Youtube has now removed access to liked videos and watch later playlist. Your download failed just because the url for liked videos and watch later playlist even when logged in are not actual physical addresses that can be accessed on internet.
Thats is reason uou got "ERROR 404 URL NOT FOUND". Previously youtube was having a setting that would allow us to get url of those two playlist, but now its not as it was earlier.
You have two options to get urls of videos from liked and watch later playlist.
1). Using youtube api to query those playlist and to get json file but that would require programming knowledge.
2). Click on profile icon in youtube app and click on your data in youtube. Follow steps and you will get takeout.zip from youtube to download. You will get mail to the link to download takeout so keep watching for email after applying for data takeout.
You can also get it from google takeout settings. Once downloaded unzip it and you will find two json files
a). likes.json
b). watch-later.json
From them using some regex extract urls of video and then supply them from a file to youtube-dl

Complete solution
In takeout folder goto 'Youtube and Youtube music' folder and then to playlist.
Then using linux os cli use following command

cat likes.json | grep videoId | sort | uniq | sed 's/.*videoId" : "//g' | sed 's/..$//g' | sed 's_^https://youtu.be/' >> likedvideoplaylist.txt

youtube-dl -f best -a likedvideoplaylist.txt

Same with watch-later.json playlist.
cat watch-later.json | grep videoId | sort | uniq | sed 's/.*videoId" : "//g' | sed 's/..$//g' | sed 's_^https://youtu.be/' >> watchlatervideoplaylist.txt

youtube-dl -f best -a watchlatervideoplaylist.txt

In that there are also files for other playlist you have made in your account.

@sandrin
Copy link
Author

@sandrin sandrin commented May 8, 2020

I'll definitely give this a try, thanks. Although, I did mention that I wasn't having any trouble with my watch later playlist, youtube-dl is able to access it perfectly fine, it's just the liked videos and liked music playlists that I'm having trouble with. Plus I've seen others say that they were able to download their liked videos by switching from using login credentials to cookies, though I'm not sure whether that was before Youtube changed whatever it was that they did or not.

@altimumdelta
Copy link

@altimumdelta altimumdelta commented Jul 17, 2020

If it's your own videos that you're downloading then don't bother with youtube-dl at all, Google Takeout is the best way because you get the full metadata and the original source quality videos that you uploaded, not the re-encoded stream derivatives that are available publicly.

@morrah morrah linked a pull request that will close this issue Sep 18, 2020
4 of 9 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.