Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions apps/ticketscraping/connection/asyn_tasks_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@


def run_prepare():
# start receiver socket
from apps.ticketscraping.connection.mail_receiver import run
conn_process = Process(target=run, daemon=True)
conn_process.start()

# start sender socket
from apps.ticketscraping.schedulers.mail_scheduler import mail_scheduler
conn_thread = Thread(target=mail_scheduler.connect)
conn_thread.start()
# wait for mailer to connect
conn_thread.join()
# # start receiver socket
# from apps.ticketscraping.connection.mail_receiver import run
# conn_process = Process(target=run, daemon=True)
# conn_process.start()

# # start sender socket
# from apps.ticketscraping.schedulers.mail_scheduler import mail_scheduler
# conn_thread = Thread(target=mail_scheduler.connect)
# conn_thread.start()
# # wait for mailer to connect
# conn_thread.join()

# start itself
from apps.ticketscraping.tasks.asynchronous import run_async_tasks
Expand Down
1 change: 1 addition & 0 deletions apps/ticketscraping/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ def get_top_picks_query_params(qty: int, target_price: int, tolerance: int): ret

INJECTOR_LOCATION = "js/injector.js"
INJECTOR_HEADER_LOCATION = "js/injector-header.js"
EPSF_CONTENT = "js/epsf.js"
RENNABLE_FILENAME = "js/antibot-simulation.js"
1 change: 1 addition & 0 deletions apps/ticketscraping/js/epsf.js

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions apps/ticketscraping/prepare_reese84token.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ def readFileContentToString(filename):
return content

# fetch the javascript that generates the reese84
antibot_js_code_full = requests.get(constants.ANTIBOT_JS_CODE_URL).text

# trim the code to the function that is only used
match_obj = re.search(constants.FN_MATCHING_REGEX, antibot_js_code_full)
if not match_obj:
raise Exception('reese84 manufacture fails')
start, end = match_obj.span()
antibot_js_code_trim = antibot_js_code_full[start:end]
# antibot_js_code_full = requests.get(constants.ANTIBOT_JS_CODE_URL).text
antibot_js_code_loc = os.path.join(
os.path.dirname(__file__), constants.EPSF_CONTENT);
antibot_js_code_trim = readFileContentToString(antibot_js_code_loc)

# # trim the code to the function that is only used
# match_obj = re.search(constants.FN_MATCHING_REGEX, antibot_js_code_full)
# if not match_obj:
# raise Exception('reese84 manufacture fails')
# start, end = match_obj.span()
# antibot_js_code_trim = antibot_js_code_full[start:end]

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