first commit
This commit is contained in:
0
NyaaPy/__init__.py
Normal file
0
NyaaPy/__init__.py
Normal file
23
NyaaPy/nyaa.py
Normal file
23
NyaaPy/nyaa.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import requests
|
||||
import xmltodict
|
||||
|
||||
|
||||
class Nyaa():
|
||||
def search(keyword):
|
||||
nyaa_baseurl = "https://nyaa.si/?page=rss&c=1_0&f=0&q="
|
||||
|
||||
request = requests.get(nyaa_baseurl + keyword)
|
||||
response = xmltodict.parse(request.text)
|
||||
results = response['rss']['channel']['item']
|
||||
|
||||
return results
|
||||
|
||||
class NyaaPantsu():
|
||||
def search(keyword):
|
||||
nyaapantsu_baseurl = "https://nyaa.pantsu.cat/feed?c=_&s=0&max=99999&userID=0&q="
|
||||
|
||||
request = requests.get(nyaapantsu_baseurl + keyword)
|
||||
response = xmltodict.parse(request.text)
|
||||
results = response['rss']['channel']['item']
|
||||
|
||||
return results
|
||||
Reference in New Issue
Block a user