manders2600 / Sabnzbd-Comictagger-Mylar-Script

Writing a script in bash and python to post-process comics
7 stars 2 forks source link

Running ComicRN.py produces an error #8

Open apastuszak opened 11 years ago

apastuszak commented 11 years ago

If I use your ComicRN, I get the following error at the end. The comic is convert to a CBZ just fine and is tagged correctly. But it never updates Mylar.

ComicRN.py: converting Xxx Xxxxxxx Xxxx xxx (Xxxxxxx) (Xxxx-Xxxxxx).rar to be zip format Traceback (most recent call last): File "C:\SickBeard-win32-alpha-build499\autoProcessTV\ComicRN.py", line 14, in cmtagmylar (sys.argv[1], sys.argv[3]) TypeError: 'module' object is not callable

apastuszak commented 11 years ago

I store all my post-processing scripts in my Sickbeard folder, so that path is normal.

tahngarth commented 11 years ago

For what it's worth (seeing as this is an month old issue with no reply) I have the same issue. I too am storing my scripts in the Sickbeard folder.

soco11 commented 11 years ago

I figured out what is going on. It's a change in the ComicRN.py. Open ComicRN.py with IDLE (if you are on windows, not sure the equivalent on Linux) select all the text within and then hit backspace to erase it. Then copy the text below and paste it into the empty ComicRN.py file. Then save. After I did this that error was gone.

!/usr/bin/env python

import sys import autoProcessComics import cmtagmylar

if len(sys.argv) < 2: print "No folder supplied - is this being called from SABnzbd?" sys.exit() elif len(sys.argv) >= 3: autoProcessComics.processEpisode(sys.argv[1], sys.argv[3]) else: autoProcessComics.processEpisode(sys.argv[1])

apastuszak commented 11 years ago

Your error was gone, but I bet it stopped tagging comics also.

soco11 commented 11 years ago

You are correct :-(

apastuszak commented 11 years ago

I just FIXED IT! Woohoo!!

Ok, here's what you need to do.

Using the MASTER branch, open up the file cmtagmylar.py

Use python IDLE. Other editors may mess up your indents.

Add the following line to the TOP of the file:

def run(dirName, nzbName=None):

highlight everything below it and indent it.

Now open comicRN.py

EXCEPT for the import line, everywhere else you see cmtagmylar, change it to cmtagmylar.run.

Your comicRN.py should look like this (with proper indents, of course):

!/usr/bin/env python

import sys, os import autoProcessComics import cmtagmylar

if len(sys.argv) < 2: if os.getenv('NZBPP_NZBCOMPLETED', 0):

if this variable is set, we're being called from NZBGet

    autoProcessComics.processEpisode(os.getenv('NZBPP_DIRECTORY'), os.getenv('NZBPP_NZBFILENAME'))
else:
    print "No folder supplied - is this being called from SABnzbd or NZBGet?"
    sys.exit()

elif len(sys.argv) >= 3: cmtagmylar.run (sys.argv[1], sys.argv[3]) autoProcessComics.processEpisode(sys.argv[1], sys.argv[3]) else: cmtagmylar.run (sys.argv[1]) autoProcessComics.processEpisode(sys.argv[1])

apastuszak commented 11 years ago

WAIT. There is one more change you need to do.

Line 54 in cmtagmylar.run should be changed from:

downloadpath = os.path.abspath(sys.argv[1])

to:

downloadpath = os.path.abspath(dirName)