forked from 0x2620/pandora
never serve torrents with https webseeds, some clients like uTorrent only support http, fixes #1272
This commit is contained in:
parent
4d4f391af0
commit
f993650f81
1 changed files with 2 additions and 0 deletions
|
@ -997,6 +997,8 @@ class Item(models.Model):
|
|||
self.torrent.seek(0)
|
||||
data = ox.torrent.bdecode(self.torrent.read())
|
||||
url = request.build_absolute_uri("%s/torrent/"%self.get_absolute_url())
|
||||
if url.startswith('https://'):
|
||||
url = 'http' + url[5:]
|
||||
data['url-list'] = ['%s%s' % (url, u.split('torrent/')[1]) for u in data['url-list']]
|
||||
return ox.torrent.bencode(data)
|
||||
|
||||
|
|
Loading…
Reference in a new issue