Skip to content

Commit

Permalink
PEP8 Nyaa plugins and add favicons
Browse files Browse the repository at this point in the history
  • Loading branch information
MadeOfMagicAndWires committed May 19, 2017
1 parent 1fb083a commit b1ac63f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
Binary file added engines/bakabt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added engines/nyaapantsu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions engines/nyaapantsu.py
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])
#
Expand Down Expand Up @@ -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_',
Expand Down Expand Up @@ -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:
Expand All @@ -121,7 +120,6 @@ def handle_data(self, data):
elif self.td_counter == 5:
self.curr['size'] = data.strip()


def __init__(self):
"""class initialization"""

Expand All @@ -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),
Expand Down
Binary file added engines/nyaasi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 5 additions & 8 deletions engines/nyaasi.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class nyaasi(object):
# 'all', 'movies', 'tv', 'music', 'games', 'anime', 'software', 'pictures',
# 'books'
supported_categories = {
'all' : '0_0',
'all': '0_0',
'anime': '1_0',
'books': '3_0',
'music': '2_0',
Expand Down Expand Up @@ -77,7 +77,7 @@ def start_a(self, attr):
if 'title' in params and params['href'].startswith('/view/'):
hit = {
'name': params['title'],
'desc_link' : self.engine_url + params['href']}
'desc_link': self.engine_url + params['href']}
if not self.curr:
hit['engine_url'] = self.engine_url
self.curr = hit
Expand All @@ -98,7 +98,6 @@ def start_td(self):
self.curr = None
self.td_counter = -1


def handle_data(self, data):
# These fields matter
if self.td_counter > 0 and self.td_counter <= 5:
Expand Down Expand Up @@ -137,9 +136,9 @@ def search(self, what, cat='all'):
"""

url = str("{0}/?f=0&s=seeders&o=desc&c={1}&q={2}"
.format(self.url,
self.supported_categories.get(cat),
what))
.format(self.url,
self.supported_categories.get(cat),
what))

hits = []
page = 1
Expand All @@ -156,5 +155,3 @@ def search(self, what, cat='all'):
page += 1

parser.close()


0 comments on commit b1ac63f

Please sign in to comment.