Skip to content

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

@sgmihai

Description

@sgmihai

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions