Sabnzbd script is not being called (NZBtoMedia)

Status
Not open for further replies.

JoeB

Contributor
Joined
Oct 16, 2014
Messages
121
I have installed Sab in a jail (192.168.1.6) and sickrage in a different jail.

A have added storage to both jails to the same common location on my "media-server" dataset, as far as both jails are concerned, this is:

"/mnt/sabnzbd-temp"

Inside this, i have:

"/mnt/sabnzbd-temp/completed"
"/mnt/sabnzbd-temp/completed/tv"
"/mnt/sabnzbd-temp/completed/movies"
"/mnt/sabnzbd-temp/incomplete"
"/mnt/sabnzbd-temp/scripts"

Using the polled method, sickrage copies whatever is downloaded, renames it, moves it to a different location outside on the media-server dataset and deletes the "completed" files.. This all works perfectly.

However..

I have downloaded "NZBtoMedia" and placed it in the common location "/mnt/sabnzbd-temp/scripts/nzbToMedia-master"
I have SHH'ed in and changed the owner to media:media and have chmod'ed +x.

Code:

root@sabnzbd_1:/mnt/sabnzbd-temp/scripts/nzbToMedia-master # ls -la			 total 235
drwxrwxr-x   5 media  media	 21 Oct  1 14:21 .
drwxrwxr-x   3 media  media	  3 Oct  1 13:24 ..
-rwxrwxr-x   1 media  media	555 May 29 02:11 .gitattributes
-rwxrwxr-x   1 media  media	 74 May 29 02:11 .gitignore
-rwxrwxr-x   1 media  media   5042 May 29 02:11 README.md
-rwxrwxr-x   1 media  media  15953 May 29 02:11 TorrentToMedia.py
-rwxrwxr-x   1 media  media  17120 Oct  1 17:23 autoProcessMedia.cfg
-rwxrwxr-x   1 media  media  16975 May 29 02:11 autoProcessMedia.cfg.spec
-rwxrwxr-x   1 media  media  21203 May 29 02:11 changelog.txt
drwxrwxr-x  10 media  media	 20 Oct  1 13:24 core
-rwxrwxr-x   1 media  media	504 May 29 02:11 getffmpeg.sh
drwxrwxr-x  19 media  media	 22 Oct  1 13:24 libs
-rwxrwxr-x   1 media  media  35127 May 29 02:11 license.txt
-rwxrwxr-x   1 media  media   6783 May 29 02:11 nzbToCouchPotato.py
-rwxrwxr-x   1 media  media   2702 May 29 02:11 nzbToGamez.py
-rwxrwxr-x   1 media  media   3119 May 29 02:11 nzbToHeadPhones.py
-rwxrwxr-x   1 media  media  26602 May 29 02:11 nzbToMedia.py
-rwxrwxr-x   1 media  media   3070 May 29 02:11 nzbToMylar.py
-rwxrwxr-x   1 media  media   6386 May 29 02:11 nzbToNzbDrone.py
-rwxrwxr-x   1 media  media   6708 May 29 02:11 nzbToSickBeard.py
drwxrwxr-x   2 media  media	  5 Oct  1 13:24 tests


In sickrage:
Settings -> Post Processing -> Enable? unchecked.

In SAB: (following this guide https://github.com/Sickrage/Sickrage/wiki/NZBtoMedia)

Settings -> Folders -> Scripts Folder = /mnt/sabnzbd-temp/scripts/nzbToMedia-master

Settings -> Switches -> Post processing -> Post-Process Only Verified Jobs = unchecked

Settings -> Special -> empty_postproc = checked

Settings -> categories ->
( Relative folders are based on: /mnt/sabnzbd-temp/completed )
- Category: tv
- Priority: Normal
Processing: Download
Script: nzbToSickBeard.py (drop menu)
Folder: tv
Groups: <empty>

Edited "autoProcessMedia.cfg" as below:

Code:

[SickBeard]
	#### autoProcessing for TV Series
	#### tv - category that gets called for post-processing with SB
	[[tv]]
		enabled = 1
		host = http://192.168.1.7
		port = 5051
		username =
		password =
		###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ######
		web_root =
		ssl = 0
		fork = auto
		delete_failed = 0
		# Enable/Disable linking for Torrents
		Torrent_NoLink = 0
		keep_archive = 1
		process_method =
		# force processing of already processed content when running a manual scan.
		force = 0
		# tell SickRage to delete all source files after processing.
		delete_on = 0
		extract = 1
		nzbExtractionBy = Downloader
		# Set this to minimum required size to consider a media file valid (in MB)
		minSize = 0
		# Enable/Disable deleting ignored files (samples and invalid media files)
		delete_ignored = 0
		##### Enable if SickBeard is on a remote server for this category
		remote_path = 0
		##### Set to path where download client places completed downloads locally for this category
		watch_dir = /mnt/sabnzbd-temp/completed/tv


[Nzb]
	###### clientAgent - Supported clients: sabnzbd, nzbget
	clientAgent = sabnzbd
	###### SabNZBD (You must edit this if your using nzbToMedia.py with SabNZBD)
	sabnzbd_host = http://192.168.1.6
	sabnzbd_port = 5050
	sabnzbd_apikey = <correct key>
	###### Enter the default path to your default download directory (non-category downloads). this directory is protected by safe_mode.
	default_downloadDirectory = /mnt/sabnzbd-temp/completed/tv



I see nothing in the SAB log files to suggest it even tried to run the script.
What I do see is this:

2016-10-01 19:09:44,077::INFO::[postproc:294] Starting Post-Processing on That.Show.S05E15.1080p.BluRay.x264-YELLOWBiRD-Obfuscated => Repair:True, Unpack:True, Delete:True, Script:None, Cat:tv
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
when sickrage sends downloads to sabnzbd are they being assigned the 'tv' category?
 

JoeB

Contributor
Joined
Oct 16, 2014
Messages
121
Yes they are. lowercase "tv".
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
the scripts expect the python2 command to be available. do you have python2 installed? (its just a link to python2.)
 

JoeB

Contributor
Joined
Oct 16, 2014
Messages
121
OK, i've tried "whereis python", and its reporting not found. How can i check if its installed?

EDIT: If i try whereis python2 at root, its installed, but not in the jail...

root@JOE-FREENAS] ~# whereis python
python: /usr/local/bin/python
[root@JOE-FREENAS] ~# whereis python2
python2: /usr/local/bin/python2

[root@JOE-FREENAS] ~# jexec sabnzbd_1
root@sabnzbd_1:/ # whereis python2
python2:
root@sabnzbd_1:/
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
pkg info | grep python

python2 is not installed by default
pkg install python2
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
you may also need 'py27-sqlite3'
 

JoeB

Contributor
Joined
Oct 16, 2014
Messages
121
[sabnzbd_1] [1/1] Installing python2-2_3...
[sabnzbd_1] [1/1] Extracting python2-2_3: 100%

root@sabnzbd_1:/ # whereis python2
python2: /usr/local/bin/python2


[sabnzbd_1] [1/1] Installing py27-sqlite3-2.7.12_7...
[sabnzbd_1] [1/1] Extracting py27-sqlite3-2.7.12_7: 100%

I'l test the scripts later and report back..
 

JoeB

Contributor
Joined
Oct 16, 2014
Messages
121
I've created the symlink:

root@sabnzbd_1:/ # which python2.7
/usr/local/bin/python2.7

root@sabnzbd_1:/ # ln -sf /usr/bin/python2.7 /usr/bin/python2

The 'nzbToMedia-master' folder now contains a /logs/ folder, and in there is a nzbtomedia.log file :) so its running.

Looks like Sickbeard (actually Sickrage) is not responding. My server doesn't currently use a un/pw, but does expose an api key, i cant see anywhere to enter this?

Code:
nzbtomedia.log:

2016-10-02 10:35:46 INFO	::MAIN: Loading config from [/mnt/sabnzbd-temp/scripts/nzbToMedia-master/autoProcessMedia.cfg]
2016-10-02 10:35:46 INFO	::MAIN: Checking database structure...
2016-10-02 10:35:46 INFO	::MAIN: Checking if source needs an update
2016-10-02 10:35:58 ERROR   ::MAIN: Unknown current version number, don't know if we should update or not
2016-10-02 10:35:58 INFO	::MAIN: nzbToMedia Version:10.15 Branch:master (FreeBSD 10.3-RELEASE)
2016-10-02 10:35:58 WARNING ::MAIN: Failed to locate ffmpeg. Transcoding disabled!
2016-10-02 10:35:58 WARNING ::MAIN: Install ffmpeg with x264 support to enable this feature  ...
2016-10-02 10:35:58 WARNING ::MAIN: Failed to locate ffprobe. Video corruption detection disabled!
2016-10-02 10:35:58 WARNING ::MAIN: Install ffmpeg with x264 support to enable this feature  ...
2016-10-02 10:35:58 INFO	::MAIN: #########################################################
2016-10-02 10:35:58 INFO	::MAIN: ## ..::[nzbToMedia.pyc]::.. ##
2016-10-02 10:35:58 INFO	::MAIN: #########################################################
2016-10-02 10:35:58 INFO	::MAIN: Script triggered from SABnzbd
2016-10-02 10:35:58 INFO	::MAIN: Auto-detected SECTION:SickBeard
2016-10-02 10:35:58 INFO	::MAIN: Calling SickBeard:tv to post-process:That.70s.Show.S07E06.1080p.BluRay.x264-YELLOWBiRD-Obfuscated.nzb
2016-10-02 10:35:58 ERROR   ::SICKBEARD: Server did not respond. Exiting
2016-10-02 10:35:58 ERROR   ::MAIN: A problem was reported in the /mnt/sabnzbd-temp/scripts/nzbToMedia-master/nzbToSickBeard.py script.

 
Last edited:

JoeB

Contributor
Joined
Oct 16, 2014
Messages
121
Update: I searched the scripts to find the error "Server did not respond. Exiting". It appears that you're not supposed to specify http:// for 'host', just an ip address, as http:// or https:// is added automaticly by the script. so host = 192.168.1.6

I also removed watch_dir so it is blank as i cant see what that is for?

Anyway, it's processing successful downloads. I can't check the failed handling yet as nothing has failed.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
you don't need to create the links yourself, that's what the python2 and python package does. the scripts are smart enough to look in the system PATH for them.
 
Status
Not open for further replies.
Top