rtorrent unrar automatiskt?

Här diskuterar vi skal, kommandon och klassiska linuxverktyg.
tigertailz
Inlägg: 25
Blev medlem: 30 jul 2007, 16:41

Re: rtorrent unrar automatiskt?

Inlägg av tigertailz »

Fin tråd har nu fått igång det så filer laddas ner till olika mappar beroende på typ tex tv,xvid,dvdr. Här är config filen

Kod: Markera allt

# speed settings

upload_rate = 60

# session settings

session = /home/overlord/torrents/sessions/rtorrent.session
directory = /home/overlord/torrents/incoming
# watch settings

schedule = watch_directory,10,10,load_start=/home/overlord/torrents/watch/*.torrent
schedule = tied_directory,10,10,start_tied=
schedule = untied_directory,10,10,close_untied=


  # [XviD] 
    
schedule = watch_directory_2,10,10,"load_start=/home/overlord/torrents/rss/xvid/*.torrent,d.set_custom2=/home/overlord/torrents/seed/xvid/"
on_finished = move_complete_2,"execute=mv,-u,$d.get_base_path=,$d.get_custom2= ;d.set_directory=$d.get_custom2="

  # [TV]
schedule = watch_directory_3,10,10,"load_start=/home/overlord/torrents/rss/tv/*.torrent,d.set_custom1=/home/overlord/torrents/seed/tv/"
on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,$d.get_custom1= ;d.set_directory=$d.get_custom1="

  # [DVDR]

schedule = watch_directory_4,10,10,"load_start=/home/overlord/torrents/rss/dvdr/*.torrent,d.set_custom3=/home/overlord/torrents/seed/dvdr/"
on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,$d.get_custom3= ;d.set_directory=$d.get_custom3="

# network settings

port_range = 55556-55560
use_udp_trackers = yes

encoding_list = UTF-8
''


Sen har jag ett cronscript som körs lite då och då. Vad jag vill är att scriptet skall ge den uppackade filen dirnamnet, alltså tex unrar Film1/kalle.rar -> Film1.avi

Kod: Markera allt

#!/bin/sh

cd /home/overlord/torrents/incoming/unpacking/

for file in $(find /home/overlord/torrents/seed/tv -iregex '.*\.\(rar\|001\)')
do
    echo -n "checking file ${file##*/}..."
    onblacklist=`grep -c $file /home/overlord/torrents/incoming/unpacking/blacklist`
    if [ $onblacklist -ne 0 ]; then
        echo "already unpacked"
    else
        echo "not unpacked yet"
        echo -n "unpacking..."
        unrar e -inul -o- $file
        echo "done!"
        echo -n "adding to blacklist..."
        echo $file >> /home/overlord/torrents/incoming/unpacking/blacklist
        echo "done!"
    fi
done
ls -rt /home/overlord/torrents/incoming/unpacking/ | grep -v '\(^tvunrar.sh$\|^blacklist$\|^cron.log$\)' | xargs -I{} mv {} /home/overlord/torrents/showroom/tv
jfk
Inlägg: 13
Blev medlem: 27 nov 2008, 20:43
OS: Ubuntu
Utgåva: 14.04 Trusty Tahr LTS

Re: rtorrent unrar automatiskt?

Inlägg av jfk »

@tigertailz:

Som jag fattar det så flyttas filerna in i korrekt katalog först de är 100% nedladdade, eller har jag förstått koden fel?

Filerna laddas alltid ner till /torrents/incoming/ och flyttas när de är klara mha. on_finished koden?

/J
tigertailz
Inlägg: 25
Blev medlem: 30 jul 2007, 16:41

Re: rtorrent unrar automatiskt?

Inlägg av tigertailz »

Precis, och det andra scriptet här nere letar i den katalogen där de färdiga nerladdningarna ligger.
tigertailz
Inlägg: 25
Blev medlem: 30 jul 2007, 16:41

Re: rtorrent unrar automatiskt?

Inlägg av tigertailz »

Efter att jag har läst igenom tråden noga så verkar det som att det är ganska så krånligt att få till det så. Kanske går det att behålla mappnamnet istället när man packar upp. Tex ~Mapp1/arkiv.rar packas upp till /tmp/Mapp1/innehåll.i.rar.fil ?
abandonow
Inlägg: 22
Blev medlem: 09 okt 2008, 00:59
OS: Xubuntu
Utgåva: 14.04 Trusty Tahr LTS

Re: rtorrent unrar automatiskt?

Inlägg av abandonow »

Hvis du går litt tilbake i tråden, så vil du se løsningen jeg endte opp med å bruke pakker opp, flytter og renamer filen til releasenavn.
tigertailz
Inlägg: 25
Blev medlem: 30 jul 2007, 16:41

Re: rtorrent unrar automatiskt?

Inlägg av tigertailz »

Problemet är att jag packar upp till olika mappar bereoende på filtyp det gör väl inte du. Eller kan du inte posta din rtorrent.rc ?
abandonow
Inlägg: 22
Blev medlem: 09 okt 2008, 00:59
OS: Xubuntu
Utgåva: 14.04 Trusty Tahr LTS

Re: rtorrent unrar automatiskt?

Inlägg av abandonow »

http://ubuntu-se.org/phpBB3/viewtopic.p ... 54#p254454 <-- Ang. renaming, men igjen basert på dirnavn, men antar det funker for deg og?

Kod: Markera allt

#scgiport for wtorrent.
scgi_port = localhost:5000

# Maximum and minimum number of peers to connect to per torrent.
min_peers = 40
max_peers = 100

# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 10
max_peers_seed = 50

# Maximum number of simultanious uploads per torrent.
max_uploads = 15

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 1450
upload_rate = 125

# Default directory to save the downloaded torrents.
directory =/download 

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/rt/.rsession

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/download/*.torrent
schedule = untied_directory,5,5,stop_untied=

#Multiple watch folders
schedule = A,1,5,"load_start=/download/TV/*.torrent,d.set_directory=/download/TV/,d.set_custom1=/arkiv/Serier/"
schedule = B,1,5,"load_start=/download/Films/*.torrent,d.set_directory=/download/Films/,d.set_custom1=/arkiv/Filmer/"
schedule = C,1,5,"load_start=/download/Music/*.torrent,d.set_directory=/download/Music/"
schedule = D,1,5,"load_start=/download/Games/*.torrent,d.set_directory=/download/Games/"
schedule = E,1,5,"load_start=/download/Software/*.torrent,d.set_directory=/download/Software/"
schedule = F,1,5,"load_start=/download/Annet/*.torrent,d.set_directory=/download/Annet/"
schedule = G,1,5,"load_start=/download/PDF/*.torrent,d.set_directory=/download/PDF/"
schedule = H,1,5,"load_start=/download/Fonts/*.torrent,d.set_directory=/download/Fonts/"

#Series custom path:
schedule = I,1,5,"load_start=/download/TV/serie1/*.torrent,d.set_directory=/download/TV/Serie1/,d.set_custom1=/arkiv/Serier/Serie1.S01.720p.HDTV.X264/"
schedule = J,1,5,"load_start=/download/TV/serie2/*.torrent,d.set_directory=/download/TV/Serie2/,d.set_custom1=/arkiv/Serier/serie2.S02.720p.HDTV.X264/"
schedule = K,1,5,"load_start=/download/TV/serie3/*.torrent,d.set_directory=/download/TV/Serie3/,d.set_custom1=/arkiv/Serier/Serie3.S03.720p.HDTV.X264/"
#(osv...)

#Extract rar and move
system.method.set_key = event.download.finished,unpack_rar,"execute=/home/rt/bin/unpackrar.sh,$d.get_base_path=,$d.get_custom1="

# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=100M

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,"stop_on_ratio=200,200M,2000"

# The ip address reported to the tracker.
#ip = 127.0.0.1
#ip = rakshasa.no

# The ip address the listening socket and outgoing connections is
# bound to.
#bind = 127.0.0.1
#bind = rakshasa.no

# Port range to use for listening.
port_range = 55500-55555

# Start opening ports at a random position within the port range.
#port_random = no

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
check_hash = yes

# Set whetever the client should try to connect to UDP trackers.
#use_udp_trackers = yes

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,enable_retry,prefer_plaintext

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
# 
# dht = auto

# UDP port to use for DHT. 
# 
# dht_port = 6881

# Enable peer exchange (for torrents not marked private)
#
# peer_exchange = yes

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10
hash_read_ahead = 8

# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 10

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 5

#throttle
throttle = 10,10
throttle = 20,20
throttle = 30,30
throttle = 40,40
throttle = 50,50
throttle = 60,60
throttle = 70,70
throttle = 80,80
throttle = 90,90
Rarscript:

Kod: Markera allt

#!/bin/bash
test -z "$2" && exit
FILE=$(unrar vb "$1/*")
case $(echo "$FILE" | wc -l) in
1)
   yes no | nice -n 15 unrar e -r "$1/*" "$2"
   mv -f "$2/${FILE##*/}" "$2/${1##*/}.${FILE##*.}"
;;
*)
   yes no | nice -n 15 unrar x -r "$1/*" "$2"
;;
esac >&- 2>&- &
Jeg har altså flexget (rss leser) til å laste ned serier til gittmapper, som igjen pakker de ut, renamer og flytter de til rett mappe på en arkiv disk.
tigertailz
Inlägg: 25
Blev medlem: 30 jul 2007, 16:41

Re: rtorrent unrar automatiskt?

Inlägg av tigertailz »

det fungerade fan och med. Tackar tackar
Användarvisningsbild
Ausir
Inlägg: 26
Blev medlem: 13 feb 2009, 11:46
OS: Ubuntu
Utgåva: 18.04 Bionic Beaver LTS

Re: rtorrent unrar automatiskt?

Inlägg av Ausir »

Jag är nybörjare så jag undrar, sparar du filerna och seedar dem, eller packar du upp dem och flyttar dem direkt när nerladdningen är klar? Egentligen undrar jag hur jag får en unpack_rar.sh att fungera, min som jag klistrade in på förra sidan gör det inte.
abandonow
Inlägg: 22
Blev medlem: 09 okt 2008, 00:59
OS: Xubuntu
Utgåva: 14.04 Trusty Tahr LTS

Re: rtorrent unrar automatiskt?

Inlägg av abandonow »

Jeg sparer på filene for å seede, og sletter manuelt senere.

Filen pakker ut og renamer filen etter mappenavn til en path definert i .rtorrent.rc.
Användarvisningsbild
Ausir
Inlägg: 26
Blev medlem: 13 feb 2009, 11:46
OS: Ubuntu
Utgåva: 18.04 Bionic Beaver LTS

Re: rtorrent unrar automatiskt?

Inlägg av Ausir »

Vilken version av rtorrent använder du? 0.8.4?

Jag reagerade nämlingen på din
#Extract rar and move
system.method.set_key = event.download.finished,unpack_rar,"execute=/home/rt/bin/unpackrar.sh,$d.get_base_path=,$d.get_custom1="
jag kör ju

Kod: Markera allt

on_finished = unpack_rar,"execute=/home/Erik/unpack_rar.sh,$d.get_base_path=,$d.get_custom1="
i 0.8.2.
abandonow
Inlägg: 22
Blev medlem: 09 okt 2008, 00:59
OS: Xubuntu
Utgåva: 14.04 Trusty Tahr LTS

Re: rtorrent unrar automatiskt?

Inlägg av abandonow »

0.8.3, men hvis du leser igjennom hele tråden så vil du se at jeg går over fra gammel til ny måte. Så les igjennom i tråden litt nøye, så vil du få svar.
Limpan111
Inlägg: 1
Blev medlem: 17 apr 2009, 20:22
OS: Ubuntu
Utgåva: 14.04 Trusty Tahr LTS

Re: rtorrent unrar automatiskt?

Inlägg av Limpan111 »

Hej och tack för en riktigt bra guide i hur man lyckas med rtorrent.
Jag har ett litet problem, jag använder detta scriptet för att packa upp.
Mitt problem är att det packas upp direkt i mappen jag har valt, jag skulle gärna vilja ha kvar orginal mappen om det går?
jag antar att det är relativt enkelt men jag kan inte mycket om scripting.

Såhär är det nu

Kod: Markera allt

cd /home/homebox/unpack/film2009.BLURAY-SIGGE.mkv
Såhör vill jag ha det

Kod: Markera allt

cd /home/homebox/unpack/film2009.BLURAY-SIGGE/film2009.BLURAY-SIGGE.mkv

Kod: Markera allt

#!/bin/bash
test -z "$2" && exit
FILE=$(unrar vb "$1/*")
case $(echo "$FILE" | wc -l) in
1)
   yes no | nice -n 15 unrar e -r "$1/*" "$2"
   mv -f "$2/${FILE##*/}" "$2/${1##*/}.${FILE##*.}"
;;
*)
   yes no | nice -n 15 unrar x -r "$1/*" "$2"
;;
esac >&- 2>&- &
Finns det någon supersnäll person som kan fixa det?

MVH
Limpan111
Dexxa
Inlägg: 226
Blev medlem: 12 aug 2006, 19:46
OS: Crunchbang

Re: rtorrent unrar automatiskt?

Inlägg av Dexxa »

webaake skrev:För att försöka sammanfatta för den som bara vill flytta filer från en mapp till en annan och sedan packa upp dem i den mapp mapp de är;

Detta script körde jag i filen /usr/local/bin/unpack_rar.sh

Kod: Markera allt

#!/bin/sh
LOG="/dev/null"

find "$1" -iregex '.*\.rar' -and -not -iregex '.*\.part[0-9]+.rar' \
   -or -iregex '.*\.part0*1\.rar' \
| while read RAR
do (
   cd "${RAR%/*}"
   unrar x -r "${RAR##*/}"
) done >>"$LOG"
Gjorde sudo chmod +x på det. (sudo chmod +x /usr/local/bin/unpack_rar.sh)

Sedan ändrade jag i .rtorrent.rc sålunda;
svn version 1072 och kanske också version 0.8.3;

Kod: Markera allt

system.method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,/media/files/ ;d.set_directory=/media/files/ ;execute=/usr/local/bin/unpack_rar.sh,$d.get_base_path="
För äldre versioner av rtorrent typ 0.8.2 samt svn upp till version 1071(?);

Kod: Markera allt

on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,/media/files/ ;d.set_directory=/media/files/ ;execute=/usr/local/bin/unpack_rar.sh,$d.get_base_path="
I mitt fall laddas torrenterna alltså till en mapp, när de är färdiga flyttas de till mappen /media/files. Byt så det passar dig.

Detta kanske kan tilläggas en eventuell wiki? Skall jag komplettera med nåt?

EDIT: PS jag har helt ärligt snott allt från Konservburk(=trollkarlen?), djkmmo och abandonow. Tack till dem!!!
Har följt din lilla sammanfattning, men får det inte att funka. använder 0.8.2. Får inte direkt något felmeddelande, utan det funkar inte bara.
hannes8k
Inlägg: 12
Blev medlem: 05 jun 2009, 11:22
OS: Ubuntu
Utgåva: 16.04 Xenial Xerus LTS

Re: rtorrent unrar automatiskt?

Inlägg av hannes8k »

Jag har fått næstan allt att fungera tack vare config från tigertailz. En sista sak jag undrar ær hur jag får mina downloads att hamna i egendefinerade mapper nær dom ær complete. Nu laddar den hem allt direkt till min egendefinerade mapp Vill alltså ha en incomplete och sedan flyttas de till t ex hdfilm/hdtv. Såhær ser min config ut:

Kod: Markera allt

# Maximum and minimum number of peers to connect to per torrent.
min_peers = 40
max_peers = 100

# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 10
max_peers_seed = 50

# Maximum number of simultanious uploads per torrent.
max_uploads = 15

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 1900
upload_rate = 140

# Default directory to save the downloaded torrents.
directory =/home/user/torrents/downloads/

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/user/torrents/sessions

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/home/user/torrents/torrentfiles//*.torrent
schedule = untied_directory,5,5,stop_untied=

#Multiple watch folders
schedule = A,1,5,"load_start=/home/user/torrents/torrentfiles/hdfilm/*.torrent,d.set_directory=/home/user/torrents/downloads/hdfilm/,d.set_cus$
schedule = B,1,5,"load_start=/home/user/torrents/torrentfiles/hdtv/*.torrent,d.set_directory=/home/user/torrents/downloads/hdtv/,d.set_custom1$
schedule = C,1,5,"load_start=/home/user/torrents/torrentfiles/music/*.torrent,d.set_directory=/home/user/torrents/downloads/music/,d.set_custo$
schedule = D,1,5,"load_start=/home/user/torrents/torrentfiles/sd/*.torrent,d.set_directory=/home/user/torrents/downloads/sd/,d.set_custom1=/ho$
schedule = E,1,5,"load_start=/home/user/torrents/torrentfiles/games/*.torrent,d.set_directory=/home/user/torrents/downloads/games/,d.set_custo$
#Series custom path:
#schedule =I,1,5,"load_start=/download/TV/serie1/*.torrent,d.set_directory=/download/TV/Serie1/,d.set_custom1=/arkiv/Serier/Serie1.S01.720p.HDTV.X264/"
#schedule =J,1,5,"load_start=/download/TV/serie2/*.torrent,d.set_directory=/download/TV/Serie2/,d.set_custom1=/arkiv/Serier/serie2.S02.720p.HDTV.X264/"
#schedule =K,1,5,"load_start=/download/TV/serie3/*.torrent,d.set_directory=/download/TV/Serie3/,d.set_custom1=/arkiv/Serier/Serie3.S03.720p.HDTV.X264/"
#(osv...)

#Extract rar and move
system.method.set_key = event.download.finished,unpack_rar,"execute=/home/user/programs/unpackrar.sh,$d.get_base_path=,$d.get_custom1="

# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=100M

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,"stop_on_ratio=200,200M,2000"


# Port range to use for listening.
port_range = 55500-55555

# Start opening ports at a random position within the port range.
#port_random = no

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
check_hash = yes

# Set whetever the client should try to connect to UDP trackers.
#use_udp_trackers = yes

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,enable_retry,prefer_plaintext

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
# dht = auto

# UDP port to use for DHT.
#
# dht_port = 6881

# Enable peer exchange (for torrents not marked private)
#
# peer_exchange = yes

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10
hash_read_ahead = 8

# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 10

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 5
hannes8k
Inlägg: 12
Blev medlem: 05 jun 2009, 11:22
OS: Ubuntu
Utgåva: 16.04 Xenial Xerus LTS

Re: rtorrent unrar automatiskt?

Inlägg av hannes8k »

Detta har jag nu løst :) Sista problemet ær att jag undrar hur jag gør med unrarcriptet før att mapparna ska behållas, nær jag laddar hem filmer till t ex mappen hdtv så packas mkv filen upp och lægger sig direkt i hdtv, inte i underkategorin som mappen/filen heter, dvs dær rar-filerna ligger. Anvænder också

Kod: Markera allt

#!/bin/sh
LOG="/dev/null"

find "$1" -iregex '.*\.rar' -and -not -iregex '.*\.part[0-9]+.rar' \
   -or -iregex '.*\.part0*1\.rar' \
| while read RAR
do (
   cd "${RAR%/*}"
   unrar x -r "${RAR##*/}"
) done >>"$LOG"
felldin
Inlägg: 5
Blev medlem: 14 okt 2008, 15:36
OS: Ubuntu
Utgåva: 12.04 Precise Pangolin LTS

Re: rtorrent unrar automatiskt?

Inlägg av felldin »

Behöver lite hjälp med att få detta att fungera. Det jag vill åstadkomma är att när en torrent är färdigladdad så ska hela nedladdade mappen kopieras till ny mapp. Där ska sedan rar-filer extraheras och till slut ska rar-filerna raderas. Till slut ska alltså nedladdade filer ligga orörda. Dessutom vill jag ha en kopia på samtliga filer samt uppackade rar-filer i en annan mapp.

Mitt skript ser ut så här:

Kod: Markera allt

#!/bin/sh
LOG="/dev/null"

cp -R -u "$1" "$2"

find "$2" -iregex '.*\.rar' -and -not -iregex '.*\.part[0-9]+.rar' \
   -or -iregex '.*\.part0*1\.rar' \
| while read RAR
do (
   cd "${RAR%/*}"
   unrar x "${RAR##*/}"
) done >>"$LOG"
Det denna kod gör är att kopiera alla filer samt packa upp alla rar-filer men hur gör jag för att sedan ta bort alla rar-filer i mappen som jag kopierat allt till?

Tänkte köra med följade i min rtorrent.rc:

Kod: Markera allt

schedule = A,5,5,"load_start=/home/felldin/torrents/torrentfiles/dvdr/*.torrent,d.set_directory=/home/felldin/torrents/download/dvdr,d.set_custom1=/home/felldin/torrents/torrentfiles/movies/"
schedule = B,5,5,"load_start=/home/felldin/torrents/torrentfiles/audiobook/*.torrent,d.set_directory=/home/felldin/torrents/download/audiobook"

system.method.set_key = event.download.finished,unpack_rar,"execute=/usr/local/bin/unpack_rar.sh,$d.get_base_path=,$d.get_custom1="
Ser detta bra ut eller är jag helt ute och cyklar?
Användarvisningsbild
allwise
Inlägg: 9
Blev medlem: 14 sep 2008, 12:37
OS: Ubuntu
Utgåva: 18.04 Bionic Beaver LTS

Re: rtorrent unrar automatiskt?

Inlägg av allwise »

Hejsan!

Jag har tidigare kört rTorrent och lyckats flytta färdiga filer till download/done och därefter kontrollera sfv för dem och till sist packa upp dem. Nu har jag uppdaterat rTorrent och functionen on_finished är som bekant "depricated". Jag har försökt i 2 timmar att få det att fungera nu, men jag lyckas verkligen inte. Jag har provat att ta bort allt med uppackning och bara göra en flyttning, men inte heller det lyckas. "Bad return code" får jag som var i rTorrent.

Nedan är min rtorrent.rc. Det vore väldigt snällt om någon kunde hjälpa mig att få nya synvinklar på vad som kan vara fel. Det känns som att det inte spelar någon roll vad som står i system.method.set_key. Kan jag ha missat något enkelt? Mitt script fungerar för sig.

Kod: Markera allt

# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.

# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
#max_peers = 100

# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 50

# Maximum number of simultanious uploads per torrent.
max_uploads = 15

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 1500
upload_rate = 800

# Default directory to save the downloaded torrents.
directory = /home/filserver/download/

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/allwise/.rtorrent/session/

# Watch a directory for new torrents, and stop those that have been
# deleted.
#schedule = watch_directory,5,5,load_start=./watch/*.torrent
#schedule = untied_directory,5,5,stop_untied=

# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=100M

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,"stop_on_ratio=200,200M,2000"

# The ip address reported to the tracker.
#ip = 127.0.0.1
#ip = rakshasa.no

# The ip address the listening socket and outgoing connections is
# bound to.
#bind = 127.0.0.1
#bind = rakshasa.no

# Port range to use for listening.
port_range = 6890-6999

# Start opening ports at a random position within the port range.
#port_random = no

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
#check_hash = no

# Set whetever the client should try to connect to UDP trackers.
#use_udp_trackers = yes

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
# encryption = allow_incoming,enable_retry,prefer_plaintext

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
# 
# dht = auto

# UDP port to use for DHT. 
# 
#dht_port = 6881

# Enable peer exchange (for torrents not marked private)
#
peer_exchange = yes

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10

# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 100

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 10

# Add new views. You may find out what downloads they contain through
# 'ui.current_view.set=group_1' command or XMLRPC calls.
view_add = view_group_1

# Make the views persist across sessions.
view.persistent = view_group_1

# Create new groups, 'group.insert = <name>, <view>'.
group.insert = group_1, view_group_1

group.group_1.ratio.enable=
group.group_1.ratio.min.set=100
group.group_1.ratio.max.set=300
group.group_1.ratio.upload.set=20M 

# Downloads need to be inserted into the view with the 'view.set_visible'
# command. Note that extra parameters to 'load' are commands called
# with the newly created download as the target.
schedule = watch_directory_1,5,10,"load_start_verbose=/home/filserver/download/torrents/*.torrent, view.set_visible=view_group_1"

#Gammal on_unfinished
#on_finished = move_and_unrar,"execute=mv,-u,$d.get_base_path=,/home/filserver/download/done ;d.set_directory=/home/filserver/download/done/ ;execute=/usr/bin/raraupp,$d.get_base_path="
#system.method.set_key = event.download.finished,move_and_unrar,"execute=mv,-u,$d.get_base_path=,/home/filserver/download/done ;d.set_directory=/home/filserver/download/done/;execute=/usr/bin/raraupp,$d.get_base_path="
#Test 2
system.method.set_key = event.download.finished,unpack_rar,"execute=mv,-u,$d.get_base_path=,/home/filserver/download/done"
EDIT: Någon som har en länk till en uppdaterad exempelfil för .rtorrent.rc ? Alltså en som använder de nya system.method.set_key m.m. Detta skulle förhoppningsvis också hjälpa mig.
Användarvisningsbild
allwise
Inlägg: 9
Blev medlem: 14 sep 2008, 12:37
OS: Ubuntu
Utgåva: 18.04 Bionic Beaver LTS

Re: rtorrent unrar automatiskt?

Inlägg av allwise »

BUMP!

Snälla, kan någon skicka en exempelfil på .rctorrent.rc med nya upplägget? Det vore väldigt uppskattat!
abandonow
Inlägg: 22
Blev medlem: 09 okt 2008, 00:59
OS: Xubuntu
Utgåva: 14.04 Trusty Tahr LTS

Re: rtorrent unrar automatiskt?

Inlägg av abandonow »

Kod: Markera allt

#scgiport for wtorrent.
scgi_port = localhost:5000

#Max memory usage
max_memory_usage = 2147483648

# Maximum and minimum number of peers to connect to per torrent.
min_peers = 40
max_peers = 100

# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 10
max_peers_seed = 50

# Maximum number of simultanious uploads per torrent.
max_uploads = 15

#max download slots global
#max_downloads_global = 3

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 1450
upload_rate = 125

# Default directory to save the downloaded torrents.
directory =/download 

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/<brukernavn>/.rsession

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/download/*.torrent
schedule = untied_directory,5,5,stop_untied=

#Multiple watch folders
schedule = A,1,5,"load_start=/download/TV/*.torrent,d.set_directory=/download/TV/,d.set_custom1=/arkiv/Serier/"
schedule = B,1,5,"load_start=/download/Films/*.torrent,d.set_directory=/download/Films/,d.set_custom1=/arkiv/Filmer/"
schedule = C,1,5,"load_start=/download/Music/*.torrent,d.set_directory=/download/Music/"
schedule = D,1,5,"load_start=/download/Games/*.torrent,d.set_directory=/download/Games/"
schedule = E,1,5,"load_start=/download/Software/*.torrent,d.set_directory=/download/Software/"
schedule = F,1,5,"load_start=/download/Annet/*.torrent,d.set_directory=/download/Annet/"
schedule = G,1,5,"load_start=/download/PDF/*.torrent,d.set_directory=/download/PDF/"
schedule = H,1,5,"load_start=/download/Fonts/*.torrent,d.set_directory=/download/Fonts/"

#Series custom path:
schedule = I,1,5,"load_start=/download/TV/serie1/*.torrent,d.set_directory=/download/TV/serie1/,d.set_custom1=/arkiv/Serier/serie1.720p.HDTV.X264/"
schedule = J,1,5,"load_start=/download/TV/serie2/*.torrent,d.set_directory=/download/TV/serie2/,d.set_custom1=/arkiv/Serier/serie2.720p.HDTV.X264/"
schedule = K,1,5,"load_start=/download/TV/serie3/*.torrent,d.set_directory=/download/TV/serie3/,d.set_custom1=/arkiv/Serier/serie3.720p.HDTV.X264/"
OSV..

#Extract rar and move
system.method.set_key = event.download.finished,unpack_rar,"execute=/home/<brukernavn>/bin/unpackrar.sh,$d.get_base_path=,$d.get_custom1="

# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=100M

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,"stop_on_ratio=200,200M,2000"

# The ip address reported to the tracker.
#ip = 127.0.0.1
#ip = rakshasa.no

# The ip address the listening socket and outgoing connections is
# bound to.
#bind = 127.0.0.1
#bind = rakshasa.no

# Port range to use for listening.
port_range = 55500-55555

# Start opening ports at a random position within the port range.
#port_random = no

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
check_hash = yes

# Set whetever the client should try to connect to UDP trackers.
#use_udp_trackers = yes

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,enable_retry,prefer_plaintext

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
# 
# dht = auto

# UDP port to use for DHT. 
# 
# dht_port = 6881

# Enable peer exchange (for torrents not marked private)
#
# peer_exchange = yes

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10
hash_read_ahead = 8

# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 10

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 5

#throttle
#throttle = 10,10
#throttle = 20,20
#throttle = 30,30
#throttle = 40,40
#throttle = 50,50
#throttle = 60,60
#throttle = 70,70
#throttle = 80,80
#throttle = 90,90
Skriv svar

Återgå till "Terminalforum"