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

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
MrVideo
Posts: 47
Joined: 20 Mar 2019, 05:44

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

Post by MrVideo » 15 May 2019, 10:08

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.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

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

Post by hugbug » 15 May 2019, 10:10

I'd try pfftn_2x.py from the first post.

MrVideo
Posts: 47
Joined: 20 Mar 2019, 05:44

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

Post by MrVideo » 15 May 2019, 13:47

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.

chocoprinsje
Posts: 4
Joined: 08 Mar 2017, 16:12

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

Post by chocoprinsje » 14 Aug 2019, 11:55

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?

chocoprinsje
Posts: 4
Joined: 08 Mar 2017, 16:12

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

Post by chocoprinsje » 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

jockel
Posts: 1
Joined: 28 Nov 2019, 16:46

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

Post by jockel » 28 Nov 2019, 16:49

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)

tony2k
Posts: 1
Joined: 05 Dec 2020, 13:36

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

Post by tony2k » 05 Dec 2020, 13:58

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

Ordovicium
Posts: 1
Joined: 12 Jan 2021, 09:40

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

Post by Ordovicium » 12 Jan 2021, 09:51

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

xhead
Posts: 1
Joined: 06 Mar 2021, 08:00

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

Post by xhead » 06 Mar 2021, 08:07

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)

FCrane
Posts: 21
Joined: 19 Oct 2013, 08:04

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

Post by FCrane » 27 Oct 2021, 11:36

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...

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests