Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
physical
Commits
7671104d
Commit
7671104d
authored
Apr 22, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
d0de0ee7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
55 deletions
+0
-55
majia_email.txt
majia/majia_email.txt
+0
-0
tasks.py
majia/tasks.py
+0
-55
No files found.
majia/majia_email.txt
deleted
100644 → 0
View file @
d0de0ee7
This diff is collapsed.
Click to expand it.
majia/tasks.py
deleted
100644 → 0
View file @
d0de0ee7
import
requests
import
traceback
import
logging
from
celery
import
shared_task
login_url
=
"http://earth.igengmei.com/api/account/login_pwd"
def
index_first
():
try
:
r1
=
requests
.
get
(
login_url
)
return
r1
.
cookies
.
get_dict
()
except
:
logging
.
error
(
"index_first:
%
s"
%
traceback
.
format_exc
())
return
None
# @shared_task(name="majia.tasks.get_cook")
def
get_cook
():
data
=
open
(
"/srv/apps/physical/majia/majia_email.txt"
,
"r"
)
list
=
[]
dicts
=
{}
for
i
in
data
:
list
.
append
(
i
.
strip
(
'
\n
'
)
.
strip
(
','
))
for
i
in
list
:
cookies
=
index_first
()
post_dict
=
{
'account_type'
:
2
,
'pwd'
:
'123456'
,
'email'
:
i
}
response
=
requests
.
post
(
url
=
login_url
,
data
=
post_dict
,
cookies
=
cookies
)
headers
=
response
.
headers
print
(
response
.
text
)
cook
=
headers
[
'Set-Cookie'
]
.
split
(
";"
)
cook
=
cook
[
0
]
.
split
(
'='
)[
1
]
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
dicts
[
i
]
=
cook
dicts
=
get_cook
()
with
open
(
"/srv/apps/physical/majia/user_session.txt"
,
'w'
)
as
f
:
for
key
,
value
in
dicts
.
items
():
f
.
write
(
key
)
f
.
write
(
","
)
f
.
write
(
value
)
f
.
write
(
"
\n
"
)
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