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

Feature request: Allow infoHash string for torrent add input #258

Closed
sgmihai opened this issue Oct 20, 2024 · 1 comment
Closed

Feature request: Allow infoHash string for torrent add input #258

sgmihai opened this issue Oct 20, 2024 · 1 comment
Labels

Comments

@sgmihai
Copy link

sgmihai commented Oct 20, 2024

qBittorrent supports this, you just paste an infohash and it treats it as a magnet link with that infohash.
I'm thinking something like this can be added in the session.rs code to call itself again(recursively) with an infohash

            AddTorrent::Url(url) if url.len() == 40 && url.chars().all(char::is_ascii_hex_digit) => {
                let magnet_url = format!("magnet:?xt=urn:btih:{}", url);
                self.add_torrent(AddTorrent::Url(magnet_url), opts).await

I don't write any rust but I would have attempted this still, if not for the scary spaghetti monster that is the function there :
Why is it not split up in multiple functions, to avoid the procedure calls overhead maybe ?

Great project btw,we really do need an alternative to libtorrent/rtorrent etc.

@ikatson
Copy link
Owner

ikatson commented Nov 7, 2024

Done here #271

@ikatson ikatson closed this as completed Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants