Skip to content

Commit 7565ebf

Browse files
committed
Hot fix reese84 token generation due to token interrogation remote logic changed
1 parent e21fa1f commit 7565ebf

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

apps/ticketscraping/connection/asyn_tasks_receiver.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77

88
def run_prepare():
9-
# start receiver socket
10-
from apps.ticketscraping.connection.mail_receiver import run
11-
conn_process = Process(target=run, daemon=True)
12-
conn_process.start()
13-
14-
# start sender socket
15-
from apps.ticketscraping.schedulers.mail_scheduler import mail_scheduler
16-
conn_thread = Thread(target=mail_scheduler.connect)
17-
conn_thread.start()
18-
# wait for mailer to connect
19-
conn_thread.join()
9+
# # start receiver socket
10+
# from apps.ticketscraping.connection.mail_receiver import run
11+
# conn_process = Process(target=run, daemon=True)
12+
# conn_process.start()
13+
14+
# # start sender socket
15+
# from apps.ticketscraping.schedulers.mail_scheduler import mail_scheduler
16+
# conn_thread = Thread(target=mail_scheduler.connect)
17+
# conn_thread.start()
18+
# # wait for mailer to connect
19+
# conn_thread.join()
2020

2121
# start itself
2222
from apps.ticketscraping.tasks.asynchronous import run_async_tasks

apps/ticketscraping/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,5 @@ def get_top_picks_query_params(qty: int, target_price: int, tolerance: int): ret
8282

8383
INJECTOR_LOCATION = "js/injector.js"
8484
INJECTOR_HEADER_LOCATION = "js/injector-header.js"
85+
EPSF_CONTENT = "js/epsf.js"
8586
RENNABLE_FILENAME = "js/antibot-simulation.js"

apps/ticketscraping/js/epsf.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/ticketscraping/prepare_reese84token.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ def readFileContentToString(filename):
1414
return content
1515

1616
# fetch the javascript that generates the reese84
17-
antibot_js_code_full = requests.get(constants.ANTIBOT_JS_CODE_URL).text
18-
19-
# trim the code to the function that is only used
20-
match_obj = re.search(constants.FN_MATCHING_REGEX, antibot_js_code_full)
21-
if not match_obj:
22-
raise Exception('reese84 manufacture fails')
23-
start, end = match_obj.span()
24-
antibot_js_code_trim = antibot_js_code_full[start:end]
17+
# antibot_js_code_full = requests.get(constants.ANTIBOT_JS_CODE_URL).text
18+
antibot_js_code_loc = os.path.join(
19+
os.path.dirname(__file__), constants.EPSF_CONTENT);
20+
antibot_js_code_trim = readFileContentToString(antibot_js_code_loc)
21+
22+
# # trim the code to the function that is only used
23+
# match_obj = re.search(constants.FN_MATCHING_REGEX, antibot_js_code_full)
24+
# if not match_obj:
25+
# raise Exception('reese84 manufacture fails')
26+
# start, end = match_obj.span()
27+
# antibot_js_code_trim = antibot_js_code_full[start:end]
2528

2629
# inject the code to the javascript
2730
injector_js_code_loc = os.path.join(
@@ -52,4 +55,5 @@ def readFileContentToString(filename):
5255
token_json_res = requests.post(
5356
constants.TOKEN_INTERROGATION_URL, headers=constants.BASIC_REQ_HEADER, json=token)
5457
json_obj = token_json_res.json()
58+
print(json_obj['token'])
5559
return json_obj['token'], json_obj['renewInSec']

0 commit comments

Comments
 (0)