-
Notifications
You must be signed in to change notification settings - Fork 0
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
gziped torrents #8
Comments
any kind of help is apreciated |
did you ever get this solved? This might help import gzip
import magic
m=magic.open(magic.MAGIC_MIME)
m.load()
if 'x-gzip' in m.file(filename):
filetmp = filename+'.gz'
os.rename(filename,filetmp)
f_in = gzip.open(filetmp, 'rb')
f_out = open(filename, 'wb')
f_out.writelines(f_in)
f_out.close()
f_in.close()
os.remove(filetmp) |
no I have not. I am unhappy with adding another dependency (magic) to the 2013/11/13 Sean Whitney [email protected]
|
fixed in e500fbb |
on some torrent feeds the .torrent files are actually gziped without a .gz extension, this causes
"Create new temporary directory... done!
Now fetching the bittorrent data
Download Error: not a valid bencoded string
Traceback (most recent call last):
File "/usr/share/mythnettv/mythnettvcore.py", line 121, in DownloadAndImport
out=out) == True:
File "/usr/share/mythnettv/program.py", line 441, in Download
verbose=FLAGS.verbose, out=out)
File "/usr/share/mythnettv/plugins/bittorrent.py", line 70, in Download
metainfo = bencode.bdecode(torrent_file.read())
File "/usr/local/lib/python2.7/dist-packages/bencode-1.0-py2.7.egg/bencode/init.py", line 68, in bdecode
raise BTFailure("not a valid bencoded string")
BTFailure: not a valid bencoded string
"
changing
torrent_file = open(torrent_filename)
to
torrent_file = gzip.open(torrent_filename)
works..
Ill see if i can make the auto detect a gzip header and decompress if it is
The text was updated successfully, but these errors were encountered: