zeroone2numeral2 / reddit-test

3 stars 1 forks source link

Issue with crossposts #86

Closed RememberTheAir closed 5 years ago

RememberTheAir commented 5 years ago
[2019-08-16 10:19:24,811][sp][post:process_subreddit:131][INFO] >>> processing subreddit: t5_iezap (r/BreadTube)
[2019-08-16 10:19:24,812][sp][post:calculate_quiet_hours_demultiplier:73][INFO] >>> subreddit quiet hours demultiplier is 1: posts frequency is unchanged, no need to check if we are in quiet hours
[2019-08-16 10:19:24,812][sp][post:time_to_post:96][INFO] >>> elapsed time (now -- last post): 16/08/2019 10:19 -- 16/08/2019 05:18
[2019-08-16 10:19:24,812][sp][post:process_submissions:115][INFO] >>> fetching submissions (sorting: top)
[2019-08-16 10:19:25,299][sp][post:process_submissions:119][INFO] >>> checking submission: cqzc5y (Donald J. Trump and Jeffrey Epstein allegedly raped Katie Johnso...)...
[2019-08-16 10:19:25,302][sp][post:process_submissions:121][INFO] >>> ...submission cqzc5y has already been posted
[2019-08-16 10:19:25,302][sp][post:process_submissions:119][INFO] >>> checking submission: cqoa7z ("That'd be a you problem": Ben Shapiro Doesn't Care about Worker...)...
[2019-08-16 10:19:25,304][sp][post:process_submissions:121][INFO] >>> ...submission cqoa7z has already been posted
[2019-08-16 10:19:25,304][sp][post:process_submissions:119][INFO] >>> checking submission: cqtd55 (BREAKING: ICE just ran a truck over a group of protesters...)...
[2019-08-16 10:19:25,307][sp][post:process_submissions:125][INFO] >>> ...submission cqtd55 has NOT been posted yet, we will post this one if it passes checks
[2019-08-16 10:19:25,309][sp][sender:__init__:120][INFO] >>> note: submission is a crosspost of t3_cqp4tw
[2019-08-16 10:19:25,310][sp][post:check_posts:218][ERROR] >>> error while processing subreddit r/BreadTube: list index out of range
Traceback (most recent call last):
  File "/root/reddit-test/bot/jobs/post.py", line 213, in check_posts
    posted_messages = process_subreddit(subreddit, bot)
  File "/root/reddit-test/bot/jobs/post.py", line 143, in process_subreddit
    sender = Sender(bot, subreddit, submission)
  File "/root/reddit-test/reddit/sender.py", line 121, in __init__
    self._s.xpost_from = self._s.crosspost_parent_list[0].get('subreddit', '')
IndexError: list index out of range

Apparently, even if the submission is a crosspost, there is no first crosspost element

thread