Download Youtube Videos via youtube-dl
This article is original, reproduced please indicate the source
Installation
shell
sudo pip3 install --upgrade youtube-dl
Troubleshooting
When using youtube-dl to download youtube videos, the following error occurs
WARNING
txt
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.
File "`/usr/local/lib/python3.11/dist-packages/youtube_dl/extractor/youtube.py`", line 1794, in _real_extract
Solution: Replace the code on line 1794
txt
'uploader_id': self._search_regex(r'/(?:channel|user)/([^/?&#]+)', owner_profile_url, 'uploader id') if owner_profile_url else None,
'uploader_id': self._search_regex(r'/(?:channel/|user/|@)/([^/?&#]+)', owner_profile_url, 'uploader id'),
Utilization
shell
youtube-dl -f best URL
For more detailed usage information, see Official website