Currently when using blackhole for torrents, magnet links are "converted" to torrent files using webservices for torrent caching. But this doesn't work.
This is the list of services currently used: https://github.com/SickRage/SickRage/blob/master/sickrage/providers/GenericProvider.py#L54-L61
All the enabled sites i checked didn't work, either 404 or similar errors.
As a workaround i implemented a very basic switch to output the magnet directly in a plain textfile with .magnet extension rather than "converting" it: https://github.com/SickRage/SickRage/compare/master...felixbrucker:felixbrucker/magnet-blackhole
I'm not very familiar with python and i'd like some pointers on how to achieve the following:
make a checkbox in blackhole config to enable the changes i did (the optional flag force_magnet) so magnets are stored in a text file with .magnet extension. This should probably be an advanced option as it's non standard (i guess).
I'm open for better ways to achieve the same result: being able to use blackhole.
Currently when using blackhole for torrents, magnet links are "converted" to torrent files using webservices for torrent caching. But this doesn't work.
For most users this does in fact work so maybe let's start there; What providers are you using?
It does look like a few of those providers are either down or no longer working but itorrents.org still loads perfectly for me. e.g. a linux ISO
In regards to the "workaround"...
This changes the default for all users this shouldn't be the case. If you want to add a fallback that uses the magnet or an option to switch between using a torrent caching service or forcing magnets then open another issue and we'll see what happens.
The PR needs to be opened against develop not master.
https://github.com/SickRage/SickRage/compare/develop...felixbrucker:felixbrucker/magnet-blackhole
Just becouse they are caching services don't have have all torrents avaiable to SickRage. It's very possible non of the services have the requested torrent @OmgImAlexis
As for saving as a .magnet, @felixbrucker that isn't part of the bittorrent specification, and IIR only one client suported them.
@duramato yes exactly
I'm using a small custom app so non-spec stuff isn't a problem, but i'd go the spec path if possible
@OmgImAlexis i didnt specify any services, i assume it uses all of them if all fail. But as @duramato pointed out new torrents will very likely not be avail there yet.
Regarding the workaround: this is only a PoC for my specific use case and certainly shouldn't be the default.
What other alternatives are there?
Is there a way to store magnet links as files which is to spec?
with the exception of windows as its impossible as far as i know.. you could use python's libtorrent bindings...
And use something like the following..
def mag2tor(mag_link):
sess = libtorrent.session()
prms = {
'save_path':os.path.abspath(os.path.curdir),
'paused':False,
'auto_managed':False,
'upload_mode':True,
}
torr = libtorrent.add_magnet_uri(sess, mag_link, prms)
sess.pause()
tinf = torr.get_torrent_info()
f = open(tinf.name() + '.torrent', 'wb')
f.write(libtorrent.bencode(
libtorrent.create_torrent(tinf).generate()))
f.close()
sess.remove_torrent(torr)
that will save the torrent based off the stored name to the current directory...
^^ actually you can get 1.0.9 libtorrent for windows from https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_0_9/python-libtorrent-1.0.9.win32.msi
But that requires it to connect to the swarm to get the torrent's info. People who use blackhole might be sending their torrent's elsewhere, like a seedbox ie, for legal reasons.
I think this could be another option for advanced users to work around the service limitations, but as duramato noted for many (including me) this is a no-go
maybe state that in your requirements next time... i was simply offering a solution, you asked how to get store a magnet as a torrent.
lol @duramato we are on way too many of the same repos ;P
Yes, and i appreciate the solution :+1:
I second this issue. Got the same problem and the workaround from @felixbrucker works fine for me.
For information I'm using https://github.com/piejanssens/premiumizer to download torrents.
I got the checkbox to show up and work: https://github.com/SickRage/SickRage/compare/develop...felixbrucker:felixbrucker/magnet-blackhole
What else needs to be done?
Nobody wants this? alright then
Like I said, I have the same problem. None of the magnets that get fetched can be downloaded correctly.
I use your patch and It works like a charm now. I would want this feature implemented. 馃憤
Most helpful comment
But that requires it to connect to the swarm to get the torrent's info. People who use blackhole might be sending their torrent's elsewhere, like a seedbox ie, for legal reasons.