Cayars - Setup walk through and some tips and tricks

Where the heck do I find the correct language codes? :smiley:
For German I used “ger” which seemed to work but gives an error with babelfish. Unfortunately I couldn’t work on my rclone mount as expected, apart from that the script worked fine!

@Coxeroni

Try “deu” without quotes. Link here: https://www.loc.gov/standards/iso639-2/php/code_list.php

or here: https://en.wikipedia.org/wiki/ISO_639-3

@kevindd992002 said:

@cayars said:

@kevindd992002 said:
Did you receive my PM regarding the CP/Sonarr/Sab/Convert script configuration though?
Yes, just haven’t responded yet. Will get to it. Got a list of PMs so I take them in order and a bit backed up.

One more thing that I noticed when I tried Convert 2.2 with CPU encoding. The output file has an extension of .mp4.original. Why is it appeding the .original there?

I’ve never seen that before. Are you using the original ini file?

Ok, cool!

Yes, I’m using the original INI file. To be specific, here’s a copy of it if you want to check for yourself:

Dropbox - File Deleted - Simplify your life

@cayars

Any thoughts?

@cayars said:

@COMELOL-SERVER said:
@cayars i’ve got 6 hdd’s 4tb red without raid, is it possible to make raid @ windows server 2012 r2 with snapraid without lossing data?

SnapRaid isn’t really RAID at all. It’s nothing more than parity to help you recover from a crash. You need access to the individual drives in order to use it. That’s why I recommend SnapRaid with DrivePool which makes for a very powerful, flexible solution for Plex on Windows.

Agree with this, I have been using this setup since May when i did my new build, and it works great.

@kevindd992002 said:

@kevindd992002 said:

@cayars said:

@kevindd992002 said:
Did you receive my PM regarding the CP/Sonarr/Sab/Convert script configuration though?
Yes, just haven’t responded yet. Will get to it. Got a list of PMs so I take them in order and a bit backed up.

One more thing that I noticed when I tried Convert 2.2 with CPU encoding. The output file has an extension of .mp4.original. Why is it appeding the .original there?

I’ve never seen that before. Are you using the original ini file?

Ok, cool!

Yes, I’m using the original INI file. To be specific, here’s a copy of it if you want to check for yourself:

Dropbox - File Deleted - Simplify your life

@cayars

Any thoughts?

Do me a favor, rename your ini file and drop in the the one in the zip and try another file just to see what happens.

Is it somehow possible to set a working/temp directory in the script where the converted file is cached? This would be beneficial for me working with my Cloud space I guess since I have trouble writing to that particular Cloud folder it seems. I believe the converted file is written where the source is and than moved to the output directory, am I right?

@cayars said:

@kevindd992002 said:

@kevindd992002 said:

@cayars said:

@kevindd992002 said:
Did you receive my PM regarding the CP/Sonarr/Sab/Convert script configuration though?
Yes, just haven’t responded yet. Will get to it. Got a list of PMs so I take them in order and a bit backed up.

One more thing that I noticed when I tried Convert 2.2 with CPU encoding. The output file has an extension of .mp4.original. Why is it appeding the .original there?

I’ve never seen that before. Are you using the original ini file?

Ok, cool!

Yes, I’m using the original INI file. To be specific, here’s a copy of it if you want to check for yourself:

Dropbox - File Deleted - Simplify your life

@cayars

Any thoughts?

Do me a favor, rename your ini file and drop in the the one in the zip and try another file just to see what happens.

I got it to work with manual.py, SABPostProcess.py, and postSonarr.py already, thanks. I still have a couple of question though. I’m not sure if we should talk about it here but I figured I post it anyway:

  1. In SABPostProcess.py, I see this line:

categories = [settings.SAB[‘sb’], settings.SAB[‘cp’], settings.SAB[‘sonarr’], settings.SAB[‘radarr’], settings.SAB[‘sr’], settings.SAB[‘bypass’]]

Why aren’t the other categories the same as the default ones listed in autoconfigure.ini? They should be this way:

sb → sickbeard
cp → couchpotato
sr → sickrage

  1. Is it right to assume that SAB will run Python 2.7 if that is the one indicated in the PATH environment variable in Windows? Like I said earlier, I also have Python 3.6 installed.

  2. I also checked the code in postSonarr.py and why does it still has and MkvtoMp4 block? Does it also convert the file? I don’t see an if statement there that will check if it is already an mp4 or not but then I also don’t see it converting the file during the whole process. It just imports it properly. Can you explain this?

I’m more of a Powershell guy so I can only use context clues when reading Python code.

  1. In Plex, shouldn’t this option also be disabled? “Run a partial scan when changes are detected”. I don’t see it in the instructions you’ve sent.
  1. I don’t support these 3rd party addins here on the forums
  2. It can use either version of Python. You can have it in the path or if you have both versions installed then you can manually call one version.
  3. same as 1
  4. Depends on how you have things setup. Almost 100% of people use these scripts PRE-Plex completely standalone. So for them this setting depends.

I sent you a PM regarding 1 and 3.

  1. But if you check https://sabnzbd.org/wiki/faq#toc4here, it specifically says that SAB does not support 3.x. And how would you setup SAB to call one version when all you can do in the Categories section is to specify the script to be used for post-processing there.

  2. Yeah but if you set your script suite to notify Plex after post-processing, this setting should be disabled, right?

I just tested the Plex notification of your script and it does not work. I have this in your ini:

[Plex]
host = localhost
port = 32400
refresh = True
token =

But Plex doesn’t do a rescan after the download completes and Sonarr imports the media file in its database. How does the script call the Plex Notification anyway?

I use mp4.sickbeard converter manually (well each night) Does anyone know how to run it only looking at files that are say a week old? i.e skip mp4 files that are over a week old so it doesnt scan through the whole directory?

@kevindd992002 said:
I just tested the Plex notification of your script and it does not work. I have this in your ini:

[Plex]
host = localhost
port = 32400
refresh = True
token =

But Plex doesn’t do a rescan after the download completes and Sonarr imports the media file in its database. How does the script call the Plex Notification anyway?

did you put your plex token in where it says token = ?

@kerbys said:
I use mp4.sickbeard converter manually (well each night) Does anyone know how to run it only looking at files that are say a week old? i.e skip mp4 files that are over a week old so it doesnt scan through the whole directory?

You would need to have a separate script that finds the files older than a week then recursively call the python script for each file.

@cayars said:

@kevindd992002 said:
I just tested the Plex notification of your script and it does not work. I have this in your ini:

[Plex]
host = localhost
port = 32400
refresh = True
token =

But Plex doesn’t do a rescan after the download completes and Sonarr imports the media file in its database. How does the script call the Plex Notification anyway?

did you put your plex token in where it says token = ?

Yes, as I was troubleshooting this issue earlier I realized that I needed to put my X Plex Token there but it still doesn’t work. postSonarr.py is the one calling plex.py for the refresh but for some reason it doesn’t work. But when I manually do a refresh by using a browser and going to this URL it works:

http://%s:%s/library/sections//refresh?X-Plex-Token=MYPLEXTOKENHER

I’m trying to check the logs of the postSonarr.py script but for some reason nothing is written to C:\Convert\info.log about it even though inside the script it says to write log info there. Any clues?

Plex notification is not working for me either, although I have the token specified.

Edit: but I know you, @cayars, did not write the scripts so I don’t expect support in this :wink:

Edit2: I was probably wrong because now I see the running all by itself.

@Coxeroni said:
Plex notification is not working for me either, although I have the token specified.

Edit: but I know you, @cayars, did not write the scripts so I don’t expect support in this :wink:

Edit2: I was probably wrong because now I see the running all by itself.

So are you using both SABPostProcess.py and postSonarr.py? The cause of my problem was that I was using Python 3.6 with Sonarr and the pip packages were only installed for Python 2.7 on mine. I already solved that.

What I noticed is that if you use both scripts, you will end up doing a double conversion. If you check the script contents, they both are using MkvToMp4 to convert the video so I’m not sure why this is still necessary?

Did you also notice that setting the “threads” parameter to Auto makes it use only 1 thread? I have 8 threads in my system so I was expecting it to use all of them but why use only 1 thread?

@kevindd992002
I am only using the sabnzbd part of the script, which then calls Sickrage due to the category of the download. I don’t use the script a second time in Sickrage and in my opinion the second step is not necessary. Conversion once after Sabnzbd and then post-processing as usual without calling extra scripts.
The reason why there are scripts for all tools is simply because not everyone has the same setup and eg someone only uses sonarr exclusively without Sabnzbd.

@kevindd992002 said:
Did you also notice that setting the “threads” parameter to Auto makes it use only 1 thread? I have 8 threads in my system so I was expecting it to use all of them but why use only 1 thread?

It should use multiple threads if possible. Some codecs like VC-1 aren’t multi-threaded so it will only use one thread on certain codecs. That’s a limitation of ffmpeg itself.

@Coxeroni said:
@kevindd992002
I am only using the sabnzbd part of the script, which then calls Sickrage due to the category of the download. I don’t use the script a second time in Sickrage and in my opinion the second step is not necessary. Conversion once after Sabnzbd and then post-processing as usual without calling extra scripts.
The reason why there are scripts for all tools is simply because not everyone has the same setup and eg someone only uses sonarr exclusively without Sabnzbd.

That’s what I thought earlier but then had another realization. Most people’s setup use either SAB or a Torrent downloaded AND one or more of the media managers (Sonarr, CouchPotato, etc.). In my case, I use SAB, Sonarr, and CouchPotato. For the sake of discussion, let’s just consider SAB and Sonarr.

I think Michael (the author of the mp4_sickbear automator scripts) intended for us to use both SAPostProcess.py and postSonarr.py. If one intends to use the SAB script alone and follow the instructions for SABNZBD alone (as in no regards with the Sonarr part), then completed download handling and drone factory would not be disabled (for Sonarr’s author, one or the other should be enabled that’s why you have that warning in Sonarr when you disable both). This will create a problem because the SAB script is made to notify Sonarr after the download.

I tried analyzing both scripts again and realized that even though they both use the MkvToMp4 block, they do not have the same goal. The SAB script is the one doing the main conversion and the Sonarr script does a little more post processing like tagging with metadata. The Sonarr script is also the one notifying Plex for a library update.

So yes, you can either just use the SAB script alone and just set a Plex Notification “connection” in Sonarr or use both scripts.

@cayars said:

@kevindd992002 said:
Did you also notice that setting the “threads” parameter to Auto makes it use only 1 thread? I have 8 threads in my system so I was expecting it to use all of them but why use only 1 thread?

It should use multiple threads if possible. Some codecs like VC-1 aren’t multi-threaded so it will only use one thread on certain codecs. That’s a limitation of ffmpeg itself.

I was re-doing all my media files earlier and fired up Resource Monitor while ffmpeg.exe was doing its thing. I noticed that under the “Threads” column of the CPU tab, ffmpeg.exe is only using “1”. I’m using the default codecs that you have in the script suite so why isn’t it doing multiple threads? My system is not doing anything intensive, it’s basically idle aside from the running conversion process.

Honestly I didn’t look what the scripts are doing in detail, but for me it works perfectly when I just call it by Sabnzbd. Afterwards either Sickrage or cuchpotato is called and does the renaming and moving. I don’t tag so I am not missing anything.