Discussion:
[libtorrent] [Python] incomplete and complete path
Mircea Stanciu
2016-09-05 08:01:48 UTC
Permalink
I've seen a few examples, but written for C++.

Assuming a folder where i keep my .torrent folders: "/home/torrents"

Now when a session is started the goal is to loop trough all the torrent
from the "torrents" folder and start downloading in "/home/incomplete"
folder. After completion the program should move the completed files to
"/home/completed".

I could move them from python or using linux "cp from to" command, but
this will remove the file from seeding, and when a new session is
started the file will be downloaded again.
Are there any settings that can help me achieve my goal? (similar to
save_path setting in libtorrent.add_magnet_uri(ses, link, save_path))

Kind regards,
Mircea

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


------------------------------------------------------------------------------
Arvid Norberg
2016-09-05 21:20:42 UTC
Permalink
Post by Mircea Stanciu
I've seen a few examples, but written for C++.
Assuming a folder where i keep my .torrent folders: "/home/torrents"
Now when a session is started the goal is to loop trough all the torrent
from the "torrents" folder and start downloading in "/home/incomplete"
folder. After completion the program should move the completed files to
"/home/completed".
files should not be move as they are completed, but only when you shut down
your program?
Post by Mircea Stanciu
I could move them from python or using linux "cp from to" command, but
this will remove the file from seeding, and when a new session is
started the file will be downloaded again.
Are there any settings that can help me achieve my goal? (similar to
save_path setting in libtorrent.add_magnet_uri(ses, link, save_path))
It sounds like you're looking for torrent_handle::move_storage(). This
moves the files belonging to a torrent from one save path to another. It
does so synchronized with the libtorrent subsystem, to allow uninterrupted
seeding or downloading.

To know when a torrent completes, you can look for the
torrent_finished_alert (although, I don't think you'll get that if you load
a torrent that's already finished when you start up).

If you want to load torrents back up again, and seed/download from the
right location, you can save resume data, and load it again. The save path
is stored in there.
--
Arvid Norberg
------------------------------------------------------------------------------
Loading...