Hey there recently after using pyinstaller installed from pip, the system repo installed yt-dlp misbehaves and wont work when downloading videos it reports cant write etc.
'''
[youtube] GaE01NCDNkw: Downloading webpage
[youtube] GaE01NCDNkw: Downloading android player API JSON
[youtube] GaE01NCDNkw: Downloading player b7910ca8
WARNING: [youtube] nsig extraction failed: You may experience throttling for some formats
n = pVX8RViV-RiArPV ; player = https://www.youtube.com/s/player/b7910ca8/player_ias.vflset/en_US/base.js
GaE01NCDNkw: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/yt_dlp/extractor/youtube.py", line 2517, in _decrypt_nsig
self._player_cache[player_id] = self._extract_n_function(video_id, player_url)
File "/usr/lib/python3/dist-packages/yt_dlp/extractor/youtube.py", line 2543, in _extract_n_function
funcname = self._extract_n_function_name(jscode)
File "/usr/lib/python3/dist-packages/yt_dlp/extractor/youtube.py", line 2531, in _extract_n_function_name
return json.loads(js_to_json(self._search_regex(
File "/usr/lib/python3/dist-packages/yt_dlp/extractor/common.py", line 1229, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
yt_dlp.utils.RegexNotFoundError: Unable to extract Initial JS player n function list (Usa.0); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
(caused by RegexNotFoundError('Unable to extract \x1b[0;94mInitial JS player n function list (Usa.0)\x1b[0m; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U')); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
WARNING: [youtube] nsig extraction failed: You may experience throttling for some formats
n = txEYOXgCHPgTDzD ; player = https://www.youtube.com/s/player/b7910ca8/player_ias.vflset/en_US/base.js
GaE01NCDNkw: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/yt_dlp/extractor/youtube.py", line 2517, in _decrypt_nsig
self._player_cache[player_id] = self._extract_n_function(video_id, player_url)
File "/usr/lib/python3/dist-packages/yt_dlp/extractor/youtube.py", line 2543, in _extract_n_function
funcname = self._extract_n_function_name(jscode)
File "/usr/lib/python3/dist-packages/yt_dlp/extractor/youtube.py", line 2531, in _extract_n_function_name
return json.loads(js_to_json(self._search_regex(
File "/usr/lib/python3/dist-packages/yt_dlp/extractor/common.py", line 1229, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
yt_dlp.utils.RegexNotFoundError: Unable to extract Initial JS player n function list (Usa.0); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
(caused by RegexNotFoundError('Unable to extract \x1b[0;94mInitial JS player n function list (Usa.0)\x1b[0m; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U')); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
ERROR: [youtube] GaE01NCDNkw: Unable to extract uploader id; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
```
In an attempt to fix this i tried purging yt-dlp but was met with the following error :
```
E: Unable to locate package yt-dlp recipie.txt
```
** Although (purge yt-dlp) works fine but reinstalling etc. has no effect the problem persists.
Sys-info:
```
Description: Ubuntu 22.04.2 LTS
Release: 22.04
```
Package version:
```
yt-dlp:
Installed: 2022.04.08-1
Candidate: 2022.04.08-1
Version table:
2023.03.04-1~bpo22.04.1 100
100 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages
100 http://archive.ubuntu.com/ubuntu jammy-backports/universe i386 Packages
*** 2022.04.08-1 500
500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
500 http://archive.ubuntu.com/ubuntu jammy/universe i386 Packages
100 /var/lib/dpkg/status
```
For the first issue, it seems like you are hitting https:/ /github. com/yt- dlp/yt- dlp/issues/ 6247 which was fixed in yt-dlp 2023.02.17 and above. If you'll note your 'apt-cache policy' output, there's a version higher than that ready to install, simply select it with `sudo apt install -t jammy-backports yt-dlp`.
For the second issue, apt returns the error "E: Unable to locate package yt-dlp recipie.txt" which shows you passed it "yt-dlp recipie.txt" as the package name, which obviously isn't correct. Correct your command for removal and it should work.
Lastly, pip can interfere with system installed packages, since you are mixing package managers. I believe generally you're advised to use venvs instead. If using pip and it breaks your system packages, you get to keep both pieces.