parent
343d293001
commit
681f975df5
5 changed files with 84 additions and 2 deletions
|
@ -21,7 +21,10 @@ def _load_private_key(private_key_file_path):
|
|||
with open(private_key_file_path) as private_key_file:
|
||||
return private_key_file.read()
|
||||
|
||||
def _torrent_jwt(info_dict):
|
||||
def torrent_jwt(info_dict):
|
||||
""" Returns an encoded JWT for the given information dictionary, signed by the local instance's
|
||||
private key.
|
||||
"""
|
||||
token_data = {
|
||||
'iss': instance_keys.service_name,
|
||||
'aud': ANNOUNCE_URL,
|
||||
|
@ -45,7 +48,7 @@ def make_torrent(name, webseed, length, piece_length, pieces):
|
|||
}
|
||||
|
||||
return bencode.bencode({
|
||||
'announce': ANNOUNCE_URL + "?jwt=" + _torrent_jwt(info_dict),
|
||||
'announce': ANNOUNCE_URL + "?jwt=" + torrent_jwt(info_dict),
|
||||
'url-list': webseed,
|
||||
'encoding': 'UTF-8',
|
||||
'created by': REGISTRY_TITLE,
|
||||
|
|
Reference in a new issue