From 41e51a0b12e4130ba75b97d409b3fe31db8450bc Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Fri, 24 Apr 2020 21:49:30 +0200 Subject: [PATCH] Fix paging + concatenate --- pynyaata/connectors/nyaa.py | 7 +++---- pynyaata/connectors/pantsu.py | 2 +- pynyaata/connectors/yggtorrent.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pynyaata/connectors/nyaa.py b/pynyaata/connectors/nyaa.py index 845a0e7..7609d61 100644 --- a/pynyaata/connectors/nyaa.py +++ b/pynyaata/connectors/nyaa.py @@ -56,15 +56,14 @@ class Nyaa(ConnectorCore): continue valid_trs = valid_trs + 1 - href = '%s%s' % (self.base_url, url['href']) + href = self.base_url + url['href'] self.data.append({ 'lang': self.get_lang(url_safe), 'href': href, 'name': url_safe, - 'comment': str(urls[0]).replace('/view/', - '%s%s' % (self.base_url, '/view/')) if has_comment else '', - 'link': tds[2].decode_contents().replace('/download/', '%s%s' % (self.base_url, '/download/')), + 'comment': str(urls[0]).replace('/view/', self.base_url + '/view/') if has_comment else '', + 'link': tds[2].decode_contents().replace('/download/', self.base_url + '/download/'), 'size': tds[3].string, 'date': parse_date(tds[4].string, '%Y-%m-%d %H:%M'), 'seeds': check_seeds, diff --git a/pynyaata/connectors/pantsu.py b/pynyaata/connectors/pantsu.py index ab7018f..56ed791 100644 --- a/pynyaata/connectors/pantsu.py +++ b/pynyaata/connectors/pantsu.py @@ -48,7 +48,7 @@ class Pantsu(ConnectorCore): continue valid_trs = valid_trs + 1 - href = '%s%s' % (self.base_url, url['href']) + href = self.base_url + url['href'] self.data.append({ 'lang': self.get_lang(url_safe), diff --git a/pynyaata/connectors/yggtorrent.py b/pynyaata/connectors/yggtorrent.py index c9d04f9..39f8937 100644 --- a/pynyaata/connectors/yggtorrent.py +++ b/pynyaata/connectors/yggtorrent.py @@ -21,7 +21,7 @@ class YggTorrent(ConnectorCore): sort_type = 'size' if self.return_type is ConnectorReturn.HISTORY: sort_type = 'publish_date' - sort_page = '&page=%s' % (self.page * 50) if self.page > 1 else '' + sort_page = '&page=%s' % ((self.page - 1) * 50) if self.page > 1 else '' return '%s/engine/search?name=%s&category=2145&sub_category=%s&do=search&order=desc&sort=%s%s' % ( self.base_url, self.query, self.category, sort_type, sort_page