Massprice/templates/session.html
Barely Removable 48d8bac332
All checks were successful
Deploy / deploy (push) Successful in 25s
Replace Chrome-remote-debugging login capture with a cookie-paste import flow
Live testing showed the CDP approach still fails hCaptcha even with a
real human clicking through chrome://inspect: the headless Chromium's
own fingerprint (HeadlessChrome user-agent, navigator.webdriver=true)
is what gets flagged, independent of who's driving it. Trying to
disguise that browser to get past bot detection would be captcha
evasion, not a session-handling technique, so that path is dropped
entirely rather than patched further.

New flow: log into MassPrice with an ordinary, non-automated browser
(hCaptcha passes normally), export the session's cookies with a
extension, and paste them into the Session page. import_cookies()
converts the export into Playwright's storage_state shape and verifies
it actually authenticates against the live site before saving it,
so a bad paste never clobbers a working session. This also removes the
now-unnecessary socat proxy / debug port exposure — Chromium's own
CDP port was only ever needed for the dropped approach.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6TgffxTvYhqxykAbVQg2v
2026-08-31 20:10:51 -07:00

45 lines
2.1 KiB
HTML

{% extends "_shell.html" %}
{% block title %}Session &middot; MassPrice Scheduler{% endblock %}
{% block content %}
<h1>MassPrice Login Session</h1>
<div class="panel panel-narrow">
<h2>Status</h2>
{% if status.state == 'saved' %}
<p><span class="status-dot status-success"></span>Session saved {{ status.saved_at }}</p>
<p class="muted small">If scheduled runs start failing with a "session expired" error, come back here and import a fresh export.</p>
{% else %}
<p><span class="status-dot status-failure"></span>No session saved yet &mdash; scheduled runs will fail until you import one.</p>
{% endif %}
</div>
<div class="panel panel-narrow">
<h2>Log in</h2>
<p class="muted small">
MassPrice's login is protected by hCaptcha, which blocks any automated
sign-in attempt &mdash; including a real click relayed through a headless
browser, since the browser itself gets flagged. There's no way around
this: log in with your own ordinary Chrome instead, then copy that
session over.
</p>
<ol class="session-steps">
<li>Log into <a href="https://massprice.tcgplayer.com/" target="_blank" rel="noopener">massprice.tcgplayer.com</a>
normally, in your own Chrome.</li>
<li>Install the <strong>Cookie-Editor</strong> extension (free, from the
Chrome Web Store) if you don't already have it.</li>
<li>While still on the massprice.tcgplayer.com tab (not the login page),
click the Cookie-Editor icon, then <strong>Export</strong> &rarr;
<strong>Export as JSON</strong> &mdash; this copies the cookies to your
clipboard.</li>
<li>Paste them into the box below and click <strong>Import Session</strong>.</li>
</ol>
<textarea id="cookie-paste" class="cookie-textarea" placeholder='[{"domain": ".tcgplayer.com", "name": "...", ...}]' rows="8"></textarea>
<div class="session-actions">
<button id="session-import" type="button" class="btn btn-primary">Import Session</button>
</div>
</div>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='js/app.js') }}"></script>
{% endblock %}