Setup default parameters for searchTorrentSite

This commit is contained in:
2021-07-03 18:41:17 +02:00
parent bd91939121
commit 9bfa913912
2 changed files with 5 additions and 3 deletions

View File

@@ -55,4 +55,4 @@ def fetch_url(url):
elif hasattr(e, 'code'): elif hasattr(e, 'code'):
logger.error('The server couldn\'t fulfill the request.') logger.error('The server couldn\'t fulfill the request.')
logger.error('Error code: ', e.code) logger.error('Error code: ', e.code)
sys.exit() sys.exit()

View File

@@ -45,12 +45,12 @@ def chooseCandidate(torrent_list):
size, _, size_id = torrent.size.partition(' ') size, _, size_id = torrent.size.partition(' ')
if intersecting_release_types: if intersecting_release_types:
interesting_torrents.append(torrent) interesting_torrents.append(torrent)
return interesting_torrents return interesting_torrents
def searchTorrentSite(config, query, site, filter, print_result): def searchTorrentSite(query, site='jackett', filter=None, print_result=False, config=None):
""" """
Selects site based on input and finds torrents for that site based on query Selects site based on input and finds torrents for that site based on query
@@ -61,6 +61,8 @@ def searchTorrentSite(config, query, site, filter, print_result):
:return: json list with results :return: json list with results
:rtype: str :rtype: str
""" """
if config is None:
config = getConfig()
logger.debug('Searching for query {} at {}'.format(query, site)) logger.debug('Searching for query {} at {}'.format(query, site))
if site == 'piratebay': if site == 'piratebay':