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
0a2b143e
Commit
0a2b143e
authored
Dec 22, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
it really was too slow
parent
7198a7e2
Pipeline
#18767
passed with stage
in 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
backend_requests.py
backend_requests.py
+12
-6
No files found.
backend_requests.py
View file @
0a2b143e
...
@@ -249,7 +249,6 @@ def searchban(screen_name):
...
@@ -249,7 +249,6 @@ def searchban(screen_name):
# print(replies.text)
# print(replies.text)
try
:
try
:
foundTweet
=
False
ghostban
=
True
ghostban
=
True
ghostTweetId
=
None
ghostTweetId
=
None
ghostReplyId
=
None
ghostReplyId
=
None
...
@@ -258,15 +257,22 @@ def searchban(screen_name):
...
@@ -258,15 +257,22 @@ def searchban(screen_name):
showmoreReplyId
=
None
showmoreReplyId
=
None
repliesJson
=
replies
.
json
()
repliesJson
=
replies
.
json
()
maindata
=
repliesJson
[
"data"
][
"user"
][
"result"
][
"timeline"
][
"timeline"
][
"instructions"
]
maindata
=
repliesJson
[
"data"
][
"user"
][
"result"
][
"timeline"
][
"timeline"
][
"instructions"
]
checkedTweets
=
set
()
for
d
in
maindata
:
for
d
in
maindata
:
if
not
ghostban
:
# all checks done
break
if
d
[
"type"
]
==
"TimelineAddEntries"
:
if
d
[
"type"
]
==
"TimelineAddEntries"
:
for
ent
in
d
[
"entries"
]:
for
ent
in
d
[
"entries"
]:
if
not
ghostban
:
# all checks done
break
if
ent
[
"entryId"
]
.
startswith
(
"tweet"
):
if
ent
[
"entryId"
]
.
startswith
(
"tweet"
):
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
:
if
"in_reply_to_status_id_str"
in
tmp
and
tmp
[
"in_reply_to_status_id_str"
]
not
in
checkedTweets
:
reply
=
tmp
reply
=
tmp
tweetId
=
reply
[
"in_reply_to_status_id_str"
]
tweetId
=
reply
[
"in_reply_to_status_id_str"
]
foundTweet
=
True
checkedTweets
.
add
(
tweetId
)
if
ghostTweetId
is
None
:
if
ghostTweetId
is
None
:
ghostTweetId
=
tweetId
ghostTweetId
=
tweetId
ghostReplyId
=
reply
[
"id_str"
]
ghostReplyId
=
reply
[
"id_str"
]
...
@@ -290,12 +296,12 @@ def searchban(screen_name):
...
@@ -290,12 +296,12 @@ def searchban(screen_name):
continue
continue
insts
=
tweetdetails
.
json
()[
"data"
][
"threaded_conversation_with_injections"
][
"instructions"
]
insts
=
tweetdetails
.
json
()[
"data"
][
"threaded_conversation_with_injections"
][
"instructions"
]
for
inst
in
insts
:
for
inst
in
insts
:
if
not
ghostban
and
showmore
:
if
not
ghostban
:
# all checks done
# all checks done
break
break
if
inst
[
"type"
]
==
"TimelineAddEntries"
:
if
inst
[
"type"
]
==
"TimelineAddEntries"
:
for
ent
in
inst
[
"entries"
]:
for
ent
in
inst
[
"entries"
]:
if
not
ghostban
and
showmore
:
if
not
ghostban
:
# all checks done
# all checks done
break
break
print
(
"Current entry of {} is: {}"
.
format
(
screen_name
,
ent
[
"entryId"
]))
print
(
"Current entry of {} is: {}"
.
format
(
screen_name
,
ent
[
"entryId"
]))
...
@@ -330,7 +336,7 @@ def searchban(screen_name):
...
@@ -330,7 +336,7 @@ def searchban(screen_name):
print
(
"{} is reply deboosted because of {} => {}."
.
format
(
screen_name
,
tweetId
,
replyId
))
print
(
"{} is reply deboosted because of {} => {}."
.
format
(
screen_name
,
tweetId
,
replyId
))
showmore
=
True
showmore
=
True
break
break
if
foundTweet
:
if
len
(
checkedTweets
)
>
0
:
if
ghostban
:
if
ghostban
:
print
(
"{} is ghost banned."
.
format
(
screen_name
))
print
(
"{} is ghost banned."
.
format
(
screen_name
))
returnjson
[
"tests"
][
"ghost"
]
=
{
returnjson
[
"tests"
][
"ghost"
]
=
{
...
...
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