Skip to content

SohamProg/LeetcodeAutomater

 
 

Repository files navigation

LeetCode Automater

The LeetCodeAutomater project provides an easy way to automate the submission of solutions to LeetCode using your LeetCode session and CSRF token. This repository includes both a Chrome Extension to fetch the required session data and an Executable to run the automation process.

🧩 Features

  • Automatic Code Submission: Submits your Java solutions directly to LeetCode.

  • Skip Premium & Database-Only Questions: Filters out premium-only and database-based problems.

  • Progress Tracking: Keeps track of submitted and skipped questions via progress.json and skipped.log.

  • Chrome Extension for Token Fetching: Fetches your LeetCode session and CSRF tokens locally for secure authentication.

  • Easy Setup & Use: Includes both a Chrome extension and an executable for quick deployment.

📂 Project Structure

LeetcodeAutomater
|   ok.js                     # Main Node.js script (if running from source)
|   .gitignore
|   CODE_OF_CONDUCT.md
|   LICENSE
|   merged_output.json        # Contains problem info (id, walkcc_url, leetcode_url)
|   README.md
|   
+---LeetCode-Token-Viewer     # Chrome extension files
|   |   manifest.json
|   |   popup.html
|   |   popup.js
|   |
|   \---icons
|           icon128.png
|           icon16.png
|           icon32.png
|           icon48.png
|
\---website                     # for website of this project
        index.css
        index.html
        leet1.jpg

📋 Prerequisites

Before you begin, ensure you have the following installed on your system:

  • Node.js (optional, You can Simply use the .exe)- Download Node.js
  • Chrome Based browser
  • LeetCode Account - Make sure you're logged in to LeetCode
  • Git (optional, for cloning the repository)

🧑‍💻 How to Run the LeetCodeAutomater

1. Download the Chrome extension

There are two options:

2. Load the Extension in Chrome

  • Open Chrome and go to: chrome://extensions

  • Enable Developer Mode (toggle at top-right)

  • Click Load unpacked

  • Select the folder LeetCode Token Viewer

3. Run the Program

You can run it in two ways:

  • Option 1: Run the executable

    💻 LeetcodeAutomater.exe (Download)

  • Option 2: Run from source

    git clone https://github.com/Omkumar2003/LeetcodeAutomater.git
    cd LeetcodeAutomater
    node ok.js
    

4. Get & Use Your Merge Token

When you run the program, it will prompt for your Merge Token.

  • Make sure you’re logged into LeetCode in your browser.
  • Open the Chrome Extension → click Copy Merge Token.
  • Paste the token into the program when prompted.

⚙ Executable(.exe) — LeetCode Automater

The LeetCode Automater executable automates the process of submitting your solutions to LeetCode, powered by the Merge Token you fetch with the Chrome Extension.

🛠 How to Build the Executable(.exe) (Optional)

If you'd prefer to build the executable manually:

npm install -g pkg
pkg ok.js --targets node18-win-x64  --output LeetcodeAutomater.exe

This is how the provided executable LeetcodeAutomater.exe was created.

Common Issues and Solutions:

Issue 1: Extension not loading in Chrome

  • Make sure Developer Mode is enabled in chrome://extensions
  • Check if you selected the correct folder (LeetCode-Token-Viewer)
  • Try reloading the extension

Issue 2: "Merge Token not found" error

  • Ensure you're logged into LeetCode in your browser
  • Open the Chrome Extension and click "Copy Merge Token"
  • The token is only valid while you're logged in

Issue 3: Executable not working

  • Try running from source instead (Option 2)

If you encounter other issues, please open an issue on GitHub.

👥 Contributors

We appreciate all the amazing people who have contributed to this project! 🚀

How to Contribute

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/YourFeature)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add some feature')
  5. Push to the branch (git push origin feature/YourFeature)
  6. Open a Pull Request

About

LeetCode Auto Submission Script

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 50.2%
  • HTML 25.5%
  • CSS 24.3%