File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88def get_csrf_token ():
99 response = globals .session .session .get (Constants .LOGIN_PAGE )
10- return helpers .get_shared_data (response .text ).get ("csrf_token" , None )
10+ helper_res = helpers .get_shared_data (response .text )
11+ return helper_res .get ("csrf_token" , None )
1112
1213def do_login ():
1314 now_epoch = int (datetime .now ().timestamp ())
Original file line number Diff line number Diff line change @@ -89,7 +89,10 @@ def get_shared_data(data):
8989 match = re .search (r"\"raw\":\"({[^\n]*\\\"})" , data )
9090 if match :
9191 match_str = string_escape (match .group (1 ))
92- return json .loads (match_str )
92+ csrf_token = re .search (r'"csrf_token":\s*"([^"]+)"' , match_str )
93+ csrf_token_value = csrf_token .group (1 )
94+ response = {"csrf_token" : csrf_token_value }
95+ return response
9396
9497def lock_exists ():
9598 return os .path .isfile (os .path .join (globals .config .download_path , globals .download .download_user + '.lock' ))
Original file line number Diff line number Diff line change 11argparse >= 1.4.0
2- configparser >= 4.0.2
2+ configparser >= 4.0.2
3+ requests == 2.30.0
You can’t perform that action at this time.
0 commit comments