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
e3ec854d
Commit
e3ec854d
authored
Jan 31, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated log and some logics
parent
6c5ea85e
Pipeline
#9128
passed with stage
in 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
backend_requests.py
backend_requests.py
+13
-9
No files found.
backend_requests.py
View file @
e3ec854d
...
...
@@ -23,6 +23,7 @@ def shadowban(screen_name):
@
app
.
route
(
"/<screen_name>"
)
def
searchban
(
screen_name
):
print
(
"Checking {}"
.
format
(
screen_name
))
returnjson
=
{
"timestamp"
:
time
.
time
(),
"profile"
:
{
...
...
@@ -169,7 +170,7 @@ def searchban(screen_name):
reply
=
None
print
(
user_id
)
print
(
"User ID of {}: {}"
.
format
(
screen_name
,
user_id
)
)
get_reply_vars
=
{
"count"
:
700
,
"userId"
:
user_id
,
"includePromotedContent"
:
False
,
"withSuperFollowsUserFields"
:
False
,
"withBirdwatchPivots"
:
False
,
...
...
@@ -215,7 +216,7 @@ def searchban(screen_name):
if
inst
[
"type"
]
==
"TimelineAddEntries"
:
for
ent
in
inst
[
"entries"
]:
print
(
ent
[
"entryId"
]
)
print
(
"Current entry of {} is: {}"
.
format
(
screen_name
,
ent
[
"entryId"
])
)
if
ent
[
"entryId"
]
.
startswith
(
"conversationthread"
):
ghostban
=
True
for
item
in
ent
[
"content"
][
"items"
]:
...
...
@@ -226,11 +227,11 @@ def searchban(screen_name):
ghostban
=
False
break
if
ghostban
:
print
(
"
Hello"
)
print
(
"
{} is ghost banned."
.
format
(
screen_name
)
)
returnjson
[
"tests"
][
"ghost"
]
=
{
"ban"
:
True
}
if
ent
[
"entryId"
]
.
startswith
(
"cursor-bottom"
):
print
(
"
hi"
)
print
(
"
{}'s test touched bottom."
.
format
(
screen_name
)
)
returnjson
[
"tests"
][
"ghost"
]
=
{}
returnjson
[
"tests"
][
"more_replies"
]
=
{}
break
...
...
@@ -250,15 +251,17 @@ def searchban(screen_name):
for
c_ent
in
c_i
[
"entries"
]:
if
c_ent
[
"entryId"
]
.
startswith
(
"conversationthread"
):
more
=
True
print
(
"
more"
)
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"
]}
print
(
"{} is reply deboosted."
.
format
(
screen_name
))
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
not
showmore
:
...
...
@@ -273,12 +276,13 @@ def searchban(screen_name):
returnjson
[
"tests"
][
"more_replies"
]
=
{}
print
(
"ban"
in
returnjson
[
"tests"
][
"more_replies"
])
print
(
"ban"
in
returnjson
[
"tests"
][
"ghost"
])
print
(
returnjson
[
"tests"
][
"ghost"
])
#
print("ban" in returnjson["tests"]["more_replies"])
#
print("ban" in returnjson["tests"]["ghost"])
#
print(returnjson["tests"]["ghost"])
if
"ban"
not
in
returnjson
[
"tests"
][
"more_replies"
]
and
"ban"
in
returnjson
[
"tests"
][
"ghost"
]
and
returnjson
[
"tests"
][
"ghost"
][
"ban"
]
==
False
:
returnjson
[
"tests"
][
"more_replies"
]
=
=
{
"ban"
:
False
}
returnjson
[
"tests"
][
"more_replies"
]
=
{
"ban"
:
False
}
print
(
"Result of {}: {}"
.
format
(
screen_name
,
json
.
dumps
(
returnjson
)))
return
returnjson
if
__name__
==
'__main__'
:
...
...
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