Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where are we supposed to run this? #1

Open
calebsw83 opened this issue Apr 29, 2024 · 1 comment
Open

Where are we supposed to run this? #1

calebsw83 opened this issue Apr 29, 2024 · 1 comment

Comments

@calebsw83
Copy link

If I run it from the home folder of my server, it adds the poster folders to the same folder (''), overwriting them all so that only the last one is available at the end of the script's execution. If I run it in the library's folder, I get this error:

Traceback (most recent call last):
File "/home/calebsw83/plex/Movies/PlexPosterExport.py", line 71, in
runScript()
File "/home/calebsw83/plex/Movies/PlexPosterExport.py", line 43, in runScript
posterPath = download(baseurl + videoPoster, token, "poster.png", videoFolder)
File "/home/calebsw83/.local/lib/python3.10/site-packages/plexapi/utils.py", line 458, in download
os.makedirs(savepath, exist_ok=True)
File "/usr/lib/python3.10/os.py", line 225, in makedirs
mkdir(name, mode)

not sure what I can do. I feel like I'm so close to getting it working but I just don't know what else to try.

@rabbethan
Copy link

rabbethan commented Oct 10, 2024

Replying to an old issue because I had the same problem; leaving it here for the next guy.

Found that the problem was that the script was searching for the path in a Windows format with a backslash (\) while I'm running my server on Linux which uses a forward slash (/).

I had to change line 40 from

 videoFolder = videoPath.rpartition('\\')[0] + "\\"

to

            videoFolder = videoPath.rpartition('/')[0]

Same has to be done on lines 50 and 64 for "shows".

            showFolder = showPath[0] + "\\"

to

            showFolder = showPath[0]

and

                episodePath = episode.locations[0].rpartition('\\')[0] + "\\"
                episodeFile = episode.locations[0][episode.locations[0].rindex("\\")+1:][:-4]

to

                episodePath = episode.locations[0].rpartition('/')[0]
                episodeFile = episode.locations[0][episode.locations[0].rindex("/")+1:][:-4]

That fixed me right up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants