Skip to main content

aclogin

AtCoderのセッションクッキーを各種ツールに保存するためのツール

概要

AtCoderでは、CAPTCHAの導入によりコマンドラインツールからの自動ログインができなくなりました。 このツールは、ブラウザでログインした後のセッションクッキー(REVEL_SESSION)を取得し、 各種コマンドラインツール(oj等)のクッキーファイルに保存することで、ツールからのAtCoderへのアクセスを可能にします。

インストール方法

pip install aclogin

使い方

1. AtCoderにログイン

ブラウザでAtCoderにログインします。

2. REVEL_SESSIONクッキーを取得

REVEL_SESSIONクッキーはhttpOnly属性が設定されているため、JavaScriptから直接取得できません。以下の手順で手動で取得してください。

Step 1: 開発者ツールを開く

キーボードで F12 キーを押すか、右クリックして「検証」または「Inspect」を選択します。

Step 2: Application/Storageタブを開く

開発者ツールの上部メニューから「Application」タブをクリックします。(Firefoxの場合は「Storage」タブ)

左側のサイドバーから「Cookies」→「https://atcoder.jp 」を選択します。

Step 3: REVEL_SESSIONの値をコピー

クッキーの一覧から「REVEL_SESSION」という名前の行を探します。

「Value」列の値をダブルクリックして選択し、右クリックしてコピーするか、Ctrl+C(MacならCmd+C)でコピーします。

3. CLIツールでクッキーを保存

ターミナルで以下のコマンドを実行します。

aclogin

プロンプトが表示されたら、コピーしたREVEL_SESSIONクッキーの値を貼り付けます(Ctrl+V)。

オプション

usage: aclogin [-h] [--tools TOOLS [TOOLS ...]] [--oj-cookie-path OJ_COOKIE_PATH] [--acc-cookie-path ACC_COOKIE_PATH]

AtCoder の REVEL_SESSION クッキーを各種ツールに保存します

optional arguments:
  -h, --help            ヘルプメッセージを表示して終了
  --tools TOOLS [TOOLS ...]
                        クッキーを保存するツール名(指定なしの場合は自動検出)
  --oj-cookie-path OJ_COOKIE_PATH
                        oj のクッキーファイルのパス
  --acc-cookie-path ACC_COOKIE_PATH
                        acc のセッションファイルのパス

対応ツール

現在、以下のツールに対応しています:

ライセンス

MIT

Metadata

Release files for aclogin 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aclogin 0.2.1
File Size Uploaded Provenance Actions
aclogin-0.2.1.tar.gz 6.5 kB Without provenance Details for aclogin-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aclogin 0.2.1
File Interpreter ABI Platform Actions
aclogin-0.2.1-py3-none-any.whl Python 3 none any Details for aclogin-0.2.1-py3-none-any.whl

Total release size: 13.5 kB

Release files / aclogin-0.2.1.tar.gz

Download URL aclogin-0.2.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cd46e44a7c039aed4fcfffd9b3fbf301898d8453f34cbefc3de5d5f4225f7554
BLAKE2b-256 checksum
How to use checksums
20203e80f39b968123c5fb8839f4e698844b7492ee0299203dcaf5db8d7bc2e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / aclogin-0.2.1-py3-none-any.whl

Download URL aclogin-0.2.1-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c3afe45d8e62a3ef925c6aadae6317d0f5e29a44d254f2f8111dce9f6a837c9
BLAKE2b-256 checksum
How to use checksums
b5a2f7b71a643750c0044cdc7a6226ea54073b0263f8abb4e4277b79ba0fc53d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Security for aclogin 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page