Allow the creation of .torrent files with no trackers
This commit is contained in:
parent
dbcf1e622a
commit
5af5749065
@ -76,7 +76,9 @@ def make_meta_file(path, url, piece_length, progress=dummy,
|
|||||||
title=None, comment=None, safe=None, content_type=None,
|
title=None, comment=None, safe=None, content_type=None,
|
||||||
target=None, url_list=None, name=None, private=False,
|
target=None, url_list=None, name=None, private=False,
|
||||||
created_by=None, httpseeds=None):
|
created_by=None, httpseeds=None):
|
||||||
data = {'announce': url.strip(), 'creation date': int(gmtime())}
|
data = {'creation date': int(gmtime())}
|
||||||
|
if url:
|
||||||
|
data['announce'] = url.strip()
|
||||||
a, b = os.path.split(path)
|
a, b = os.path.split(path)
|
||||||
if not target:
|
if not target:
|
||||||
if b == '':
|
if b == '':
|
||||||
|
|||||||
@ -256,8 +256,9 @@ class CreateTorrentDialog:
|
|||||||
# Get a list of trackers
|
# Get a list of trackers
|
||||||
trackers = [t[1] for t in self.trackers_liststore]
|
trackers = [t[1] for t in self.trackers_liststore]
|
||||||
if len(trackers) == 0:
|
if len(trackers) == 0:
|
||||||
self.dialog.destroy()
|
tracker = None
|
||||||
return
|
else:
|
||||||
|
tracker = trackers[0]
|
||||||
# Get a list of webseeds
|
# Get a list of webseeds
|
||||||
webseeds = []
|
webseeds = []
|
||||||
b = self.glade.get_widget("textview_webseeds").get_buffer()
|
b = self.glade.get_widget("textview_webseeds").get_buffer()
|
||||||
@ -279,7 +280,7 @@ class CreateTorrentDialog:
|
|||||||
if is_remote:
|
if is_remote:
|
||||||
client.create_torrent(
|
client.create_torrent(
|
||||||
path,
|
path,
|
||||||
trackers[0],
|
tracker,
|
||||||
piece_length,
|
piece_length,
|
||||||
comment,
|
comment,
|
||||||
result,
|
result,
|
||||||
@ -298,7 +299,7 @@ class CreateTorrentDialog:
|
|||||||
threading.Thread(target=self.create_torrent,
|
threading.Thread(target=self.create_torrent,
|
||||||
args=(
|
args=(
|
||||||
path,
|
path,
|
||||||
trackers[0],
|
tracker,
|
||||||
piece_length,
|
piece_length,
|
||||||
self._on_create_torrent_progress,
|
self._on_create_torrent_progress,
|
||||||
comment,
|
comment,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user