Merge branch 'master' into dev
This commit is contained in:
@@ -1,13 +1,20 @@
|
|||||||
import requests
|
import requests
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from NyaaPy.utils import utils
|
from NyaaPy import utils
|
||||||
|
|
||||||
class Nyaa:
|
class Nyaa:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.URI = "http://nyaa.si"
|
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):
|
def search(self, keyword, **kwargs):
|
||||||
user = kwargs.get('user', None)
|
user = kwargs.get('user', None)
|
||||||
category = kwargs.get('category', 0)
|
category = kwargs.get('category', 0)
|
||||||
@@ -45,10 +52,3 @@ class Nyaa:
|
|||||||
soup = BeautifulSoup(r.text, 'html.parser')
|
soup = BeautifulSoup(r.text, 'html.parser')
|
||||||
|
|
||||||
return utils.parse_nyaa(soup.select('table tr'), limit=None)
|
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)
|
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
import requests
|
import requests
|
||||||
from NyaaPy.utils import utils
|
from NyaaPy import utils
|
||||||
|
|
||||||
class Pantsu:
|
class Pantsu:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.BASE_URL = "https://nyaa.pantsu.cat/api"
|
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
|
# Torrents - GET
|
||||||
def search(self, keyword, **kwargs):
|
def search(self, keyword, **kwargs):
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import requests
|
import requests
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from NyaaPy.utils import utils
|
from NyaaPy import utils
|
||||||
|
|
||||||
class SukebeiNyaa:
|
class SukebeiNyaa:
|
||||||
def search(self, keyword, **kwargs):
|
def search(self, keyword, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user