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
c99b7fa4
Commit
c99b7fa4
authored
Dec 07, 2019
by
Raphael Beer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add: return discernable ENOREPLIES error when more_replies doesn't find a reply
parent
1e4bc11e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
backend.py
backend.py
+6
-5
No files found.
backend.py
View file @
c99b7fa4
...
...
@@ -128,7 +128,6 @@ class TwitterSession:
self
.
next_refresh
=
time
.
time
()
+
3600
self
.
_headers
[
'X-Guest-Token'
]
=
self
.
_guest_token
async
def
login
(
self
,
username
=
None
,
password
=
None
,
email
=
None
,
cookie_dir
=
None
):
self
.
_session
=
aiohttp
.
ClientSession
()
...
...
@@ -297,7 +296,7 @@ class TwitterSession:
tweets_replies
=
await
self
.
get_profile_tweets_raw
(
user_id
)
tweet_ids
=
self
.
get_ordered_tweet_ids
(
tweets_replies
)
filtered
_ids
=
[]
reply_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
:
...
...
@@ -306,11 +305,13 @@ class TwitterSession:
conversation_tweet
=
get_nested
(
tweets_replies
,
[
"globalObjects"
,
"tweets"
,
tweet
[
"conversation_id_str"
]])
if
conversation_tweet
is
not
None
and
conversation_tweet
.
get
(
"user_id_str"
)
==
user_id
:
continue
filtered
_ids
.
append
(
tid
)
reply_tweet
_ids
.
append
(
tid
)
# debug('Filtered ids for user ' + user_id + ': ' + str(filtered_ids) + '\n\n\n')
# return error message, when user has not made any reply tweets
if
not
reply_tweet_ids
:
return
{
"error"
:
"ENOREPLIES"
}
for
tid
in
filtered
_ids
:
for
tid
in
reply_tweet
_ids
:
replied_to_id
=
tweets_replies
[
"globalObjects"
][
"tweets"
][
tid
]
.
get
(
"in_reply_to_status_id_str"
,
None
)
if
replied_to_id
is
None
:
continue
...
...
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