Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We need an example with a magnet #700

Open
IGNATOV93 opened this issue Oct 3, 2024 · 1 comment
Open

We need an example with a magnet #700

IGNATOV93 opened this issue Oct 3, 2024 · 1 comment

Comments

@IGNATOV93
Copy link

Good day, who can give an example of a code for obtaining meta-information through a magnet? But the same distribution in a couple of seconds is determined in the torrent client on the pc qbittorrent .I will be very grateful

@kaedei
Copy link
Contributor

kaedei commented Oct 26, 2024

In the ClientEngine class, there is a DownloadMetadataAsync method that can help you download torrent files from a magnet URI. You can see how it works from the source code:

public async Task<ReadOnlyMemory<byte>> DownloadMetadataAsync (MagnetLink magnetLink, CancellationToken token)

However, if you need more customization, such as adding more custom trackers (which is usually necessary for metadata-type download tasks), you will need to handle the initialization yourself and call the TorrentManager.StartAsync(metadataOnly: true) method.
Unfortunately, the current async Task StartAsync(bool metadataOnly) method is internal, so you may need to modify the source code of the monotorrent library to call it from outside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants