clinton-hall / GetScripts

A Collection of NZBGet Post-Process Scripts
GNU General Public License v2.0
100 stars 39 forks source link

Getting Syntax Error during Post Processing #10

Closed F1nny closed 9 years ago

F1nny commented 9 years ago

Hey, Just found the ResetDateTime script and love it as exactly what I needed, however running the latest NZBGet/etc (ArchLinux latest/uptodate) it is unable to process successfully. See error below, any ideas? Running NZBGet 15.0-1 from the AUR, maybe because python? I have both 2 and 3, although the default python command defaults to 3? Again error below, thanks!

INFO Tue Jul 14 2015 20:32:38 Collection yadayada(tt2039393) added to history ERROR Tue Jul 14 2015 20:32:37 Post-process-script ResetDateTime.py for yadayada(tt2039393) failed (terminated with unknown status) INFO Tue Jul 14 2015 20:32:37 ResetDateTime: SyntaxError: invalid syntax INFO Tue Jul 14 2015 20:32:37 ResetDateTime: ^ INFO Tue Jul 14 2015 20:32:37 ResetDateTime: print "This script can only be called from NZBGet (11.0 or later)." INFO Tue Jul 14 2015 20:32:37 ResetDateTime: File "/usr/share/nzbget/scripts/ResetDateTime.py", line 25 INFO Tue Jul 14 2015 20:32:37 Executing post-process-script ResetDateTime.py for yadayada(tt2039393) INFO Tue Jul 14 2015 20:32:37 Queueing yadayada(tt2039393) for post-processing INFO Tue Jul 14 2015 20:32:37 yadayada(tt2039393) returned from history back to download queue INFO Tue Jul 14 2015 20:24:25 Collection yadayada(tt2039393) added to history

clinton-hall commented 9 years ago

how did you install these scripts? Did you use git clone or did you download and copy into notepad on Windows etc?

It looks like the script has either been incorrectly formatted in a copy/paste operation, or has some other format issue introduced somewhere... git clone works fine here...

F1nny commented 9 years ago

Hey clinton, sorry took so long to get back to this. I installed originally by downloading, however after your comment I git cloned the repository into the scripts directory as recommended but unfortunately experienced the same issue. Could it be because python defaults to 3.4.3 on arch linux? python2 is also installed at 2.7.10 however is called via python2, any ideas on what could be the issue? It seems the other scripts also fail for example flatten also failed to trigger successfully:

ERROR   Fri Aug 21 2015 20:45:16    Post-process-script ResetDateTime.py for yadayada failed (terminated with unknown status)
INFO    Fri Aug 21 2015 20:45:16    ResetDateTime: SyntaxError: invalid syntax
INFO    Fri Aug 21 2015 20:45:16    ResetDateTime: ^
INFO    Fri Aug 21 2015 20:45:16    ResetDateTime: print "This script can only be called from NZBGet (11.0 or later)."
INFO    Fri Aug 21 2015 20:45:16    ResetDateTime: File "/usr/share/nzbget/scripts/ResetDateTime.py", line 25
INFO    Fri Aug 21 2015 20:45:16    Executing post-process-script ResetDateTime.py for yadayada
ERROR   Fri Aug 21 2015 20:45:16    Post-process-script flatten.py for yadayada failed (terminated with unknown status)
INFO    Fri Aug 21 2015 20:45:16    flatten: SyntaxError: invalid syntax
INFO    Fri Aug 21 2015 20:45:16    flatten: ^
INFO    Fri Aug 21 2015 20:45:16    flatten: print "This script can only be called from NZBGet (11.0 or later)."
INFO    Fri Aug 21 2015 20:45:16    flatten: File "/usr/share/nzbget/scripts/flatten.py", line 41
INFO    Fri Aug 21 2015 20:45:16    Executing post-process-script flatten.py for yadayada

Edit: Also just for reference, NZBget is at 15.0-1 via arch linux community repo (not from AUR as mentioned previously)

clinton-hall commented 9 years ago

Change 1st line of script from

#!/usr/bin/env python

To

#!/usr/bin/env python2

These are not Python 3 compatible.

F1nny commented 9 years ago

Hey Clinton, sure enough that did it:) Thanks and thanks for your work on all the scripts!