I installed ytdl-org / youtube-dl from Github to download videos from YouTube to a Linux system with the pip package manager, since youtube-dl is a Python script, using the command
pip3 install youtube-dl
. But when I
tried to download a YouTube video with youtube-dl, I received an error message
indicating the script was unable to extract the ID of the uploader of the
video and the video was not downloaded.
$ youtube-dl https://www.youtube.com/watch?v=JmSmjDngVXM
[youtube] JmSmjDngVXM: Downloading webpage
ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
$
I verified I had the latest version of the program, 2021.12.17.
$ youtube-dl --version 2021.12.17 $
To obtain further information on the error, I then ran the script with the
--verbose
option which showed me more details on the error.
$ youtube-dl --verbose https://www.youtube.com/watch?v=JmSmjDngVXM
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.youtube.com/watch?v=JmSmjDngVXM']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.6.8 (CPython) - Linux-3.10.0-229.7.2.el7.x86_64-x86_64-with-centos-7.1.1503-Core
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] JmSmjDngVXM: Downloading webpage
ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 836, in __extract_info
ie_result = ie.extract(url)
File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 534, in extract
ie_result = self._real_extract(url)
File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1794, in _real_extract
'uploader_id': self._search_regex(r'/(?:channel|user)/([^/?&#]+)', owner_profile_url, 'uploader id') if owner_profile_url else None,
File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 1012, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
$
The software, which is a command-line program to download videos from YouTube.com and other video sites, is maintained by ytdl-org and, on a Github webpage for the organization, I found issue #32247, ERROR: Unable to extract uploader id, which attributed the error to YouTube recently starting to add that "at sign", i.e., @, to URLs. jgmayer, who posted his comments and the solution just 3 hours before I encountered the problem, posted the following solution:
The solution is to go to the file that you getting the error:
"/usr/local/Cellar/youtube-dl/2021.12.17/libexec/lib/python3.10/site-packages/youtube_dl/extractor/common.py"Find the following line:
'uploader_id': self._search_regex(r'/(?:channel|user)/([^/?&#]+)', owner_profile_url, 'uploader id') if owner_profile_url else None,
Replace with the following:
'uploader_id': self._search_regex(r'/(?:channel/|user/|@)([^/?&#]+)', owner_profile_url, 'uploader id', default=None),
The poster indicated the relevant file is
/usr/local/Cellar/youtube-dl/2021.12.17/libexec/lib/python3.10/site-packages/youtube_dl/extractor/common.py
,
but there is no /usr/local/Cellar
directory on my system and
running the script with the verbose option, showed the relevant code is on line
1,794 of
/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py
.
After making the suggested change, I was able to download a YouTube video with the program.
$ youtube-dl https://www.youtube.com/watch?v=JmSmjDngVXM [youtube] JmSmjDngVXM: Downloading webpage [download] Destination: Ancient Greek Lesson #1 _ Learn Greek Fast Online-JmSmjDngVXM.mp4 [download] 100% of 14.88MiB in 04:20 $
The updated youtube.py that can
be used to replace the 2021.12.17 version in
/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py
.
References:
-
ERROR: Unable to extract uploader id #32247
By: jgmayer
Date: May 29, 2023
Github - ytdl-org / youtube-dl
Related Articles: