Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
shadowban-eu-backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
shadowban-eu-backend
Commits
62c743f2
Commit
62c743f2
authored
May 04, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ghost and reply deboost
parent
5462d3a9
Pipeline
#12428
passed with stage
in 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
+23
-19
backend_requests.py
backend_requests.py
+23
-19
No files found.
backend_requests.py
View file @
62c743f2
...
...
@@ -216,7 +216,6 @@ def searchban(screen_name):
insts
=
tweetdetails
.
json
()[
"data"
][
"threaded_conversation_with_injections"
][
"instructions"
]
showmore
=
False
for
inst
in
insts
:
if
inst
[
"type"
]
==
"TimelineAddEntries"
:
...
...
@@ -224,17 +223,19 @@ def searchban(screen_name):
print
(
"Current entry of {} is: {}"
.
format
(
screen_name
,
ent
[
"entryId"
]))
if
ent
[
"entryId"
]
.
startswith
(
"conversationthread"
):
ghostban
=
True
inReplyTo
=
"-1"
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
:
returnjson
[
"tests"
][
"ghost"
]
=
{
"ban"
:
False
}
ghostban
=
False
break
if
"tweet_results"
in
item
[
"item"
][
"itemContent"
]:
if
item
[
"item"
][
"itemContent"
][
"tweet_results"
][
"result"
][
"legacy"
][
"user_id_str"
]
==
user_id
:
returnjson
[
"tests"
][
"ghost"
]
=
{
"ban"
:
False
,
"in_reply_to"
:
item
[
"item"
][
"itemContent"
][
"tweet_results"
][
"result"
][
"legacy"
][
"id_str"
]}
ghostban
=
False
break
else
:
inReplyTo
=
item
[
"item"
][
"itemContent"
][
"tweet_results"
][
"result"
][
"legacy"
][
"id_str"
]
if
ghostban
:
print
(
"{} is ghost banned."
.
format
(
screen_name
))
returnjson
[
"tests"
][
"ghost"
]
=
{
"ban"
:
True
}
returnjson
[
"tests"
][
"ghost"
]
=
{
"ban"
:
True
,
"in_reply_to"
:
item
[
"item"
][
"itemContent"
][
"tweet_results"
][
"result"
][
"legacy"
][
"id_str"
]}
if
ent
[
"entryId"
]
.
startswith
(
"cursor-bottom"
):
print
(
"{}'s test touched bottom."
.
format
(
screen_name
))
#returnjson["tests"]["ghost"] = {}
...
...
@@ -255,26 +256,29 @@ def searchban(screen_name):
break
for
c_ent
in
c_i
[
"entries"
]:
if
c_ent
[
"entryId"
]
.
startswith
(
"conversationthread"
):
more
=
True
#
more = True
print
(
"Checking more contents of {}"
.
format
(
screen_name
))
for
c_item
in
c_ent
[
"content"
][
"items"
]:
if
c_item
[
"item"
][
"itemContent"
][
"tweet_results"
][
"result"
][
"legacy"
][
"user_id_str"
]
==
user_id
:
returnjson
[
"tests"
][
"ghost"
]
=
{
"ban"
:
False
}
returnjson
[
"tests"
][
"more_replies"
]
=
{
"ban"
:
True
,
"
tweet"
:
reply
[
"id_str"
],
"in_reply_to"
:
c_item
[
"item"
][
"itemContent"
][
"tweet_results"
][
"result"
][
"legacy"
][
"id_str"
]
}
inReplyTo
=
c_item
[
"item"
][
"itemContent"
][
"tweet_results"
][
"result"
][
"legacy"
][
"id_str"
]
# returnjson["tests"]["ghost"] = {"ban": False, "in_reply_to": inReplyTo
}
returnjson
[
"tests"
][
"more_replies"
]
=
{
"ban"
:
True
,
"
in_reply_to"
:
inReplyTo
}
print
(
"{} is reply deboosted."
.
format
(
screen_name
))
more
=
False
#
more = False
break
if
more
:
print
(
"{} is both ghost banned and reply deboosted."
.
format
(
screen_name
))
returnjson
[
"tests"
][
"ghost"
]
=
{
"ban"
:
True
}
returnjson
[
"tests"
][
"more_replies"
]
=
{
"ban"
:
True
}
#
if more:
#
print("{} is both ghost banned and reply deboosted.".format(screen_name))
#
returnjson["tests"]["ghost"] = {"ban": True}
#
returnjson["tests"]["more_replies"] = {"ban": True}
if
not
showmore
:
returnjson
[
"tests"
][
"more_replies"
]
=
{
"ban"
:
False
,
"in_reply_to"
:
"-1"
,
"tweet"
:
"-1"
}
replyTweet
=
reply
[
"id_str"
]
for
testField
in
[
"ghost"
,
"more_replies"
]:
if
testField
in
returnjson
[
"tests"
]:
returnjson
[
"tests"
][
testField
][
"tweet"
]
=
replyTweet
except
KeyError
as
e
:
print
(
"Errored testing {}"
.
format
(
screen_name
))
print
(
Exception
.
with_traceback
(
e
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment