Searching and Resume by File Extension

Get help, report and discuss bugs.
Post Reply
stuart264
Posts: 2
Joined: 15 Mar 2021, 16:33

Searching and Resume by File Extension

Post by stuart264 » 15 Mar 2021, 16:45

I have spent about an hour going through the documentation and I cant find an easy way to search and resume by file extension.

What I am trying to do is add a few paused nzb's into the download queue then download any .jpg files so I can check any screenshots etc and make sure the nzb contents are what I want, essentially do the same as clicking files, searching for jpg's and resuming them.
I initially thought I could do this with a variable or filter in the simple search box, i.e. select all nzb's in the queue, search for *.jpg then select and resume them as its very time consuming going into each nzb individually and its the kind of task automation exists for. I just cant figure out how to do it so any advise or suggestions gratefully appreciated.

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

Re: Searching and Resume by File Extension

Post by hugbug » 15 Mar 2021, 17:56

If your goal is to automate then you need to write a script, more specifically a queue script.

In that script you use api method listfiles to get content of the nzb. Then find the ids of files you want to resume and use method editqueue with command FileResume.

As an example of queue script see QueueSort or for a more advanced example FakeDetector.

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

Re: Searching and Resume by File Extension

Post by hugbug » 15 Mar 2021, 18:15

An alternative approach would be to use command line interface which can manipulate files using regular expressions.

The following command resumes all .jpg-files in nzb mynzb:

Code: Select all

nzbget -L -E FR U "mynzb/.*\.jpg"
But be very careful with the last parameter which is a regular expression in POSIX Extended Regular Expression Syntax (see https://www.regular-expressions.info/posix.html).
If your nzb-name contains any special characters they will be interpreted as regular expressions commands. Therefore all such characters must be escaped. For example if your nzb-name is "my.title" you need to escape "." with "\" because dot is a special characters in regular expressions:

Code: Select all

nzbget -L -E FR U "my\.title/.*\.jpg"
You could just escape every character too:

Code: Select all

nzbget -L -E FR U "\m\y\.\t\i\t\l\e/.*\.jpg"
Put that command (nzbget -E ...) into a queue-script to execute it automatically for each added nzb. The name of the nzb is available in the script in env. var NZBNA_NZBNAME. Make sure to escape all special characters in it when building the command for nzbget.

stuart264
Posts: 2
Joined: 15 Mar 2021, 16:33

Re: Searching and Resume by File Extension

Post by stuart264 » 15 Mar 2021, 19:02

I'm stuck with your answer, writing a script to do that is way over my head and skill set.

I was trying the command line option with your example through the nzbget-command-shell.bat but I'm confused as to where I should be pointing the command.

My NZB Program files exist at C:\Program Files\NZBGet while my "working directories" are at C:\Usenet\NZBGet and I am assuming that I want to point that command at C:\Usenet\NZBGet\scripts\ but if I execute this example

Code: Select all

nzbget -L -E FR U "C:\Usenet\NZBGet\queue/.*\.jpg"
I get a "Edit command completed successfully but when I check the web GUI nothing has changed and the same if I point that command at the directory where the nzb.queued files are.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests