NzbToMedia passes through 3 args, but also sys.arg[0] is this script (full path) itself... So len(sys.argv) == 4 and sys.argv[3] is a digit...
Without this, is actually tries to use the SABnzbd clean name (sys.argv[3]) which in this case is easier 1 or 0...

So... Just change the test to
If len(sys.argv)  ==  4 and sys.argv[3].isdigit():