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
cbc1a894
Commit
cbc1a894
authored
Aug 22, 2019
by
Raphael Beer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: missed TwitterSession.screen_name -> .username rename
parent
663dbe20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
backend.py
backend.py
+4
-4
No files found.
backend.py
View file @
cbc1a894
...
@@ -117,7 +117,7 @@ class TwitterSession:
...
@@ -117,7 +117,7 @@ class TwitterSession:
result
=
await
r
.
json
()
result
=
await
r
.
json
()
# debug('Tweet request ' + tweet_id + ':\n' + str(r) + '\n\n' + json.dumps(result) + '\n\n\n')
# debug('Tweet request ' + tweet_id + ':\n' + str(r) + '\n\n' + json.dumps(result) + '\n\n\n')
self
.
set_csrf_header
()
self
.
set_csrf_header
()
if
self
.
screen_
name
is
not
None
:
if
self
.
user
name
is
not
None
:
self
.
monitor_rate_limit
(
r
.
headers
)
self
.
monitor_rate_limit
(
r
.
headers
)
if
retry_csrf
and
isinstance
(
result
.
get
(
"errors"
,
None
),
list
)
and
len
([
x
for
x
in
result
[
"errors"
]
if
x
.
get
(
"code"
,
None
)
==
353
]):
if
retry_csrf
and
isinstance
(
result
.
get
(
"errors"
,
None
),
list
)
and
len
([
x
for
x
in
result
[
"errors"
]
if
x
.
get
(
"code"
,
None
)
==
353
]):
return
await
self
.
tweet_raw
(
tweet_id
,
count
,
cursor
,
False
)
return
await
self
.
tweet_raw
(
tweet_id
,
count
,
cursor
,
False
)
...
@@ -133,13 +133,13 @@ class TwitterSession:
...
@@ -133,13 +133,13 @@ class TwitterSession:
# rate limit reset
# rate limit reset
if
last_remaining
<
self
.
remaining
and
self
.
overshot
>
0
:
if
last_remaining
<
self
.
remaining
and
self
.
overshot
>
0
:
log
(
'[rate-limit] Reset detected for '
+
self
.
screen_
name
+
'. Saving overshoot count...'
)
log
(
'[rate-limit] Reset detected for '
+
self
.
user
name
+
'. Saving overshoot count...'
)
db
.
write_rate_limit
({
'screen_name'
:
self
.
screen_
name
,
'overshot'
:
self
.
overshot
})
db
.
write_rate_limit
({
'screen_name'
:
self
.
user
name
,
'overshot'
:
self
.
overshot
})
self
.
overshot
=
0
self
.
overshot
=
0
# count the requests that failed because of rate limiting
# count the requests that failed because of rate limiting
if
self
.
remaining
is
0
:
if
self
.
remaining
is
0
:
log
(
'[rate-limit] Limit hit by '
+
self
.
screen_
name
+
'.'
)
log
(
'[rate-limit] Limit hit by '
+
self
.
user
name
+
'.'
)
self
.
overshot
+=
1
self
.
overshot
+=
1
@
classmethod
@
classmethod
...
...
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