Commit 39b2a74b authored by nanahira's avatar nanahira

fix

parent ccbf5c09
Pipeline #22559 passed with stages
in 24 seconds
...@@ -379,7 +379,7 @@ def searchban(screen_name): ...@@ -379,7 +379,7 @@ def searchban(screen_name):
if not ghostban: if not ghostban:
# all checks done # all checks done
break break
if ent["entryId"].startswith("tweet"): if ent["entryId"].startswith("tweet") and "lagacy" in ent["content"]["itemContent"]["tweet_results"]["result"]:
tmp = ent["content"]["itemContent"]["tweet_results"]["result"]["legacy"] tmp = ent["content"]["itemContent"]["tweet_results"]["result"]["legacy"]
if "in_reply_to_status_id_str" in tmp and tmp["in_reply_to_status_id_str"] not in checkedTweets: if "in_reply_to_status_id_str" in tmp and tmp["in_reply_to_status_id_str"] not in checkedTweets:
reply = tmp reply = tmp
...@@ -419,7 +419,7 @@ def searchban(screen_name): ...@@ -419,7 +419,7 @@ def searchban(screen_name):
print("Current entry of {} is: {}".format(screen_name, ent["entryId"])) print("Current entry of {} is: {}".format(screen_name, ent["entryId"]))
if ent["entryId"].startswith("conversationthread") and ghostban: if ent["entryId"].startswith("conversationthread") and ghostban:
for item in ent["content"]["items"]: for item in ent["content"]["items"]:
if "tweet_results" in item["item"]["itemContent"] and item["item"]["itemContent"]["tweet_results"]["result"]["legacy"]["user_id_str"] == user_id: if "tweet_results" in item["item"]["itemContent"] and "legacy" in item["item"]["itemContent"]["tweet_results"]["result"] and item["item"]["itemContent"]["tweet_results"]["result"]["legacy"]["user_id_str"] == user_id:
replyId = item["item"]["itemContent"]["tweet_results"]["result"]["legacy"]["id_str"] replyId = item["item"]["itemContent"]["tweet_results"]["result"]["legacy"]["id_str"]
returnjson["tests"]["ghost"] = {"ban": False, "tweet": tweetId, "in_reply_to": replyId} returnjson["tests"]["ghost"] = {"ban": False, "tweet": tweetId, "in_reply_to": replyId}
ghostban = False ghostban = False
...@@ -442,7 +442,7 @@ def searchban(screen_name): ...@@ -442,7 +442,7 @@ def searchban(screen_name):
if c_ent["entryId"].startswith("conversationthread"): if c_ent["entryId"].startswith("conversationthread"):
print("Checking more contents of {} by {}".format(tweetId, screen_name)) print("Checking more contents of {} by {}".format(tweetId, screen_name))
for c_item in c_ent["content"]["items"]: for c_item in c_ent["content"]["items"]:
if c_item["item"]["itemContent"]["tweet_results"]["result"]["legacy"]["user_id_str"] == user_id: if "legacy" in c_item["item"]["itemContent"]["tweet_results"]["result"] and c_item["item"]["itemContent"]["tweet_results"]["result"]["legacy"]["user_id_str"] == user_id:
replyId = c_item["item"]["itemContent"]["tweet_results"]["result"]["legacy"]["id_str"] replyId = c_item["item"]["itemContent"]["tweet_results"]["result"]["legacy"]["id_str"]
returnjson["tests"]["more_replies"] = {"ban": True, "in_reply_to": replyId, "tweet": tweetId} returnjson["tests"]["more_replies"] = {"ban": True, "in_reply_to": replyId, "tweet": tweetId}
print("{} is reply deboosted because of {} => {}.".format(screen_name, tweetId, replyId)) print("{} is reply deboosted because of {} => {}.".format(screen_name, tweetId, replyId))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment