deluge.core.torrent

Internal Torrent class

class deluge.core.torrent.Torrent(handle, options, state=None, filename=None, magnet=None)

Bases: object

Torrent holds information about torrents added to the libtorrent session.

apply_options()
Applies the per-torrent options that are set.
cleanup_prev_status()
This method gets called to check the validity of the keys in the prev_status dict. If the key is no longer valid, the dict will be deleted.
connect_peer(ip, port)
adds manual peer
delete_torrentfile()
Deletes the .torrent file in the state
force_reannounce()
Force a tracker reannounce
force_recheck()
Forces a recheck of the torrents pieces
get_eta()
Returns the ETA in seconds for this torrent
get_file_progress()
Returns the file progress as a list of floats.. 0.0 -> 1.0
get_files()
Returns a list of files this torrent contains
get_options()
get_peers()
Returns a list of peers and various information about them
get_queue_position()
Returns the torrents queue position
get_ratio()
Returns the ratio for this torrent
get_status(keys, diff=False)

Returns the status of the torrent based on the keys provided

Parameters:
  • keys (list of str) – the keys to get the status on
  • diff – if True, will return a diff of the changes since the last

call to get_status based on the session_id :type diff: bool

Returns:a dictionary of the status keys and their values
Return type:dict
get_tracker_host()
Returns just the hostname of the currently connected tracker if no tracker is connected, it uses the 1st tracker.
move_storage(dest)
Move a torrent’s storage location
pause()
Pause this torrent
rename_files(filenames)
Renames files in the torrent. ‘filenames’ should be a list of (index, filename) pairs.
rename_folder(folder, new_folder)
Renames a folder within a torrent. This basically does a file rename on all of the folders children.
resume()
Resumes this torrent
save_resume_data()
Signals libtorrent to build resume data for this torrent, it gets returned in a libtorrent alert
scrape_tracker()
Scrape the tracker
set_auto_managed(auto_managed)
set_file_priorities(file_priorities)
set_max_connections(max_connections)
set_max_download_speed(m_down_speed)
set_max_upload_slots(max_slots)
set_max_upload_speed(m_up_speed)
set_move_completed(move_completed)
set_move_completed_path(move_completed_path)
set_options(options)
set_prioritize_first_last(prioritize)
set_remove_at_ratio(remove_at_ratio)
set_save_path(save_path)
set_state(state)
Accepts state strings, ie, “Paused”, “Seeding”, etc.
set_status_message(message)
set_stop_at_ratio(stop_at_ratio)
set_stop_ratio(stop_ratio)
set_tracker_status(status)
Sets the tracker status
set_trackers(trackers)
Sets trackers
update_state()
Updates the state based on what libtorrent’s state for the torrent is
write_torrentfile()
Writes the torrent file
class deluge.core.torrent.TorrentOptions
Bases: dict

Previous topic

deluge.core.rpcserver

Next topic

deluge.core.torrentmanager

This Page