not all torrents have announce
This commit is contained in:
parent
0df326eaf8
commit
a2c9309808
1 changed files with 2 additions and 1 deletions
|
@ -55,6 +55,7 @@ def get_torrent_info(data=None, file=None):
|
||||||
tinfo[key] = metainfo[key]
|
tinfo[key] = metainfo[key]
|
||||||
tinfo['size'] = file_length
|
tinfo['size'] = file_length
|
||||||
tinfo['hash'] = sha1(bencode(info)).hexdigest()
|
tinfo['hash'] = sha1(bencode(info)).hexdigest()
|
||||||
|
if 'announce' in metainfo:
|
||||||
tinfo['announce'] = metainfo['announce']
|
tinfo['announce'] = metainfo['announce']
|
||||||
if file:
|
if file:
|
||||||
tinfo['timestamp'] = os.stat(file).st_ctime
|
tinfo['timestamp'] = os.stat(file).st_ctime
|
||||||
|
|
Loading…
Reference in a new issue