merge fixes

This commit is contained in:
Juanjo Salvador
2019-10-05 14:52:49 +02:00
3 changed files with 186 additions and 178 deletions

View File

@@ -8,6 +8,13 @@ class Nyaa:
def __init__(self):
self.URI = "http://nyaa.si"
def last_uploads(self, number_of_results):
r = requests.get(self.URI)
soup = BeautifulSoup(r.text, 'html.parser')
rows = soup.select('table tr')
return utils.parse_nyaa(table_rows=rows, limit=number_of_results + 1)
def search(self, keyword, **kwargs):
user = kwargs.get('user', None)
category = kwargs.get('category', 0)
@@ -45,10 +52,3 @@ class Nyaa:
soup = BeautifulSoup(r.text, 'html.parser')
return utils.parse_nyaa(soup.select('table tr'), limit=None)
def news(self, number_of_results):
r = requests.get(self.URI)
soup = BeautifulSoup(r.text, 'html.parser')
rows = soup.select('table tr')
return utils.parse_nyaa(rows, limit=number_of_results + 1)

View File

@@ -6,6 +6,14 @@ class Pantsu:
def __init__(self):
self.BASE_URL = "https://nyaa.pantsu.cat/api"
def last_uploads(self, number_of_results):
r = requests.get(self.URI)
soup = BeautifulSoup(r.text, 'html.parser')
rows = soup.select('table tr')
return utils.parse_nyaa(rows, limit=number_of_results + 1)
# Torrents - GET
def search(self, keyword, **kwargs):
request = requests.get("{}/search{}".format(