Commit 145e8f11 authored by prx's avatar prx

show exception

parent d7756ed8
......@@ -4,13 +4,12 @@ import sys
import requests
import bs4
from .utils import convb
from .i18n import _
from utils import convb
from i18n import _
if sys.version_info >= (3, 0):
from concurrent.futures import ThreadPoolExecutor
def do_req_get(url, ret, keys=None, headers=None):
"""
Do a requests get and handle exceptions
......@@ -275,7 +274,8 @@ class TorrentSearch:
s = self._search_all(sch)
else:
s = [res for res in self._piratebay(sch, 0)]
except:
except Exception as e:
print(e)
s = []
return s
......@@ -519,12 +519,6 @@ class TorrentSearch:
seed : number of seeds
"""
name = str()
magnet = str()
size = str()
seeds = str()
leechs = str()
url = 'https://isohunt.to/torrents/'
keys = {'ihq': sch}
s = do_req_get(url, "text", keys)
......@@ -562,6 +556,7 @@ class TorrentSearch:
size = str()
seeds = str()
leechs = str()
for i in soup.find_all('tbody'):
for d in i.find_all('td'):
if d.find('a'):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment