mirror of
https://github.com/searxng/searxng.git
synced 2025-07-14 00:39:18 +02: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:
parent
104cdb7d03
commit
3a1c5876b1
4 changed files with 84 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue