Installing Pillow in Sabnzbd

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
Richard63NL
Newbie
Newbie
Posts: 16
Joined: August 22nd, 2019, 10:32 am

Installing Pillow in Sabnzbd

Post by Richard63NL »

Hello, i have Python 2.7 installed on my system AND Sabnzbd (which uses Python 3.8)

All works fine, but i made a script wich needs Pillow (PIL) to find out if the cover i put in the incompleet film folder is landscape or portrait
When portrait mode its renamed folder.jpg else its fanart.jpg

the demo works (without sabnzbd on python 2.7) but on sabnzbd it says its not installed.

So how to install Pillow on to Sabnzbd folder ??

Regards Richard
User avatar
safihre
Administrator
Administrator
Posts: 5362
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Installing Pillow in Sabnzbd

Post by safihre »

What kind of operating system do you use?
Linux or Windows?
Both require a different solution :)
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Richard63NL
Newbie
Newbie
Posts: 16
Joined: August 22nd, 2019, 10:32 am

Re: Installing Pillow in Sabnzbd

Post by Richard63NL »

I use windows 7 (ultimate)
User avatar
safihre
Administrator
Administrator
Posts: 5362
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Installing Pillow in Sabnzbd

Post by safihre »

Then you would probably need to use a .bat file in which you call python2 directly and pass all arguments to it that you get from SABnzbd.
For example
https://github.com/sabnzbd/sabnzbd/blob ... stProc.cmd
You can modify it to pass all the % variables to a new call.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Richard63NL
Newbie
Newbie
Posts: 16
Joined: August 22nd, 2019, 10:32 am

Re: Installing Pillow in Sabnzbd

Post by Richard63NL »

This is the demo script wich works from python direct in a commandline

import os, sys
print (sys.path)

from PIL import Image, ExifTags

image=Image.open("www.nzbserver.jpg")
width, height = image.size
print (width, height)

if width > height:
print ("landscape")
else:
print ("portrait")
Richard63NL
Newbie
Newbie
Posts: 16
Joined: August 22nd, 2019, 10:32 am

Re: Installing Pillow in Sabnzbd

Post by Richard63NL »

Ok i use a bat file to execute python 3.7 from category's wich works.

First i thought that i have to get variables back to sabnzbd, butt i stay on the external python for the whole script.
Sab still gives the results back after running the script like it normal did.

So thanks for the push in the right direction :-) Safihre
User avatar
safihre
Administrator
Administrator
Posts: 5362
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Installing Pillow in Sabnzbd

Post by safihre »

Nice!
Maybe you can share the final script here?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply