mirror of
https://github.com/searxng/searxng.git
synced 2025-12-22 19:50:00 +00:00
add digbt engine
Unfortunately, it is quite slow so it is disabled. Furthermore, the display of number of files is wrong on digbt.org, so it is not displayed on searx.
This commit is contained in:
@@ -237,3 +237,21 @@ def list_get(a_list, index, default=None):
|
||||
return a_list[index]
|
||||
else:
|
||||
return default
|
||||
|
||||
|
||||
def get_torrent_size(filesize, filesize_multiplier):
|
||||
try:
|
||||
filesize = float(filesize)
|
||||
|
||||
if filesize_multiplier == 'TB':
|
||||
filesize = int(filesize * 1024 * 1024 * 1024 * 1024)
|
||||
elif filesize_multiplier == 'GB':
|
||||
filesize = int(filesize * 1024 * 1024 * 1024)
|
||||
elif filesize_multiplier == 'MB':
|
||||
filesize = int(filesize * 1024 * 1024)
|
||||
elif filesize_multiplier == 'KB':
|
||||
filesize = int(filesize * 1024)
|
||||
except:
|
||||
filesize = None
|
||||
|
||||
return filesize
|
||||
|
||||
Reference in New Issue
Block a user