Script - relative execution

Technical support and discussion of Newsbin Version 6 series.

Script - relative execution

Postby Valmont » Sun Mar 13, 2016 6:18 pm

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.
Valmont
Active Participant
Active Participant
 
Posts: 63
Joined: Wed Aug 09, 2006 2:51 pm

Registered Newsbin User since: 06/14/09

Re: Script - relative execution

Postby Quade » Mon Mar 14, 2016 12:29 pm

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.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44981
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Re: Script - relative execution

Postby Valmont » Mon Mar 14, 2016 1:25 pm

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 :)
Valmont
Active Participant
Active Participant
 
Posts: 63
Joined: Wed Aug 09, 2006 2:51 pm

Registered Newsbin User since: 06/14/09

Re: Script - relative execution

Postby Quade » Mon Mar 14, 2016 2:13 pm

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.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44981
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Re: Script - relative execution

Postby Valmont » Mon Mar 14, 2016 3:53 pm

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.
Valmont
Active Participant
Active Participant
 
Posts: 63
Joined: Wed Aug 09, 2006 2:51 pm

Registered Newsbin User since: 06/14/09

Re: Script - relative execution

Postby Quade » Mon Mar 14, 2016 5:00 pm

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.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44981
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Re: Script - relative execution

Postby Valmont » Tue Mar 15, 2016 8:13 pm

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.
Valmont
Active Participant
Active Participant
 
Posts: 63
Joined: Wed Aug 09, 2006 2:51 pm

Registered Newsbin User since: 06/14/09


Return to V6 Technical Support

Who is online

Users browsing this forum: No registered users and 6 guests