This commit is contained in:
Frisk 2020-10-13 18:06:24 +02:00
parent 9cfa0d3260
commit 8113f28fb0
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -380,10 +380,22 @@ async def discussion_handler():
comment_events.append(post["forumId"]) comment_events.append(post["forumId"])
comment_pages: dict = {} comment_pages: dict = {}
if comment_events: if comment_events:
comment_pages = await local_wiki.safe_request( try:
"{wiki}wikia.php?controller=FeedsAndPosts&method=getArticleNamesAndUsernames&stablePageIds={pages}&format=json".format( comment_pages = await local_wiki.safe_request(
wiki=db_wiki["wiki"], pages=",".join(comment_events) "{wiki}wikia.php?controller=FeedsAndPosts&method=getArticleNamesAndUsernames&stablePageIds={pages}&format=json".format(
), RateLimiter(), "articleNames") wiki=db_wiki["wiki"], pages=",".join(comment_events)
), RateLimiter(), "articleNames")
except aiohttp.ClientResponseError: # Fandom can be funny sometimes... See #30
comment_pages = None
except:
if command_line_args.debug:
logger.exception("Exception on Feeds article comment request")
shutdown(loop=asyncio.get_event_loop())
else:
logger.exception("Exception on Feeds article comment request")
await generic_msg_sender_exception_logger(traceback.format_exc(),
"Exception on Feeds article comment request",
Post=str(post)[0:1000], Wiki=db_wiki["wiki"])
for post in discussion_feed: # Yeah, second loop since the comments require an extra request for post in discussion_feed: # Yeah, second loop since the comments require an extra request
if post["id"] > db_wiki["postid"]: if post["id"] > db_wiki["postid"]:
for target in targets.items(): for target in targets.items():