pan-users
[Top][All Lists]
Advanced

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

[Pan-users] Automating NZB downloads


From: Ron Johnson
Subject: [Pan-users] Automating NZB downloads
Date: Mon, 07 Nov 2011 17:46:21 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Mnenhy/0.8.4 Thunderbird/3.1.15

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

--
Vegetarians eat vegetables, Humanitarians frighten me.



reply via email to

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