Re: [libtorrent] [Python] incomplete and complete path
Brought to you by:
arvidn
|
From: Arvid N. <arv...@gm...> - 2016-09-05 21:20:48
|
On Mon, Sep 5, 2016 at 4:01 AM, Mircea Stanciu <mi...@ic...> wrote: > 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? > 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 |