lzghades commited on
Commit
6717155
1 Parent(s): db407ae
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,6 +1,7 @@
1
  #!/usr/local/bin/python3
2
  # -*- coding: utf-8 -*-
3
 
 
4
  import time
5
  import os
6
  import requests
@@ -15,13 +16,14 @@ HEADERS = {'app-key': os.environ['a3'], 'origin': os.environ['a4'], 'referer': o
15
  def login(loginId, password):
16
  try:
17
  data = {'loginId': loginId, 'password': password}
18
- cookies = {'720yun_v8_session': os.environ['a3']}
19
 
20
  resp = requests.post(os.environ['a5'], data=data, headers=HEADERS, cookies=cookies)
21
-
22
  if resp.status_code == 200:
23
  return resp.json()['data']['token']
24
- except Exception:
 
25
  raise gr.Error('登录错误,请确认你的720yun账号是否正确')
26
 
27
 
 
1
  #!/usr/local/bin/python3
2
  # -*- coding: utf-8 -*-
3
 
4
+ import uuid
5
  import time
6
  import os
7
  import requests
 
16
  def login(loginId, password):
17
  try:
18
  data = {'loginId': loginId, 'password': password}
19
+ cookies = {'720yun_v8_session': uuid.uuid4()}
20
 
21
  resp = requests.post(os.environ['a5'], data=data, headers=HEADERS, cookies=cookies)
22
+ print(resp.text)
23
  if resp.status_code == 200:
24
  return resp.json()['data']['token']
25
+ except Exception as e:
26
+ print(e)
27
  raise gr.Error('登录错误,请确认你的720yun账号是否正确')
28
 
29