mirror of
https://github.com/kemayo/leech
synced 2025-12-06 16:33:16 +01:00
Instead of stop-after, use offset/limit
This commit is contained in:
parent
8ce3c7f709
commit
178ff6bda7
1 changed files with 3 additions and 3 deletions
|
|
@ -33,8 +33,7 @@ class XenForo(Site):
|
||||||
story['author'] = soup.find('p', id='pageDescription').find('a', class_='username').get_text()
|
story['author'] = soup.find('p', id='pageDescription').find('a', class_='username').get_text()
|
||||||
|
|
||||||
marks = [mark for mark in self._chapter_list(url) if '/members' not in mark.get('href')]
|
marks = [mark for mark in self._chapter_list(url) if '/members' not in mark.get('href')]
|
||||||
if self.options.stop_after:
|
marks = marks[self.options.offset:self.options.limit]
|
||||||
marks = marks[:self.options.stop_after]
|
|
||||||
|
|
||||||
chapters = []
|
chapters = []
|
||||||
for idx, mark in enumerate(marks, 1):
|
for idx, mark in enumerate(marks, 1):
|
||||||
|
|
@ -140,7 +139,8 @@ class XenForo(Site):
|
||||||
|
|
||||||
def _add_arguments(self, parser):
|
def _add_arguments(self, parser):
|
||||||
parser.add_argument('--include-index', dest='include_index', action='store_true', default=False)
|
parser.add_argument('--include-index', dest='include_index', action='store_true', default=False)
|
||||||
parser.add_argument('--stop-after', dest='stop_after', type=int, default=None)
|
parser.add_argument('--offset', dest='offset', type=int, default=None)
|
||||||
|
parser.add_argument('--limit', dest='limit', type=int, default=None)
|
||||||
|
|
||||||
|
|
||||||
class XenForoIndex(XenForo):
|
class XenForoIndex(XenForo):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue