Custom Plugins - User Script

So you made CouchPotato even more awsome?
User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: Custom Plugins - User Script

Postby clinton.hall » 27 Feb 2015 22:24

Take a look at the first post on this thread... Just add the path to your script and comment out/delete the lines pertaining to the arguments you don't need.

User avatar
saitoh183
Junior Member
Posts: 19
Joined: 02 Jul 2012 17:27
Contact:
Status: Offline

Re: Custom Plugins - User Script

Postby saitoh183 » 09 Mar 2016 03:33

im trying to use this function to launch a script and im getting the following error:

Code: Select all

ERROR
[  couchpotato.core.loader] Can't import PostProcess: Traceback (most recent call last):
  File "/opt/couchpotato_fr/couchpotato/core/loader.py", line 58, in run
    m = self.loadModule(module_name)
  File "/opt/couchpotato_fr/couchpotato/core/loader.py", line 164, in loadModule
    return import_module(name)
  File "/opt/couchpotato_fr/libs/importhelper/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/svc_saitoh/.couchpotato_fr/custom_plugins/PostProcess/__init__.py", line 1, in <module>
    from .main import PostProcess
  File "/home/svc_saitoh/.couchpotato_fr/custom_plugins/PostProcess/main.py", line 6, in <module>
    import movieprobe
  File "/home/svc_saitoh/.couchpotato_fr/custom_plugins/PostProcess/movieprobe.py", line 43
    except Exception as e:
         ^
SyntaxError: invalid syntax


here is a link to the script im trying to use

https://drive.google.com/open?id=0B-nxn ... hKaG14aUk0

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: Custom Plugins - User Script

Postby clinton.hall » 31 Mar 2016 14:16

python is very format specific. Probably bad indenting or wrong syntaxt.
Can't tell for sure as the link above is somewhat restricted.

tjalfe
Junior Member
Posts: 29
Joined: 14 Dec 2012 13:22
Contact:
Status: Offline

Re: Custom Plugins - User Script

Postby tjalfe » 15 Jul 2016 09:24

Can i create a custom script/plugin which sends a wake on lan when the downloader report that a download has completed?

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: Custom Plugins - User Script

Postby clinton.hall » 03 Oct 2016 01:00

yes, this is possible. My nzbToMedia script actually has an option to perform WOL before processing.

chris247
Junior Member
Posts: 5
Joined: 01 Nov 2016 09:48
Status: Offline

Re: Custom Plugins - User Script

Postby chris247 » 02 Nov 2016 09:40

I created everything as the 1st post says and cp doesn't do anything after it moves and renames a movie. I simply want it to run a .sh script that i have in my /home/plex/scripts/uploadMovies.sh Looking at the logs I don't think it even knows the PostProcess folder and files are there. Everything is owned by plex user which what I use to run couchpotato

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: Custom Plugins - User Script

Postby clinton.hall » 02 Nov 2016 12:41

Can you show any logs?
Did you resatrt CouchPotato after adding the files?

chris247
Junior Member
Posts: 5
Joined: 01 Nov 2016 09:48
Status: Offline

Re: Custom Plugins - User Script

Postby chris247 » 02 Nov 2016 13:44

Yes i restarted cp. There's nothing on the logs just the typical found nzb, completed, moving etc

chris247
Junior Member
Posts: 5
Joined: 01 Nov 2016 09:48
Status: Offline

Re: Custom Plugins - User Script

Postby chris247 » 28 Dec 2016 11:18

decided to give this another try and now at least I get an error on the logs. I get this:
ERROR
[ couchpotato.core.event] Error in event "renamer.after", that wasn't caught: Traceback (most recent call last): File "/opt/couchpotato/couchpotato/core/event.py", line 15, in runHandler return handler(*args, **kwargs) File "/home/plex/.couchpotato/custom_plugins/PostProcess/main.py", line 17, in callscript imdbid = group['library']['identifier'] KeyError: 'library' encoding=UTF-8 debug=False args=['--daemon'] app_dir=/opt/couchpotato data_dir=/home/plex/.couchpotato desktop=None options=Namespace(config_file='/home/plex/.couchpotato/settings.conf', console_log=False, daemon=True, data_dir=None, debug=False, pid_file='/home/plex/.couchpotato/couchpotato.pid', quiet=False)

All I did was add my script path to the original main.py posted on the 1st post.

EDIT: I walked to away from my computer for a few minutes after seeing this error and was surprised to see that the script worked but only once. I restarted cp and it worked again but only once again. Don't know whats going on.

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: Custom Plugins - User Script

Postby clinton.hall » 28 Dec 2016 21:18

imdbid = group['library']['identifier']

KeyError: 'library'

This error suggests that "group" does not contain a "library" key for this movie.
you could add debug printing to find out what keys group does contain, and find out where the imdb id is contained.

civpro
Junior Member
Posts: 3
Joined: 15 May 2016 17:23
Status: Offline

Re: Custom Plugins - User Script

Postby civpro » 08 Jan 2017 05:22

are there any plugins that will look at the "In Theaters" movies and allow you to automatically add it based on genre?


Return to “External Tools”