pirokit
pirokit copied to clipboard
magnet truncated
grep -Po "magnet:\?xt=urn:btih:[a-zA-Z0-9]*"
truncates the magnet at the first ampersand.
Maybe try:
magnet=$(grep -Po "magnet:\?xt=urn:btih:[[:alnum:][:punct:]]*" $cachedir/tmp.html | head -n 1)
deluge=$(echo "$magnet" | tr -d \")
deluge-console add "$deluge"
is that a issue or a enhancement idea?
It's an issue. The grep command as it is doesn't produce the entire magnet link. It's truncating the magnet link at the first ampersand / non alpha that appears.
So the script doesn't actually work. Or, at least it didn't for me.
What I posted above will get the whole magnet link, but it also includes the closing " character of the magnet. So I used tr to remove that before passing it to deluge.
I edited mine to pass the link to my clipboard, but I think the above should work how you wanted.
Cool script, by the way!
Yeah I got it. I only used info hash to start downloading. You should remove code to start downloading and just try to paste magnet link. Try downloading something with good number of seeders. I will add regex which grep magnet link with trackers and not just hash.