Page 1 of 1

Script - relative execution

PostPosted: Sun Mar 13, 2016 6:18 pm
by Valmont
Hi.

My script (cmd file) contains the following code:
Code: Select all
del *.url

But this doesn't work as I have to explicitly give the path, am I correct? Because I was thinking, Newsbin would know for which folder the post-unrar script ought to be, but that's not a feature.

Edit: I see now this would create practical problems.

Re: Script - relative execution

PostPosted: Mon Mar 14, 2016 12:29 pm
by Quade
You know you can add filters to apply after unrar?

Newsbin creates two files. "Input.txt" and "Output.txt" before it invokes the script. Input should be the raw files and output should be the output of the unrar. They contain full paths.

I believe the intent was for you to look in these files and to delete any file that you didn't like from this list. The unrar path should be the first parameter passed to the script too.

Re: Script - relative execution

PostPosted: Mon Mar 14, 2016 1:25 pm
by Valmont
I don't understand this filter-after-unrar thing. What is it? What does it do?

When it comes to my intent, the goal was to remove all spam files which come with a certain set I'm downloading. It's like a few 300 GB of data, and each package of 1 GB or so comes with a tons of advertisement files. They are *url's, *nfo's and whatnot. So I have a script now which deletes them. Also the script points to a another script which deletes executable files (*.scr, *.exe, *.bat *.cmd). It all works fine. Love that added script stuff! I just thought Newsbin was smart enough to figure out for which folder to unleash the script to, but that wouldn't be a smart implementation in hindsight :)

Re: Script - relative execution

PostPosted: Mon Mar 14, 2016 2:13 pm
by Quade
1 - In the autopar options you can select a filter profile to apply after unrar.

2 - In the filter profile, add to "Reject If Filename Contains"

[.]nfo
[.]url
sample
...

or any other file you want to filter out.

Then after unrar these rejected files will be deleted.

Re: Script - relative execution

PostPosted: Mon Mar 14, 2016 3:53 pm
by Valmont
Quade wrote:1 - In the autopar options you can select a filter profile to apply after unrar.

2 - In the filter profile, add to "Reject If Filename Contains"

[.]nfo
[.]url
sample
...

or any other file you want to filter out.

Then after unrar these rejected files will be deleted.

That would be awesome. I'll try that immediately!

Edit: indeed, it works and you can enable or disable it whilst downloads are in progress. It will work for the next download. At the same time it lacks the granularity which scripts are offering, and that's exactly what I realized after I asked my original question :). Basically scripting renders this filters for post-un-rar-ing obsolete!
It was fun exploring this subject! Thanks.

Re: Script - relative execution

PostPosted: Mon Mar 14, 2016 5:00 pm
by Quade
Basically scripting renders this filters for post-un-rar-ing obsolete!


More people will use filters than will attempt a script. Whatever works for people is fine with me.

Re: Script - relative execution

PostPosted: Tue Mar 15, 2016 8:13 pm
by Valmont
Quade wrote:
Basically scripting renders this filters for post-un-rar-ing obsolete!


More people will use filters than will attempt a script. Whatever works for people is fine with me.

It has some advantages indeed for quick and easy fixes which one might want to work for all folders without explicitly stating them.