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
ebd0f953
Commit
ebd0f953
authored
Feb 05, 2020
by
Raphael Beer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: return proper errors on ghost and deboost tests
parent
89f91b49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
backend.py
backend.py
+8
-3
No files found.
backend.py
View file @
ebd0f953
...
...
@@ -290,6 +290,7 @@ class TwitterSession:
except
:
debug
(
'Unexpected Exception:'
)
debug
(
traceback
.
format_exc
())
return
{
"error"
:
"EUNKNOWN"
}
async
def
test_barrier
(
self
,
user_id
,
screen_name
):
try
:
...
...
@@ -298,6 +299,7 @@ class TwitterSession:
reply_tweet_ids
=
[]
debug
(
str
(
tweet_ids
));
for
tid
in
tweet_ids
:
if
"in_reply_to_status_id_str"
not
in
tweets_replies
[
"globalObjects"
][
"tweets"
][
tid
]
or
tweets_replies
[
"globalObjects"
][
"tweets"
][
tid
][
"user_id_str"
]
!=
user_id
:
continue
...
...
@@ -373,12 +375,13 @@ class TwitterSession:
# happens when replied_to_id tweet has been deleted
debug
(
'outer loop return
\n
'
)
return
return
{
"error"
:
"EUNKNOWN"
}
except
:
debug
(
'Unexpected Exception in test_barrier:
\n
'
)
debug
(
traceback
.
format_exc
())
return
{
"error"
:
"EUNKNOWN"
}
async
def
test
(
self
,
username
,
more_replies_test
=
True
):
async
def
test
(
self
,
username
):
result
=
{
"timestamp"
:
time
.
time
()}
profile
=
{}
profile_raw
=
await
self
.
profile_raw
(
username
)
...
...
@@ -446,8 +449,10 @@ class TwitterSession:
else
:
result
[
"tests"
][
"ghost"
]
=
{
"ban"
:
False
}
if
more_replies_test
and
not
get_nested
(
result
,
[
"tests"
,
"ghost"
,
"ban"
],
False
):
if
not
get_nested
(
result
,
[
"tests"
,
"ghost"
,
"ban"
],
False
):
result
[
"tests"
][
"more_replies"
]
=
await
self
.
test_barrier
(
user_id
,
profile
[
'screen_name'
])
else
:
result
[
"tests"
][
"more_replies"
]
=
{
"error"
:
"EISGHOSTED"
}
debug
(
'['
+
profile
[
'screen_name'
]
+
'] Writing result to DB'
)
db
.
write_result
(
result
)
...
...
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