Python libtorrent, get file list names

MagiciaN

I am using libtorrent for python 3.6 . I just want to get any file names that downloaded with a session, e.g. the folder name, the files name etc. I searched around the web didn't come across anything. I am using the follow example:

https://www.libtorrent.org/python_binding.html

So when the download progress finish, i want to know what files this session downloaded. How can achieve that? Thanks in advance!

MagiciaN

Finally found the answer, the code is:

handle = libtorrent.add_magnet_uri(session, magnetLink,params)

    session.start_dht()                

    while not handle.has_metadata():
        time.sleep(1)          

    torinfo = handle.get_torrent_info()

    for x in range(torinfo.files().num_files()):
        print(torinfo.files().file_path(x))

The code above prints the file names that came with the magnet file.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

python libtorrent How I get file list of torrent from info_hash?

From Dev

Get a list of file names from HDFS using python

From Dev

Python libtorrent

From Dev

get function names from a list python

From Dev

libtorrent-python problems, "no such file or directory" when there clearly is

From Dev

Get list of all NDB model names ( class names ) in GAE Python

From Dev

Get file names of tarred folder contents in Python

From Dev

Python, string slicing (getting file names from a list of file locations)

From Dev

get animal names from text file into List Of String

From Dev

How to get list of file names from a private remote ip

From Dev

get list of file names and store them in array on linux using C

From Dev

How to get list of file names and their sentence containing a specific search string?

From Dev

Get list of file names in folder/directory with Excel VBA

From Dev

Bat file list file names

From Dev

File Revision List File Names?

From Dev

Python: Group a list of file names according to common name identifier

From Dev

Extract substring from list of file names in Python or R

From Dev

list file names from a folder to a tkinter window, with python 3

From Dev

Python: List directories/sub-directories with file names

From Dev

Searching in a big list file for names using in operator in python

From Dev

Extract substring from list of file names in Python or R

From Dev

list file names from a folder to a tkinter window, with python 3

From Dev

how to pass file names to list in python in a certain format?

From Dev

How to get a list of all non imported names in a Python module?

From Dev

Get selected node names into a list or tuple in Nuke with Python

From Dev

How to get top 3 count of names from list of dictionary in python

From Dev

Python: get the names of specific file types in a given folder

From Dev

How to get file names from command-line parameters in Python

From Dev

Sorting a list of names in python

Related Related

  1. 1

    python libtorrent How I get file list of torrent from info_hash?

  2. 2

    Get a list of file names from HDFS using python

  3. 3

    Python libtorrent

  4. 4

    get function names from a list python

  5. 5

    libtorrent-python problems, "no such file or directory" when there clearly is

  6. 6

    Get list of all NDB model names ( class names ) in GAE Python

  7. 7

    Get file names of tarred folder contents in Python

  8. 8

    Python, string slicing (getting file names from a list of file locations)

  9. 9

    get animal names from text file into List Of String

  10. 10

    How to get list of file names from a private remote ip

  11. 11

    get list of file names and store them in array on linux using C

  12. 12

    How to get list of file names and their sentence containing a specific search string?

  13. 13

    Get list of file names in folder/directory with Excel VBA

  14. 14

    Bat file list file names

  15. 15

    File Revision List File Names?

  16. 16

    Python: Group a list of file names according to common name identifier

  17. 17

    Extract substring from list of file names in Python or R

  18. 18

    list file names from a folder to a tkinter window, with python 3

  19. 19

    Python: List directories/sub-directories with file names

  20. 20

    Searching in a big list file for names using in operator in python

  21. 21

    Extract substring from list of file names in Python or R

  22. 22

    list file names from a folder to a tkinter window, with python 3

  23. 23

    how to pass file names to list in python in a certain format?

  24. 24

    How to get a list of all non imported names in a Python module?

  25. 25

    Get selected node names into a list or tuple in Nuke with Python

  26. 26

    How to get top 3 count of names from list of dictionary in python

  27. 27

    Python: get the names of specific file types in a given folder

  28. 28

    How to get file names from command-line parameters in Python

  29. 29

    Sorting a list of names in python

HotTag

Archive