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

Script doesn't execute. Torrents never get labeled as "Finished". #473

Closed
nicissimo97 opened this issue Aug 1, 2016 · 13 comments
Closed

Comments

@nicissimo97
Copy link

Hi,

I'm trying to run a script whenever a torrent finishes, the problem is that the torrents never get labeled as "finished" so the event "event.download.finished" never occurs.
system.method.set_key = event.download.finished,fileprocessing,"execute=/media/sdah1/nicissimo97/private/rtorrent/file_processing.sh,$d.get_base_path=,$d.get_name="

cattura_censored

Running: 0.9.6
What am i doing wrong?

@rakshasa
Copy link
Owner

rakshasa commented Aug 2, 2016

Some command aliases have been deprecated for a long time, so check src/main.cc and src/command_*.cc for the correct command names for "$d.get_base_path=,$d.get_name=".

There's also a wiki page for deprecated command names.

@rakshasa rakshasa closed this as completed Aug 2, 2016
@rakshasa
Copy link
Owner

rakshasa commented Aug 2, 2016

@nicissimo97
Copy link
Author

Thanks for your reply, rakshasa.
If i understood everything correctly, it becomes:
method.set_key = event.download.finished,fileprocessing,"execute=/media/sdah1/nicissimo97/private/rtorrent/file_processing.sh,$d.base_path=,$d.base_filename="

Still. the script never gets executed because the torrents never get labeled as "finished", at least that is what i think, correct me if i'm wrong.

Thanks.
-Nico-

@chros73
Copy link
Contributor

chros73 commented Aug 2, 2016

Well, the syntax looks good, but (because there's always a but :) ) :

A. $d.base_path=,$d.base_filename= these can be empty sometimes, see: #48

B. you can check if the finished event triggered by:

  • method.set_key = event.download.finished, finished_try, "print=finished-triggered!"
  • you should see finished-triggered! message in rtorrent when it happens

@nicissimo97
Copy link
Author

nicissimo97 commented Aug 2, 2016

I added the 2 methods to my configuration file, and now it seems to work just fine!

Thank you very much, mate!

@nicissimo97
Copy link
Author

Ok, it worked for 35 minutes :)

Now i get: Event 'event.download.finished' failed: Bad return code.

@chros73
Copy link
Contributor

chros73 commented Aug 3, 2016

That error probably is a syntax error, that suggest it never worked.
What do you want to achieve?
What is the relevant part of the config?

@nicissimo97
Copy link
Author

It worked for a while, as you can see:
cattura_censored 1

The script is currently a work in progress, it just create a text file with the two variable (i'm using it for testing)

Here's the config:

method.insert = d.get_data_full_path, simple, "branch=((d.is_multi_file)),((cat,(d.directory))),((cat,(d.directory),/,(d.name)))"

method.set_key = event.download.finished,fileprocessing,"execute=/media/sdah1/nicissimo97/private/rtorrent/ridotti/file_processing.sh,$d.base_path=,$d.base_filename="

method.set_key = event.download.finished, finished_try, "print=finished-triggered!"

@chros73
Copy link
Contributor

chros73 commented Aug 3, 2016

you need this method in your config and pass that to the script:

You missed the 2nd part of that. :)
So, the correct way would be (after modifying the script as well):

method.set_key = event.download.finished,fileprocessing,"execute=/media/sdah1/nicissimo97/private/rtorrent/ridotti/file_processing.sh,$d.get_data_full_path="

Once it works then you can remove the finished_try trigger line.

@nicissimo97
Copy link
Author

nicissimo97 commented Aug 3, 2016

It seems to work now, thanks 👍

Even if with my luck in a couple of days it will stop working

Let's say i want to pass to the script some other information, do i have to create something like that string you gave me and then pass the method to the script ?

@nicissimo97
Copy link
Author

nicissimo97 commented Aug 3, 2016

Ok, the "finished" event works fine, but the script doesn't run.
Which is weird, cause it worked before.
EIDT: Solved

@rakshasa
Copy link
Owner

rakshasa commented Aug 5, 2016

https://github.com/rakshasa/rtorrent/wiki/LOG-Logging

There's a logging option that lets you see both the command executed and the raw binary output. When dealing with scripts not working that is what you should look at first, before making tickets and such.

@rakshasa
Copy link
Owner

rakshasa commented Aug 5, 2016

Which someone really should write up in the wiki or something.

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

3 participants