Open tmeitner opened 4 years ago
first try running sudo apt update and sudo apt upgrade to update and upgrade your packages. then try downloading your youtube videos. does it happen on more than one video ?? this link in your log works ok for me - https://www.youtube.com/watch?v=SBbYlhvV6GY
first try running sudo apt update and sudo apt upgrade to update and upgrade your packages. then try downloading your youtube videos. does it happen on more than one video ?? this link in your log works ok for me - https://www.youtube.com/watch?v=SBbYlhvV6GY
Thanks for the reply. All packages are updated and upgraded, problem persists.
It happens on all videos from YouTube, not just that one. They all produce the same error. I run a few different scripts with batch commands on them. Here is one, and the YouTube download attempts all throw the same error and don't download:
#!/bin/bash cd '/mnt/Storage 4/Podcasts'; python3.8 /usr/local/bin/youtube-dl --cookies '/mnt/Storage 4/YouTube/cookies.txt' --ignore-config -x --audio-format mp3 --ignore-errors --dateafter now-2weeks --playlist-end 10 --download-archive "/mnt/Storage 4/Podcasts/downloaded.txt" -i -o "%(uploader)s/%(playlist)s/%(title)s.%(ext)s" --add-metadata --batch-file "/mnt/Storage 4/Podcasts/podcasts.txt"
This didn't happen on my previous server, which ran Ubuntu 16.04, I believe (maybe 18.04). Nothing different in the configurations, exact same YTDL commands, but this error keeps coming.
try running youtube-dl --force-generic-extractor https://www.youtube.com/watch?v=SBbYlhvV6GY and see if the video will download.
So, it's... working now, I guess?
The --force-generic-extractor command just kicked out an "invalid URL" error on every YouTube link I tried. When I pulled that out and just ran the default youtube-dl command, it worked fine. And then I re-ran my scripts manually, and it appears as though at some point this afternoon, it started working.
The embedding of the thumbnails isn't quite working that reliably, but it looks like my videos are getting downloaded now, even though I've done nothing different. I guess I'll close this one out. Thanks for helping! Weird.
Well, back to this error again. Noticed my cron jobs weren't running and here we are. I tried the force-generic-extractor command and every video download just kicks an "Unsupported URL" error.
Here's the full command I'm running. I've been running this for months with zero issues until this new installation. The only thing in the batch file is a list of YouTube URLs.:
/usr/local/bin/youtube-dl --cookies '/mnt/Storage 4/YouTube/cookies.txt' --ignore-config -f best --playlist-reverse --ignore-errors --download-archive "/mnt/Storage 4/YouTube/downloaded.txt" -i -o "%(uploader)s/%(playlist)s/%(uploader)s - S01E%(playlist_index)s - %(title)s.%(ext)s" --add-metadata --write-thumbnail --batch-file="/mnt/Storage 4/YouTube/channel_list.txt"
"fresh install/cookies file" is not enough, try to delete player cache:
--cache-dir DIR - Location in the filesystem where youtube-dl can store some downloaded information permanently. By default $XDG_CACHE_HOME/youtube-dl or ~/.cache/youtube-dl . At the moment, only YouTube player files (for videos with obfuscated signatures) are cached, but that may change.
--no-cache-dir Disable filesystem caching
--rm-cache-dir Delete all filesystem cache files
Further, I just encountered a problem on a single video out of many with just my cookie files, apparently I got targeted with some A/B experiments - this may be true for your account as well. Quite many variables.
TL;DR: Fixed it by removing version in ~/.local/
. Pip without sudo installs in a different place.
I thought I had the same issue for a while now. I always updated and checked again until I finally started investigating (to check if I was subject to AB testing or something like that). I used a server to check if it works there, which it did. Then I rechecked using a SOCKS proxy. That did not work. I then debugged a bit more and wanted print the players in both locations, which was when I realized that the line numbers/versions did not match.
I finally used youtube-dl --version
, which told me that I had an old version still. This version was installed in ~/.local/bin/youtube-dl
, which happens when you use python3 -m pip install youtube-dl --upgrade
. If you use the same thing with sudo it will tell you you have the latest version, even though you're using another one.
Thanks for a great project!
Checklist
Verbose log
Description
Had to rebuild my home server and set up my YT-DL cron jobs again, noticed they weren't running. Tried running my scripts, was getting "Unable to extract video data" on them. Using latest version. I used the Firefox plugin to grab a fresh cookies file, in case that was the problem. Still the same error.
I'm now running Ubuntu 20.04. I did install ffmpeg per the Reddit auto-bot's suggestion. Same behavior. I attempted to run it with python3.8 and I still get the "unable to extract video data" error.