Comments (6)
This is already possible with the load commands, just append any commands to call;
load_start="foo.torrent",print=$d.hash
from rtorrent.
@rakshasa: Beautiful, thanks :) I've traced around the source a bit but I can't figure out how rtorrent expects the example call you gave in xml. I am taking a look at rpc/parse_command.cc at the moment. Before, I saw in command_events.cc that apply_load
takes the first argument as the torrent's path, and subsequent arguments as 'commands'. What I can't seem to figure out is how rtorrent expects those commands to be written. I have tried, for example, this:
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>load</methodName>
<params>
<param><value><string>thetorrent.torrent</string></value></param>
<param><value><string>print=$d.get_hash</string></value></param>
</params>
</methodCall>
The torrent loads (shows up in rtorrent), but rtorrent tells me Command on torrent creation failed: Could not find '='.
, the error message issued in parse_command.cc
, so I'm clearly not forming my xmlrpc method call's extra commands correctly. Unfortunately my C++ expertise isn't quite at your level to make sense of the command parser. I will keep trying to figure it out, though I would surely appreciate any further help you can give.
I just came across this thread on the old issue tracker that helps a lot with other questions, but unfortunately doesn't go into the way the xml should be formed.
from rtorrent.
Should be 'print=$d.get_hash=' as there's a second command embedded.
from rtorrent.
@rakshasa: Wow! Indeed, I can't believe I kept trying and spending all that time for such a minor mistake that I should know by now. I guess it's time to take a break. Once again, thanks for your time in helping me with such a petty issue, who knows how much longer I would've spent trying this.
Just fixed that typo and indeed everything works beautifully. Now I can encapsulate all of the necessary logic into one call and rtorrent will automatically take care of calling it once the asynchronous torrent loading is done. Nice :)
Keep up the awesome work.
from rtorrent.
@rakshasa: Just a quick question, is there a difference between calling load
and load_start
aside from (my impression that) rtorrent starts the torrent once it's loaded with load_start
? I tried doing load
with extra calls as detailed in this issue. For example, a d.set_directory
which did work (showed up in rtorrent to the directory I set), but I also wanted to finish off the extra commands with a d.start=
to start the torrent, but it didn't seem to have any effect. I think I saw in the view that it was closed, inactive, so I did a d.open=
before the start and the interesting thing is that the torrent then does show up as [OPEN], but still inactive. I thought maybe it was a bug that prevented the last command from being executed, but adding an extra d.start=
at the end had no effect.
For the bigger picture:
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>load</methodName>
<params>
<param><value><string>thetorrent.torrent</string></value></param>
<param><value><string>d.set_directory=/some/dir</string></value></param>
<param><value><string>d.open=</string></value></param>
<param><value><string>d.start=</string></value></param>
</params>
</methodCall>
I do notice that the way core/download_factory.cc
does it is by doing d.state.set
with a parameter of 1, but is this only an internal command? Because I don't see it with system.listMethods
. I kind of figured those mapped to d.start
et al.
Would appreciate your insight. Thanks!
from rtorrent.
The download factory does some black magic (read; hacks that need to be cleaned up) in order to start the torrent, and as such use load_start and not d.start.
The d.state.set command is internal, and should not be called by the user at all.
from rtorrent.
Related Issues (20)
- 200% complete HOT 1
- Can't add RSS feeds due to 1 feed being glitch HOT 3
- `f.path=` return invalide string name if it contain emoji HOT 2
- "http_proxy" setting doesn't work in linux HOT 1
- rTorrent user can't access 'id' and 'stat' program. Some functionality will be unavailable. HOT 1
- Documentation on systemd service HOT 2
- Optimization opportunity for hash checks of partially downloaded files
- Better way to organize torrents in the main view, e.g. by label or watch/download directory HOT 5
- freezes 20+ torrents, tracker related HOT 1
- Error in VPN-with-Traffic-Splitting wiki HOT 1
- Periodic peer disconnect and idling data transfer intervals HOT 3
- error with config after update HOT 2
- Crash Error: Success Signal code '2': Non-existent physical address. HOT 1
- Build fails with LTO HOT 8
- what process should I do on Debian 11? HOT 1
- [Bug Report] [Failure reason \"This client is not allowed...] HOT 3
- Zero peer/seeds after restart HOT 1
- Ratio Groups - seed time - discrepancy between rTor and tracker
- A new release? HOT 3
- Actual up to date build instrunctions, please?? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtorrent.