How to get final file directory

Get help, report and discuss bugs.
Post Reply
humble_leech
Posts: 2
Joined: 25 Aug 2019, 21:11

How to get final file directory

Post by humble_leech » 25 Aug 2019, 21:18

I'm trying to create a script for my non-TV/Movie files (and maybe also some movie files). How do I get the "The final directory of the job (full path)" which is parameter 1 when using Sabnzbd? Even the final processed file name would be good enough for me to build the path if I had to. Thanks.

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

Re: How to get final file directory

Post by hugbug » 28 Aug 2019, 14:05


humble_leech
Posts: 2
Joined: 25 Aug 2019, 21:11

Re: How to get final file directory

Post by humble_leech » 31 Aug 2019, 14:15

Thank you hugbug. I did look this over prior to posting but the option I would assume I want eludes me:

NZBPP_FINALDIR - Final directory, if set by one of previous scripts

It states that its set by a previous script, but I'm not sure when this happens in the process. I have a script that calls filebot to rename a movie file, but I'm not sure how to get the resulting file name/location after that to feed another script. I can see that NZBGet knows this value by watching the logs but not sure how to intercept it. There are other ways I may be able to tackle this, but this seems like the simplest if I knew how to grab that final directory/file name like NZBGet. I'm probably just missing something that's staring me in the face.

Again, thank you!

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

Re: How to get final file directory

Post by hugbug » 01 Sep 2019, 17:44

What you asked for is NZBPP_DIRECTORY (parameter 1 when using Sabnzbd).

However if you have multiple scripts then any script can move files anywhere. In that case nzbget doesn't know where the files are now. For such cases there is a possibility for the script to inform nzbget about new location via NZBPP_FINALDIR. Other scripts can use the info.

In your particular case when filebot moves the file somewhere it certainly doesn't set FINALDIR in nzbget. Then nzbget doesn't know where the files were moved. If the new location can be parsed from the log then your script can obtain item log from nzbget and analyse it.

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests