jsaddiction / TrailerTech

Download Trailers for you movies
MIT License
13 stars 4 forks source link

PermissionError: [Errno 13] Permission denied: '/root/.yt-dlp/plugins' #51

Closed fraser-mendeco closed 1 year ago

fraser-mendeco commented 1 year ago

Hi,

I've started getting this error out of the blue. Any idea why?

2023-02-14 16:30:18.9|Info|MovieService|Assigning file [Infinity Pool (2023) [imdb-tt10365998][WEBRip-1080p][AAC 5.1][HEVC]-PSA.mkv] to movie [[Infinity Pool (2023)][tt10365998, 667216]]
2023-02-14 16:30:19.5|Error|TrailerTech.py|Traceback (most recent call last):
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/config/scripts/TrailerTech/TrailerTech.py", line 12, in <module>
2023-02-14 16:30:19.5|Error|TrailerTech.py|    from downloaders.downloader import Downloader
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/config/scripts/TrailerTech/downloaders/downloader.py", line 5, in <module>
2023-02-14 16:30:19.5|Error|TrailerTech.py|    import yt_dlp
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/site-packages/yt_dlp/__init__.py", line 19, in <module>
2023-02-14 16:30:19.5|Error|TrailerTech.py|    from .downloader.external import get_external_downloader
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/site-packages/yt_dlp/downloader/__init__.py", line 26, in <module>
2023-02-14 16:30:19.5|Error|TrailerTech.py|    from .external import FFmpegFD, get_external_downloader
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/site-packages/yt_dlp/downloader/external.py", line 12, in <module>
2023-02-14 16:30:19.5|Error|TrailerTech.py|    from ..postprocessor.ffmpeg import EXT_TO_OUT_FORMATS, FFmpegPostProcessor
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/site-packages/yt_dlp/postprocessor/__init__.py", line 38, in <module>
2023-02-14 16:30:19.5|Error|TrailerTech.py|    _PLUGIN_CLASSES = load_plugins('postprocessor', 'PP')
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/site-packages/yt_dlp/plugins.py", line 135, in load_plugins
2023-02-14 16:30:19.5|Error|TrailerTech.py|    for finder, module_name, _ in iter_modules(name):
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/site-packages/yt_dlp/plugins.py", line 119, in iter_modules
2023-02-14 16:30:19.5|Error|TrailerTech.py|    pkg = importlib.import_module(fullname)
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
2023-02-14 16:30:19.5|Error|TrailerTech.py|    return _bootstrap._gcd_import(name[level:], package, level)
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "<frozen importlib._bootstrap>", line 945, in _find_spec
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/site-packages/yt_dlp/plugins.py", line 96, in find_spec
2023-02-14 16:30:19.5|Error|TrailerTech.py|    search_locations = self.search_locations(fullname)
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/site-packages/yt_dlp/plugins.py", line 66, in search_locations
2023-02-14 16:30:19.5|Error|TrailerTech.py|    candidate_locations.extend(_get_package_paths(
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/site-packages/yt_dlp/plugins.py", line 61, in _get_package_paths
2023-02-14 16:30:19.5|Error|TrailerTech.py|    if not plugin_dir.is_dir():
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/pathlib.py", line 1305, in is_dir
2023-02-14 16:30:19.5|Error|TrailerTech.py|    return S_ISDIR(self.stat().st_mode)
2023-02-14 16:30:19.5|Error|TrailerTech.py|  File "/usr/lib/python3.10/pathlib.py", line 1097, in stat
2023-02-14 16:30:19.5|Error|TrailerTech.py|    return self._accessor.stat(self, follow_symlinks=follow_symlinks)
2023-02-14 16:30:19.5|Error|TrailerTech.py|PermissionError: [Errno 13] Permission denied: '/root/.yt-dlp/plugins'
SomeRandomUserIsHere commented 1 year ago

I am also getting the same error. I posted about it a few days back in the discussion board here. I think it happened for me after upgrading my Radarr Linux.io Docker image. I can still run TrailerTech from the command line, but the custom script in Radarr fails with similar error as you. Seems to be some sort of permissioning issue maybe. I'm wondering if it has something to do with the way the Linux.io docker container handles the automated installation of TrailerTech prerequisites. Are you also using a Docker image per chance?

fraser-mendeco commented 1 year ago

Yeah I use the l same docker image.

jsaddiction commented 1 year ago

First off, sorry for the delayed response, I was deployed.

This one took some digging. It appears that yt-dlp implemented a new plugin system and had some issues with permissions. Later it was fixed with commit 6011.

You should be able to fix this by rebuilding your container causing the install script to run again. Make sure your install script is the same as the one in this repo as small changes have been made and these changes are not automatically populated.

If you are comfortable with the command line a quicker, less destructive solution is to run the following commands: docker exec -it radarr /bin/bash - Allows cli access to your running container. python -m pip uninstall yt-dlp - Removes the old package completely. python -m pip install yt-dlp - Reinstalls the newest version of the package with the fix mentioned in the commit above.

I will close this issue for now but feel free to open it again if the solutions provided don't fix the problem.

SomeRandomUserIsHere commented 1 year ago

Dude, you the man! Serving his country it seems AND serving us in need of local trailers! Solved my issue, all better now, thanks again for everything!