need to fix the cat - subcat extraction

This commit is contained in:
JuanjoSalvador
2017-10-13 00:28:55 +02:00
parent e6442d22fb
commit c0283c57c3
2 changed files with 39 additions and 39 deletions

View File

@@ -3,7 +3,7 @@ from NyaaPy import Nyaa, NyaaPantsu
# Nyaa.si results
def nyaa_search():
nyaa_query = Nyaa.search('koe no katachi 1080', 1, 0, 0, 2)
nyaa_query = Nyaa.search('koe no katachi 1080', 1, 0, 0, 0)
for nyaa in nyaa_query:
print(nyaa['date'])
@@ -12,7 +12,7 @@ def nyaa_news():
news = Nyaa.news(5)
for result in news:
print(result['name'])
print(result)
# Nyaa.pantsu.cat results
def pantsu_search():
@@ -32,30 +32,7 @@ def pantsu_news():
# Uncomment whatever you want to test
nyaa_search()
#nyaa_search()
#pantsu_search()
nyaa_news()
#pantsu_news()
''' r = requests.get("http://nyaa.si/")
soup = BeautifulSoup(r.text, 'html.parser')
rows = soup.select('table tr')
torrents = []
for row in rows:
td = row.find_all('td')
torrent = []
for i in td:
if i.find('a'):
torrent.append(i.find('a').get('href'))
text = i.text.rstrip()
if len(text) > 0:
torrent.append(text)
else:
text = i.text.rstrip()
if len(text) > 0:
torrent.append(text)
torrents.append(torrent) '''
#pantsu_news()