Youtube is one of the world’s biggest streaming platforms but lacks some features in its free variation. The ability to download videos is something that just about every Youtube viewer wants, and luckily, there are hundreds of free tools to do exactly that. However, some might not work as well as others.
Python developers using the yt_dlp library have recently been impacted by a bug where their previously functional codebases for downloading videos are failing because of the “unable to extract uploader id” error. In this article, we’re discussing what causes the error as well as how to fix the issue.
Also read: Open video downloader error binaries missing/corrupted: 6 Fixes
What causes the unable to extract uploader ID error?
The main reason why the error occurs is that the library isn’t able to parse the video URL provided correctly which results in a missing uploader ID, something that’s required to query the Youtube database to find the specific video to download. The bug seems to have appeared in a new release.
How to fix the unable to extract uploader ID error?
Here are two fixes you can try out.
Reinstall the library
To fix the issue, all you have to do is reinstall the library from the main Github branch using the following command.
python3 -m pip install --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz
Once you’re done downloading and installing the library, you can import it correctly as follows.
import yt_dlp as youtube_dl
Alternatively, you can also try downloading a patched version of the library using this command.
python3 -m pip install yt-dlp==2023.02.17.334
Check uploader ID parsing
Alternatively, you can also write the uploader ID differently so that the @ handle is captured properly. Since this is written in regex, it can be tricky to get the parsing right. You can use the following line to add the uploader ID properly.
'uploader_id': self._search_regex(r'/(?:channel/|user/|([email protected]))([^/?&#]+)', owner_profile_url, 'uploader id', default=None),
Also read: 10 best YouTube downloaders and converters
Hi Yad. changed line 1794 of /usr/local/lib/python3.10/site-packages/youtube_dl/extractor/youtube.py with your suggestion and it worked and solved the issue “youtube_dl.utils.RegexNotFoundError: Unable to extract uploader id” . Many thanks. G.