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
6e20b88e
Commit
6e20b88e
authored
Aug 24, 2019
by
root
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
050d3043
d115a0b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
backend.py
backend.py
+12
-7
requirements.txt
requirements.txt
+1
-0
No files found.
backend.py
View file @
6e20b88e
...
...
@@ -481,6 +481,10 @@ async def login_guests():
await
asyncio
.
gather
(
*
[
s
.
login
()
for
s
in
guest_sessions
])
log
(
"Guest sessions created"
)
def
ensure_dir
(
path
):
if
os
.
path
.
isdir
(
path
)
is
False
:
print
(
'Creating directory
%
s'
%
path
)
os
.
mkdir
(
path
)
parser
=
argparse
.
ArgumentParser
(
description
=
'Twitter Shadowban Tester'
)
parser
.
add_argument
(
'--account-file'
,
type
=
str
,
default
=
'.htaccounts'
,
help
=
'json file with reference account credentials'
)
...
...
@@ -494,24 +498,25 @@ parser.add_argument('--mongo-port', type=int, default=27017, help='port of mongo
parser
.
add_argument
(
'--mongo-db'
,
type
=
str
,
default
=
'tester'
,
help
=
'name of mongo database to use'
)
args
=
parser
.
parse_args
()
db
=
connect
(
host
=
args
.
mongo_host
,
port
=
args
.
mongo_port
)
ensure_dir
(
args
.
cookie_dir
)
with
open
(
args
.
account_file
,
"r"
)
as
f
:
accounts
=
json
.
loads
(
f
.
read
())
if
os
.
path
.
isdir
(
'./logs'
)
is
False
:
print
(
'Creating ./logs directory'
)
os
.
mkdir
(
'./logs'
)
if
args
.
log
is
not
None
:
print
(
"Logging test results to
%
s"
,
args
.
log
)
print
(
"Logging test results to
%
s"
%
args
.
log
)
log_dir
=
os
.
path
.
dirname
(
args
.
log
)
ensure_dir
(
log_dir
)
log_file
=
open
(
args
.
log
,
"a"
)
if
args
.
debug
is
not
None
:
print
(
"Logging debug output to
%
s"
,
args
.
debug
)
print
(
"Logging debug output to
%
s"
%
args
.
debug
)
debug_dir
=
os
.
path
.
dirname
(
args
.
debug
)
ensure_dir
(
debug_dir
)
debug_file
=
open
(
args
.
debug
,
"a"
)
def
run
():
db
=
connect
(
host
=
args
.
mongo_host
,
port
=
args
.
mongo_port
)
loop
=
asyncio
.
get_event_loop
()
loop
.
run_until_complete
(
login_accounts
(
accounts
,
args
.
cookie_dir
))
loop
.
run_until_complete
(
login_guests
())
...
...
requirements.txt
View file @
6e20b88e
aiohttp
pymongo
bs4
daemon
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