Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom method.set_key = event.download.finished not running #191

Open
natloh opened this issue Dec 12, 2022 · 9 comments
Open

Custom method.set_key = event.download.finished not running #191

natloh opened this issue Dec 12, 2022 · 9 comments

Comments

@natloh
Copy link

natloh commented Dec 12, 2022

I am trying to run a script when torrents finish to tell sickchill that it's time to post process a download. I can't seem to edit the method.set_key = event.download.finished to trigger a custom script.

Is there any way to test this? I've been editing the .rtorrent.rc file and re-deploying the docker container with the new config but I am not seeing anything happen.

This is what is in my .rtorrent.rc

method.set_key = event.download.finished,TorrentToMedia,"execute=/usr/bin/python3,/data/rtorrent/scripts/nzbToMedia-master/TorrentToMedia.py,$d.base_path=,$d.name=,$d.custom1=,$d.hash="

@crazy-max
Copy link
Owner

crazy-max commented Dec 30, 2022

This is what is in my .rtorrent.rc

This is your full .rtorrent.rc file content?

Any logs?

@HuwSy
Copy link

HuwSy commented Feb 12, 2023

Hi

I’m having the same issue with both :latest and :edge

My .rtorrent.rc within the volume that resolves to /data/rtorrent/ is as follows, mostly the default until the last few lines and some bits disabled

throttle.min_peers.normal.set = 1
throttle.max_peers.normal.set = 100

# Same as above but for seeding completed torrents (-1 = same as downloading)
throttle.min_peers.seed.set = 1
throttle.max_peers.seed.set = 50

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

# Global upload and download rate in KiB. "0" for unlimited
throttle.global_down.max_rate.set_kb = 0
throttle.global_up.max_rate.set_kb = 0

# 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)
#dht.mode.set = auto

# Enable peer exchange (for torrents not marked private)
protocol.pex.set = yes

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

# Set whether the client should try to connect to UDP trackers
#trackers.use_udp.set = yes

# Set the max amount of memory address space used to mapping file chunks. This refers to memory mapping, not
# physical memory allocation. Default: 1GB (max_memory_usage)
# This may also be set using ulimit -m where 3/4 will be allocated to file chunks
#pieces.memory.max.set = 1GB

# Alternative calls to bind and ip that should handle dynamic ip's
#schedule2 = ip_tick,0,1800,ip=rakshasa
#schedule2 = 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
protocol.encryption.set = allow_incoming,try_outgoing,enable_retry

# Set the umask for this process, which is applied to all files created by the program
system.umask.set = 0022

# Add a preferred filename encoding to the list
encoding.add = UTF-8

# Watch a directory for new torrents, and stop those that have been deleted
#schedule2 = watch_directory, 1, 1, (cat,"load.start=",(cfg.watch),"*.torrent")
#schedule2 = untied_directory, 5, 5, (cat,"stop_untied=",(cfg.watch),"*.torrent")

# Close torrents when diskspace is low
schedule2 = monitor_diskspace, 15, 60, ((close_low_diskspace,1000M))

# Move finished (no need Autotools/Automove plugin on ruTorrent)
#method.insert = d.get_finished_dir, simple, "cat=$cfg.download_complete=,$d.custom1="
#method.insert = d.move_to_complete, simple, "d.directory.set=$argument.1=; execute=mkdir,-p,$argument.1=; execute=mv,-u,$argument.0=,$argument.1=; d.save_full_session="
#method.set_key = event.download.finished,move_complete,"d.move_to_complete=$d.data_path=,$d.get_finished_dir="
method.set_key = event.download.finished, "execute2={ls -Al /data/,>,/data/test.log}"

# Erase data when torrent deleted (no need erasedata plugin on ruTorrent)
method.set_key = event.download.erased,delete_erased,"execute=rm,-rf,--,$d.data_path="

dht.mode.set = on
trackers.use_udp.set = yes
ratio.enable=
ratio.min.set=200
ratio.max.set=500
ratio.upload.set=1024M
method.set = group.seeding.ratio.command, "d.close= ; execute2={sh,/data/.rtorrent.sh,$d.base_path=,$d.custom1=,$d.is_multi_file=} ; d.erase="

This works on a directly installed, non docker, rtorrent in this way, it needs the ratio parts for the script from what I can tell. If I connect into the docker container the file is definitely at that path and does run manually

All I get in rtorrent logs is this

1675288745 N rtorrent main: Starting thread.
1675408368 N rtorrent scgi: Shutting down thread.
1675408368 N rtorrent main: Shutting down thread.
1675408368 N rtorrent disk: Shutting down thread.

Do you need anything else?

Thanks

updated to correct multi line code block

@simonc56
Copy link

@HuwSy
Multiline code must be between 3 backticks ```
Select all lines, then click Add code button.

@HuwSy
Copy link

HuwSy commented Feb 12, 2023

@HuwSy
Multiline code must be between 3 backticks ```
Select all lines, then click Add code button.

Thanks. Fixed that now and learnt something new :)

@simonc56
Copy link

I've been editing the .rtorrent.rc file and re-deploying the docker container with the new config but I am not seeing anything happen.

This is what is in my .rtorrent.rc

method.set_key = event.download.finished,TorrentToMedia,"execute=/usr/bin/python3,/data/rtorrent/scripts/nzbToMedia-master/TorrentToMedia.py,$d.base_path=,$d.name=,$d.custom1=,$d.hash="

Change execute to execute2 as said here : rakshasa/rtorrent#242

@simonc56
Copy link

@HuwSy

method.set_key = event.download.finished, "execute2={ls -Al /data/,>,/data/test.log}"

You didn't write the key. See your previous line has a key named move_complete

rtorrent doc states :
method.set_key = ‹name›, ‹key›[, ‹definition›] 0

@HuwSy
Copy link

HuwSy commented Feb 13, 2023

@HuwSy

method.set_key = event.download.finished, "execute2={ls -Al /data/,>,/data/test.log}"

You didn't write the key. See your previous line has a key named move_complete

rtorrent doc states : method.set_key = ‹name›, ‹key›[, ‹definition›] 0

Mine turns out to be my own fault. I had been locking down permissions and impacted my config directory. The give away should have been my logs never changing but I didn’t even notice they were stuck until I looked at the dates.

Oddly method.set = , for the option I have here works. No idea why or even where I copied this approach from but that’s not for here.

@rachffus
Copy link

rachffus commented Apr 4, 2024

Hi, also have this issue.
method.set_key = event.download.paused, test, "execute={echo $d.name= > /data/log.txt}"

 echo $d.name= > /data/log.txt
---
 
--- Error ---

@simonc56
Copy link

Have you read the thread ?
Hint : #191 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants