Libtorrent. Answer some questions

243 Views Asked by At

To begin with, English is not my native language, so it's hard for me to read the libtorrent documentation and all this question has been translated. I ask you to answer these questions, if you know any of them, answer only him. I am using libtorrent 2.0.7 and Python 3.8 It is not necessary to answer questions in python, I will try to figure it out even if you answer in c++

  1. At the moment when the torrent is not loaded yet. How do I get all the files to be uploaded? At the moment when the torrent is loaded. How do I get the path to the files that were uploaded? (I found a similar question, but its answer stopped working because of deprecated)

  2. I'm trying to use

handle.get_torrent_info() 

to answer point 1, but returns

DeprecationWarning: get_torrent_info() is deprecated

I tried to look in the source file, but it doesn't say what to use instead of this function. Do you know?

  1. I would like to set a download speed limit for the entire session. To do this, I found
session.download_rate_limit() 

in its parameters , but when using it, it returns

DeprecationWarning: download_rate_limit() is deprecated.

I also tried to look in the documentation, but I didn't find it. I also didn't figure out what parameters it accepts, I tried int, but it returned an error. As in point 2, it is not written what to use instead of the outdated function. Do you know?

  1. I would like the session to download only 1 torrent at a time, and the rest queued in the order of enabling the download from the pause state. How to do this, I do not know at all. Help please
1

There are 1 best solutions below

0
Wintreist On

I found the answer to the 1st and 2nd question:

test = handle.status()
for i in range(test.torrent_file.files().num_files()):
    print(test.torrent_file.files().file_path(i))