OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Download torrent in python using torrentp

  • Thread starter Thread starter PercivallAkihiko
  • Start date Start date
P

PercivallAkihiko

Guest
I'm trying to download torrent in python using torrentp but it has a dependencies to libtorrent.

I tried to run this code:

Code:
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

But I'm getting this error:

Code:
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.

I've read several post about libtorrent but so far nothing has fixed it:

  1. Reinstalling Microsoft Visual C++ Redistributable
  2. Reinstall libtorrent and torrentp

I installed libtorrent using pip install libtorrent and pip install torrentp I also tried to install the packages from github and do

Code:
python setup.py build

and

Code:
python setup.py install

but I'm getting this:

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

both from build and install.
<p>I'm trying to download torrent in python using torrentp but it has a dependencies to <code>libtorrent</code>.</p>
<p>I tried to run this code:</p>
<pre class="lang-python prettyprint-override"><code>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
</code></pre>
<p>But I'm getting this error:</p>
<pre class="lang-shellsession prettyprint-override"><code>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.
</code></pre>
<p>I've read several post about <code>libtorrent</code> but so far nothing has fixed it:</p>
<ol>
<li>Reinstalling Microsoft Visual C++ Redistributable</li>
<li>Reinstall <code>libtorrent</code> and <code>torrentp</code></li>
</ol>
<p>I installed libtorrent using <code>pip install libtorrent</code> and <code>pip install torrentp</code>
I also tried to install the packages from <a href="https://github.com/arvidn/libtorrent" rel="nofollow noreferrer">github</a> and do</p>
<pre><code>python setup.py build
</code></pre>
<p>and</p>
<pre><code>python setup.py install
</code></pre>
<p>but I'm getting this:</p>
<pre class="lang-none prettyprint-override"><code>error: [WinError 2] The system cannot find the file specified
</code></pre>
<p>both from <code>build</code> and <code>install</code>.</p>
 

Latest posts

Top