stability tweaks

This commit is contained in:
2020-12-25 20:12:15 -05:00
parent 95017c646e
commit 19636abafe
3 changed files with 11 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import json
import os
from json import JSONDecodeError
from urllib.parse import urljoin
@@ -6,6 +7,8 @@ from post_process import get_links_from_body
from state import PoalState
from util import Web, logger
PF_MAX_PAGE = os.environ.get("PF_MAX_PAGE", 9999999)
class PoalHelper:
@@ -74,6 +77,8 @@ class PoalHelper:
page = 1
else:
page = int(r.url.split("/")[-1])
if page + 1 > PF_MAX_PAGE:
return posts, None
return posts, self.posts_url(board, page=page + 1)
return posts, None