From c200756247a9d718731fc60b7c648a21f286528e Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 30 Oct 2019 23:30:35 +0100 Subject: [PATCH] Support Next Page + Pagination --- core/support.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/support.py b/core/support.py index 026a3459..feb92e19 100644 --- a/core/support.py +++ b/core/support.py @@ -400,12 +400,13 @@ def scrape(func): if 'itemlistHook' in args: itemlist = args['itemlistHook'](itemlist) - - if patronNext and inspect.stack()[1][3] != 'newest': - nextPage(itemlist, item, data, patronNext, function) + + if (pagination and len(matches) <= pag * pagination) or not pagination: # next page with pagination + if patronNext and inspect.stack()[1][3] != 'newest': + nextPage(itemlist, item, data, patronNext, function) # next page for pagination - if pagination and len(matches) >= pag * pagination: + if pagination and len(matches) > pag * pagination and not search: if inspect.stack()[1][3] != 'get_newest': itemlist.append( Item(channel=item.channel,