pan-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pan-users] Automating NZB downloads


From: Heinrich Mueller
Subject: Re: [Pan-users] Automating NZB downloads
Date: Tue, 08 Nov 2011 08:32:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1

Am 08.11.2011 00:46, schrieb Ron Johnson:
On 11/07/2011 12:22 PM, Graham Lawrence wrote:
Date: Sun, 06 Nov 2011 20:15:54 -0600
From: Ron Johnson<address@hidden>

pan --no-gui -o /home/g/Films --nzb "${nzb[1]}" 2>/home/g/pan.debug


Slight topic change: are you trying to d/l from a list of nzb files?


Yes and no.  I download nzbs manually into a directory, at odd
intervals.  In the script I download from just one nzb per run, and
find it most convenient to ls those .nzbs into an array, rm the first
one in the array (because its the file I downloaded last time) and
then download the second element in the array with Pan.


That sounds like a weird use of arrays.

Here's another way to do it...

tmpfile=$(mktemp -u)
NZB=$(head -n1 $NZB_LIST)
pan --no-gui -o /home/g/Films --nzb "$NZB"
tmpfile=$(mktemp -u)
sed '1d' $NZB_LIST > $tmpfile
mv $tmpfile $NZB_LIST

You could also implement it in a loop:

cd /home/g/Films
tmpfile=$(mktemp -u)
QUEUE=~/my_list_of_NZBs.txt
while [ -s $QUEUE ]; do
    NZB=$(head -n1 $QUEUE)
    pan --no-gui -o . --nzb "$NZB"
    sed '1d' $QUEUE > $tmpfile
    mv $tmpfile $QUEUE
done

AFAIK pan parses the command line after the --nzb switch in the way
that each following argument is _one_ nzb file.
pan --no-gui -o . --nzb nzb1.nzb nzb2.nzb etc ... works.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]