[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pan-users] Files with a cryptic name
From: |
Duncan |
Subject: |
Re: [Pan-users] Files with a cryptic name |
Date: |
Thu, 1 May 2014 00:11:23 +0000 (UTC) |
User-agent: |
Pan/0.140 (Chocolate Salty Balls; GIT 2ae6aff /usr/src/portage/src/egit-src/pan2) |
Robert Derochette posted on Wed, 30 Apr 2014 23:17:27 +0200 as excerpted:
> I'm new to this list and this is my first post, so sorry if this subject
> has already been discussed before. If I import some nzb's I get a
> collection of files <cryptic>.nzb <cryptic>.1 <cryptic>.2 (...)
> where <cryptic> is always the "same word".
>
> For example,
> http://www.nzbindex.nl/
release/106777659/7bcc7cbe77deaf35c29c5fcbc40b930b-0191-2cca74bf1aeb824604c5e2cb5353f5e6.10.nzb
[I could try to rewrap that but won't bother. It's in the original
message anyway.]
>
> Pan will then download 2cca74bf1aeb824604c5e2cb5353f5e6.XX ,where XX is
> a number. Those files look like .rar files (and they actually are).
> It took me time (and a lot of Googling ;-)) to figure out how to manage
> that collection. The solution is to use par2 to rename the files.
>
> Issue the following command : par2 r *.par2 *
>
> pan2 will also have downloaded the par2 files related to the nzb which
> is ok for the renaming.
>
> Now my question is: Isn't it possible to automate this process?
First, please turn off the HTML. It's abusive to those with clients like
pan that don't handle HTML, and HTML messages can be big security issues
for those who choose to run clients that DO handle HTML. If a message
needs HTML in ordered to be worth reading, it's *NOT* worth reading, and
is sent by either spammers and/or malware purveyors, or by users who
either simply don't care that their messages look like spam/malware or
simply don't know. Since you're new to the list, in the event you're in
the latter group, now you know. Please act accordingly. =:^)
To answer your question, yes of course it can be automated. A little bit
of shell script duplicating the commands you issue manually one by one,
and voila! you've automated it. That's what makes shell scripting so
nice, in it's simplest form it's simply the same commands you'd issue
individually, collected into a file, with the key variables handled as
just that, shell variables (with values normally fed in on the
commandline), in ordered to make the shell script usefully generic,
instead of having to rewrite it for each use, which is what you're
effectively doing when you issue the commands one by one, manually. =:^)
Depending on how that script is written, you can either download each
fileset to a different directory and simply run the script in a directory
to have it par2/combine/unrar the files, possibly putting the output file
in the parent dir, or hard-coding a specific dir to put it in, OR, you
can have the script take the name from a specific file, perhaps the *.nzb
or *.01 file, and have it automatically find all files with the same
basename and par2/combine/unrar them, placing them in hard-coded
directory of choice. (Or that hard-coded dest-dir can be put in a config
file or the like instead, if desired, the idea to minimize interactivity
and automate as much as possible.) In the latter file basename case, you
could then associate the script with a filetype (probably either the *.nzb
or the *.01/*.001 files) and then could simply click that file in your
file manager to activate the script.
If you're no good at writing scripts and would like, simply post the
specific commands you do, in order, for a couple example cases, and tell
me which of the two solutions above (all in subdir or file basename,
along with the file extension you're going to associate it with), and I
can probably write the script for you (assuming no one else gets to it
first). Also tell me whether you'd like it to simply place the output in
the parent dir, or what specific target dir you wish hardcoded.
As for the association, the specifics of that will depend on your desktop
environment of choice. Here I use kde (with dolphin or gwenview as the
file manager, or mc in a terminal window for a lot of things) so could
give you instructions on that step for either kde or mc if that would
help.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman