clinton-hall / nzbToMedia

Provides NZB and Torrent postprocessing To CouchPotatoServer, SickBeard/SickRage, HeadPhones, Mylar and Gamez
GNU General Public License v3.0
672 stars 176 forks source link

SB transmission downloads set as "UNCAT" #383

Closed jaybone2012 closed 10 years ago

jaybone2012 commented 10 years ago

Hi Guys.

Got the SABNZBD part of nzbToMedia working great.

However I am trying to get the SickBeard and Transmission working nicely with the script.

For some reason, it is classing all my TV shows as "UNCAT" and not processing them.

See example log.

15:20:33|INFO    ====================
15:20:33|INFO    TorrentToMedia V9.2
15:20:33|INFO    MAIN: Loading config from /volume1/@appstore/nzbToMedia/autoProcessMedia.cfg
15:20:33|DEBUG   arg 0 is: /volume1/@appstore/nzbToMedia/TorrentToMedia.py
15:20:33|DEBUG   MAIN: Received Directory: /volume1/Downloads/Complete/TV Shows | Name: The.Big.Bang.Theory.S07E22.720p.HDTV.X264-DIMENSION[rarbg] | Category: 
15:20:33|INFO    SEARCH: Found torrent directory The.Big.Bang.Theory.S07E22.720p.HDTV.X264-DIMENSION[rarbg] in input directory directory /volume1/Downloads/Complete/TV Shows
15:20:33|INFO    SEARCH: Setting inputDirectory to /volume1/Downloads/Complete/TV Shows/The.Big.Bang.Theory.S07E22.720p.HDTV.X264-DIMENSION[rarbg]
15:20:33|INFO    SEARCH: Files appear to be in their own directory
15:20:33|DEBUG   SEARCH: Continuing scan to determin category.
15:20:33|DEBUG   MAIN: Determined Directory: /volume1/Downloads/Complete/TV Shows/The.Big.Bang.Theory.S07E22.720p.HDTV.X264-DIMENSION[rarbg] | Name: The.Big.Bang.Theory.S07E22.720p.HDTV.X264-DIMENSION[rarbg] | Category: 
15:20:33|INFO    MAIN: Download is a directory
15:20:33|INFO    MAIN: Output directory set to: /volume1/Downloads/Complete/UNCAT/The.Big.Bang.Theory.S07E22.720p.HDTV.X264-DIMENSION[rarbg]
15:20:33|INFO    MAIN: No processing to be done for category: UNCAT. Exiting
15:20:33|INFO    MAIN: All done.
15:29:16|INFO    ====================

I think it might be something to do with my folder structure.

Structure is currently...

/volume1/downloads/complete/tv shows /volume1/downloads/complete/movies /volume1/downloads/complete/music

Do I need to make these more specific to the actual downloader?

For example...

/volume1/downloads/transmission/complete /volume1/downloads/sabnzbd/complete

I read the guide in the wiki, but I wasn't too sure because I am using echel0n fork of SickBeard and don't need blackhole/watch folders for torrents.

clinton-hall commented 10 years ago

so what category have you got ste in autoProcessMedia.cfg [SickBeard] category?

I think the issue might be having "tv shows" as a category... the space can cause issues with string comparisons. i personal;ly would use either "tv", "series", or "tv_shows"

So set SickBeard to download to /volume1/downloads/complete/tv_shows and then set autoProcessMedia.cfg [SickBeard] category=tv_shows

this should work.

jaybone2012 commented 10 years ago

Thanks will give that a go and let you know On 09/05/2014 10:18 AM, "Clinton Hall" notifications@github.com wrote:

so what category have you got ste in autoProcessMedia.cfg [SickBeard] category?

I think the issue might be having "tv shows" as a category... the space can cause issues with string comparisons. i personal;ly would use either "tv", "series", or "tv_shows"

So set SickBeard to download to /volume1/downloads/complete/tv_shows and then set autoProcessMedia.cfg [SickBeard] category=tv_shows

this should work.

— Reply to this email directly or view it on GitHubhttps://github.com/clinton-hall/nzbToMedia/issues/383#issuecomment-42621822 .

jaybone2012 commented 10 years ago

in the cfg file my category for sickbeard was only "tv" so it didn't match with the folder structure anyway.

have adjusted, will let you know

clinton-hall commented 10 years ago

yeah, that explains a lot... It may in-fact handle "tv shows" but i just prefer not to use spaces ;)

jaybone2012 commented 10 years ago

ok so I created a new folder /volume1/downloads/complete/tv_shows

updated the config file

now I think I am having some permissions issues.

I cannot see that the torrenttomedia script is even running.

my new downloads are sitting in the new folder.

the postprocess.log has not changed

I have changed everything in the nzbToMedia folder to have root permissions

Also transmission is running as root user.

SickBeard is not running as "root" is this a problem?

jaybone2012 commented 10 years ago

actually I lie, SickBeard is running as root user as well

clinton-hall commented 10 years ago

previously the script did run... if it stopped, then I am guessing by editing the .cfg file you change it's permissions? Were these files previously owned by root? is there any error in Transmission logs?

jaybone2012 commented 10 years ago

yeah the script has run previously, so in my attempt to change everything to root and 0777 I must have broken something.

trying to remember how I got transmission logging to work

ok got it, and yes it looks like it calls the script, but nothing is happening...

[11:50:54.669] Saved "/root/.config/transmission-daemon/torrents/American.Dad.S09E17.HDTV.x264-2HD.mp4.ebb5106b192be2a1.torrent" (variant.c:1217)
[11:51:29.708] American.Dad.S09E17.HDTV.x264-2HD.mp4 State changed from "Incomplete" to "Complete" (torrent.c:2153)
[11:51:29.708] American.Dad.S09E17.HDTV.x264-2HD.mp4 Seed ratio reached; pausing torrent (torrent.c:499)
[11:51:29.708] American.Dad.S09E17.HDTV.x264-2HD.mp4 Calling script "/volume1/@appstore/nzbToMedia/TorrentToMedia.py" (torrent.c:2111)
[11:51:29.708] American.Dad.S09E17.HDTV.x264-2HD.mp4 Pausing (torrent.c:1859)
[11:51:29.708] Saved "/root/.config/transmission-daemon/resume/American.Dad.S09E17.HDTV.x264-2HD.mp4.ebb5106b192be2a1.resume" (variant.c:1217)
jaybone2012 commented 10 years ago

Something happened the other day to my root users default shell when I was trying to get ffmpeg installed.

I had to change root user in /etc/passwd from root:x:0:0:root:/root:/bin/ash to root:x:0:0:root:/root:/opt/bin/bash

Can't remember but the files might have been previously owned by an account in the user group. I will try change and see what happens.

But I

jaybone2012 commented 10 years ago

changed everything in the nzbToMedia folder back to an account in the "users" group, full permissions, still nothing.

strange that sabznbd has no problems running the scripts

jaybone2012 commented 10 years ago

ok I tried to run the script manually using /usr/local/python/bin/python2.7 ./TorrentToMedia.py

and got this...

12:31:32|INFO    ====================
12:31:32|INFO    TorrentToMedia V9.2
12:31:32|INFO    MAIN: Loading config from ./autoProcessMedia.cfg
12:31:32|DEBUG   arg 0 is: ./TorrentToMedia.py
12:31:32|ERROR   MAIN: There was a problem loading variables
Traceback (most recent call last):
  File "./TorrentToMedia.py", line 523, in <module>
    inputDirectory, inputName, inputCategory, inputHash, inputID = parse_args(clientAgent)
  File "/volume1/@appstore/nzbToMedia/autoProcess/nzbToMediaUtil.py", line 453, in parse_args
    return parseFunc(sys.argv)
  File "/volume1/@appstore/nzbToMedia/autoProcess/nzbToMediaUtil.py", line 432, in parse_transmission
    inputDirectory = os.path.normpath(os.getenv('TR_TORRENT_DIR'))
  File "/usr/local/python/lib/python2.7/posixpath.py", line 327, in normpath
    initial_slashes = path.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
jaybone2012 commented 10 years ago

just for shits and giggles I tried the dev branch, this is as far as I got

2014-05-09 14:16:57 INFO    ::MAIN: Loading config from [/volume1/@appstore/nzbToMediaDev/autoProcessMedia.cfg]
2014-05-09 14:16:57 INFO    ::MAIN: Checking database structure...
2014-05-09 14:16:57 INFO    ::MAIN: Checking if git needs an update
2014-05-09 14:16:58 INFO    ::MAIN: No update needed
2014-05-09 14:16:58 INFO    ::MAIN: nzbToMedia Version:23f6fdc2144f97e66c59e6a84117a232afd91e39 Branch:dev (Linux 3.2.40)
2014-05-09 14:16:58 INFO    ::MAIN: #########################################################
2014-05-09 14:16:58 INFO    ::MAIN: ## ..::[TorrentToMedia.py]::.. ##
2014-05-09 14:16:58 INFO    ::MAIN: #########################################################
2014-05-09 14:16:58 INFO    ::MAIN: SEARCH: Found torrent directory American.Dad.S09E14.HDTV.x264-2HD.[VTV].mp4 in input directory directory /volume1/Downloads/Complete/tv_shows
2014-05-09 14:16:58 INFO    ::MAIN: SEARCH: Setting inputDirectory to /volume1/Downloads/Complete/tv_shows/American.Dad.S09E14.HDTV.x264-2HD.[VTV].mp4
jaybone2012 commented 10 years ago

Got the dev branch to work

Had to set everything to users group, but then when the script ran some new files were created as root user and this was holding things up.

Re-did all the permissions again and everything seems to be running smoothly.

clinton-hall commented 10 years ago

interesting.. I was just looking at this and thought i found a bug... but no... In any case, i have fixed some logging.