Re: [libtorrent] resume download
Brought to you by:
arvidn
|
From: Moritz W. <mor...@we...> - 2014-02-27 00:10:45
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The problem was solved with help from Cas-. (thanks)
This is the gist of the solution:
md = lt.bdecode(self.torrent_info.metadata())
torrent_file = {}
torrent_file["info"] = md
open("foo.torrent", "wb").write(lt.bencode(torrent_file))
Now there is a valid torrent file that can be used along
with the .fastresume file to resume the download after restart.
regards,
mwarning
On 02/26/2014 10:40 PM, Moritz Warning wrote:
> Hi,
>
> can a download be resumed after the application has been closed?
>
> The issue is that the original torrent file is not available.
> The client.py example from the libtorrent repository seem to rely on that fact.
>
> I tried to store and load the metadata and fastresume data - but it did not seem to work.
> After the restart I get "RuntimeError: missing or invalid 'info' section in torrent file".
>
> As for the metadata, h.get_torrent_info().metadata() is written to disk. It is loaded this way:
>
> e = lt.bdecode(open(mfile, 'rb').read())
> info = lt.torrent_info(e)
> atp["ti"] = info
>
> That is probably where the problem is.
>
> The test case is attached. Maybe someone can give me a pointer into the right direction.
>
> regards,
> mwarning
>
>
>
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Libtorrent-discuss mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/
iQEcBAEBAgAGBQJTDoIwAAoJECHrh56PP4wpDakIAKu7TZoylxMZEM9Qk5pWc2kG
E3rPckTctA3zWf0xN+hRZzuWUDtLFTBRjl4/ZJzkss6BlNv16UPD3L9OU3p8yTjH
0Xe5/bKifI88z8xMEUHV3snhOVum7zncKz6+KpVRaLJSetNTd47t5YMY2dY5CFNB
ejviyuWQ95m3ySoBniUe8u1GMS5uK4ErAiE4aUuLU4ldyTzDpnnIJnV9uerPHXIW
2KhtII9iVLjnK5FvbAhhtnsgGpB16z2RAInV2udBS7buqRwd+xGxFszaPWq3C7Lk
yViMsz8tuOOfEs6a4KrE0DyOU7ySO3ln55aRC2F8dlvgjy1jfcIAY/uUMnXJ1dA=
=2r2J
-----END PGP SIGNATURE-----
|