Need to apply the same fix to nyaa.pantsu
This commit is contained in:
Juan José Salvador Piedra
2017-10-06 20:35:24 +02:00
committed by GitHub
parent 9cb2403b0c
commit 2b9f90d86c

View File

@@ -4,13 +4,16 @@ import json
import collections
class Nyaa():
def search(keyword):
nyaa_baseurl = "https://nyaa.si/?page=rss&c=1_0&f=0&q="
def search(keyword, page):
if not page:
url = "https://nyaa.si/?page=rss&c=1_0&f=0&q={}".format(keyword)
else:
url = "https://nyaa.si/?page=rss&c=1_0&f=0&q={}&p={}".format(keyword, page)
request = requests.get(nyaa_baseurl + keyword)
request = requests.get(url)
response = xmltodict.parse(request.text)
results = []
results = []
try:
if type(response['rss']['channel']['item']) is collections.OrderedDict: