Скачать торрент на питоне с помощью torrentp

Скачать торрент на питоне с помощью torrentp

Я пытаюсь скачать торрент на Python с помощью torrentp, но у него есть зависимости от libtorrent.

Я попробовал запустить этот код:

import asyncio
from torrentp import TorrentDownloader
torrent_file = TorrentDownloader("magnet:...", '.')
# Start the download process
asyncio.run(torrent_file.start_download()) # start_download() is a asynchronous method 

Но я получаю эту ошибку:

D:\Torrent\Media\Script>python torrent.py
Traceback (most recent call last):
  File "D:\Torrent\Media\Script\torrent.py", line 2, in <module>
    from torrentp import TorrentDownloader
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\torrentp\__init__.py", line 6, in <module>
    from .torrent_downloader import TorrentDownloader
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\torrentp\torrent_downloader.py", line 4, in <module>
    import libtorrent as lt
ImportError: DLL load failed while importing libtorrent: The specified module could not be found.

Я прочитал несколько постов по этой теме libtorrent, но пока ничего не исправило:

  1. Переустановка Microsoft Visual C++ Redistributable
  2. Переустановите libtorrentиtorrentp

Я установил libtorrent, используя pip install libtorrentи pip install torrentp также попытался установить пакеты изгитхаби делай

python setup.py build

и

python setup.py install

но я получаю это:

error: [WinError 2] The system cannot find the file specified

как из , так buildи install.

Связанный контент