torrentpを使用してPythonから急流をダウンロードする

torrentpを使用してPythonから急流をダウンロードする

torrentpを使ってPythonに急流をダウンロードしようとしています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++ 再頒布可能パッケージの再インストール
  2. 再インストールlibtorrentしてtorrentp

以下を使用してlibtorrentをインストールし、次からパッケージをインストールしようとしましたpip install libtorrentpip install torrentpフラッグハブそして

python setup.py build

そして

python setup.py install

しかし、私はこれを得ます:

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

両方buildinstall

ベストアンサー1

おすすめ記事