mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 09:28:41 +00:00
check url in functions instead
This commit is contained in:
parent
7338806613
commit
e3188695c6
2 changed files with 7 additions and 5 deletions
|
@ -94,6 +94,8 @@ def add_torrent_file(torrent_files):
|
||||||
def add_torrent_url(torrent_url):
|
def add_torrent_url(torrent_url):
|
||||||
"""Adds torrents to the core via url"""
|
"""Adds torrents to the core via url"""
|
||||||
core = get_core()
|
core = get_core()
|
||||||
|
from deluge.common import is_url
|
||||||
|
if is_url(torrent_url):
|
||||||
result = core.add_torrent_url(torrent_url)
|
result = core.add_torrent_url(torrent_url)
|
||||||
if result is False:
|
if result is False:
|
||||||
# The torrent url was not added successfully.
|
# The torrent url was not added successfully.
|
||||||
|
|
|
@ -63,7 +63,7 @@ class AddTorrentUrl:
|
||||||
self.response = self.dlg.run()
|
self.response = self.dlg.run()
|
||||||
url = self.entry.get_text()
|
url = self.entry.get_text()
|
||||||
self.dlg.destroy()
|
self.dlg.destroy()
|
||||||
if self.response == 1 and deluge.common.is_url(url):
|
if self.response == 1:
|
||||||
return url
|
return url
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue