-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fb083a
commit b1ac63f
Showing
5 changed files
with
10 additions
and
14 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#ndle -*- coding: utf-8 -*- | ||
# -*- coding: utf-8 -*- | ||
#VERSION: 1.0 | ||
#AUTHORS: Joost Bremmer ([email protected]) | ||
# | ||
|
@@ -39,7 +39,7 @@ class nyaapantsu(object): | |
# 'all', 'movies', 'tv', 'music', 'games', 'anime', 'software', 'pictures', | ||
# 'books' | ||
supported_categories = { | ||
'all' : '_', | ||
'all': '_', | ||
'anime': '3_', | ||
'books': '4_', | ||
'music': '2_', | ||
|
@@ -102,10 +102,9 @@ def start_td(self): | |
self.curr = None | ||
self.td_counter = -1 | ||
|
||
|
||
def handle_data(self, data): | ||
if self.td_counter == 0: | ||
if not 'name' in self.curr: | ||
if 'name' not in self.curr: | ||
self.curr['name'] = '' | ||
self.curr['name'] += data.strip() | ||
elif self.td_counter == 1: | ||
|
@@ -121,7 +120,6 @@ def handle_data(self, data): | |
elif self.td_counter == 5: | ||
self.curr['size'] = data.strip() | ||
|
||
|
||
def __init__(self): | ||
"""class initialization""" | ||
|
||
|
@@ -141,7 +139,8 @@ def search(self, what, cat='all'): | |
hits = [] | ||
parser = self.NyaaPantsuParser(hits, self.url) | ||
while True: | ||
url = str("{0}/search/{1}?s=0&sort=5&order=false&max=300&c={2}&q={3}" | ||
url = str( | ||
"{0}/search/{1}?s=0&sort=5&order=false&max=300&c={2}&q={3}" | ||
.format(self.url, | ||
page, | ||
self.supported_categories.get(cat), | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters