Page 9 of 10

Re: [Scan-Script] pfftn (formerly pass-from-file-to-nzbget.py)

Posted: 15 May 2019, 10:08
by MrVideo
I'm a little confused. My configuration: Linux: Fedora Core 27 | Python 2.7.15 | NZBGet 21.0

So, which version of the script should I be using: pfftn_2x.py or pass-from-file-to-nzbget2.6.py?

Thanks.

Re: [Scan-Script] pfftn (formerly pass-from-file-to-nzbget.py)

Posted: 15 May 2019, 10:10
by hugbug
I'd try pfftn_2x.py from the first post.

Re: [Scan-Script] pfftn (formerly pass-from-file-to-nzbget.py)

Posted: 15 May 2019, 13:47
by MrVideo
hugbug wrote:
15 May 2019, 10:10
I'd try pfftn_2x.py from the first post.
So far that seems to be working great.

Re: [Scan-Script] pfftn (formerly pass-from-file-to-nzbget.py)

Posted: 14 Aug 2019, 11:55
by chocoprinsje
i dont know what im doing wrong
i have a new comp and i installed nzbget with pass-from-file-to-nzbget2.6.py
and installed python
and i on windows
but nzbget failed to unpack the nzb
i have trying so often but nzbget is not working with {{password }}
who can help me?

Re: [Scan-Script] pfftn (formerly pass-from-file-to-nzbget.py)

Posted: 16 Aug 2019, 17:52
by chocoprinsje
i tried everything but it didnt work anymore
can someone help please
i installed and installed python but the script is not working
i tried everything

Re: [Scan-Script] pfftn (formerly pass-from-file-to-nzbget.py)

Posted: 28 Nov 2019, 16:49
by jockel
chocoprinsje wrote:
16 Aug 2019, 17:52
i tried everything but it didnt work anymore
can someone help please
i installed and installed python but the script is not working
i tried everything
its working. i tested it a couple of minutes ago with linux.

be sure, you are using the right version and you've followed the steps in first post.
(it can only run, if you have python installed on your system)

Re: [Scan-Script] pfftn (formerly pass-from-file-to-nzbget.py)

Posted: 05 Dec 2020, 13:58
by tony2k
abc08154711 wrote:
12 Mar 2019, 20:47
Python 3 drops this errors:
Executing scan-script pfftn_3x.py for something{{password}}.nzb
pfftn_3x: File "/opt/nzbget/scripts/pfftn_3x.py", line 81
pfftn_3x: print('[NZB] NZBPR_*Unpack:Password=', p.group(1), sep='')
pfftn_3x: ^
pfftn_3x: SyntaxError: invalid syntax
I get the same error with a QNAP. There is only python3 available and so I can't use the python2 script, which works great on a windows machine.

If you take out the last part of line 81 with <sep=''> (like in the script for python2), there is no error from the script for that line. The password section also seems to be recognized correctly, but the password does not work. So what is the function of the <sep=''> section. Someone has an idea?

Edit: ok, i now get the function of the <sep>. It will erase empty spaces in the string. I'll give it another try without that. Maybe someone has an idea why it fails with that command.

Edit2: Since this unfortunately does not work without it, I used another script. This one works without any problems so far and is therefore recommended under python3.

The only thing to remember is that, as with this script, the first line with the Python version has to be changed here.
--> GetPw.py https://gist.github.com/t0phr/c76496968e3a4b8e7fc2
Change the first line to: #!/usr/bin/env python

Re: [Scan-Script] pfftn (formerly pass-from-file-to-nzbget.py)

Posted: 12 Jan 2021, 09:51
by Ordovicium
It drove me crazy to install this extension. I would like to share, how I finally found a way to work.
Running on a Synology NAS.
  • Installed Python2 by Safihre which creates the app in /volume1/@appstore/python
  • Connnecting to the NAS with SSH
  • In /usr/bin/ I ran

    Code: Select all

    sudo rm python*
  • Then I copied the python files from the app dir to the user/bin folder

    Code: Select all

    sudo cp /volume1/@appstore/python/bin/python* /usr/bin/
  • Checking if it works

    Code: Select all

    python --version
This procedure works with Python2. For Python3 you need to figure out your App Dir. Will not install now again to complete this tutorial :D

Re: [Scan-Script] pfftn (formerly pass-from-file-to-nzbget.py)

Posted: 06 Mar 2021, 08:07
by xhead
abc08154711 wrote:
12 Mar 2019, 20:47
Python 3 drops this errors:
Executing scan-script pfftn_3x.py for something{{password}}.nzb
pfftn_3x: File "/opt/nzbget/scripts/pfftn_3x.py", line 81
pfftn_3x: print('[NZB] NZBPR_*Unpack:Password=', p.group(1), sep='')
pfftn_3x: ^
pfftn_3x: SyntaxError: invalid syntax
I had the same error. I'm using a qnap nas with python 3.8.x
For some reason python does not like the print() syntax here.

My fix:
1. Use TABS instead of SPACES in the if statement (just to be consistent in the script)
2. change print from , to + ( instead of print('Hi', variable) we are using print('Hi' + variable) )

It should look like this:

Code: Select all

p = re.match( r'^.*?\{\{[ ]?(.*?)[ ]?\}\}', fwp)
f = re.sub( r'[ .]?{\{[ ]?(.*?)[ ]?\}\}', '', fwp)

if p:
	print('[NZB] NZBPR_*Unpack:Password=' + p.group(1))
	# Next line can be removed if wanted or set to [DETAIL] logging
	#print('[INFO] p:', p.group(1), sep='')
	if f:
		print('[NZB] NZBNAME=' + f)
		# Next line can be removed if wanted or set to [DETAIL] logging
		#print('[INFO] f:', f, sep='')

sys.exit(POSTPROCESS_SUCCESS)

Re: [Scan-Script] pfftn (formerly pass-from-file-to-nzbget.py)

Posted: 27 Oct 2021, 11:36
by FCrane
I always get the following error (from the messages log):


pfftn_3x: C:\Users\Frasier\AppData\Local\Programs\Python\Python310\python.exe: can't open file 'C:\\ProgramData\\NZBGet\\scripts\\L': [Errno 2] No such file or directory
Executing scan-script pfftn_3x.py for gsp{{ADhTmroVpj2h15sIMeBJsYwSJe43gR}}.nzb


No matter what I do, where I put the script, etc. This is driving me crazy! The MainDir is set to "E:\NZBGet". The script path is set to "${MainDir}\scripts" and the script is exactly there!

Why does Python (v3) still look somewhere else? I've removed all Python paths from the environtment variable just to be sure it does not take it from there. What is that strange directory with the "L" at the end? What is going on here???

I'm on Windows 10, Python3 installed correctly, NZBGet configured and working correctly - just not able to use ANY Python scripts...