Skip to content

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

ESPN Cookies - Automated Login

A Next.js application that automates ESPN login and extracts authentication cookies (SWID and espn_s2) using Puppeteer.

Features

  • Automated ESPN login flow using Puppeteer headless browser
  • OTP-based email verification
  • Automatic cookie extraction (SWID and espn_s2)
  • Debug screenshot gallery for troubleshooting
  • Session management with automatic cleanup
  • Full logging and debugging capabilities

Prerequisites

  • Node.js 16+
  • npm or yarn
  • Valid ESPN account with email access

Installation

npm install

Getting Started

Development

npm run dev

Open http://localhost:3000 in your browser.

Build for Production

npm run build
npm start

Usage

  1. Navigate to the homepage
  2. Enter your ESPN email address
  3. Click "Send OTP"
  4. Check your email for the OTP code
  5. Enter the 6-digit OTP on the page
  6. Click "Verify OTP"
  7. The extracted SWID and ESPN S2 cookies will be displayed

Features

  • Automated Browser Control: Uses Puppeteer to automate the ESPN login process
  • Debug Screenshots: Captures screenshots at each step for troubleshooting
  • Session Management: Maintains browser sessions with automatic 30-minute timeout
  • OTP Verification: Handles multi-step OTP verification
  • Logging: Comprehensive logging for debugging

API Endpoints

POST /api/login-espn

Start Login

{
  "action": "start",
  "email": "user@example.com"
}

Verify OTP

{
  "action": "verify",
  "otp": "123456"
}

Headers:

  • x-session-id: Session ID from start response

Troubleshooting

  • Screenshots not loading: Check the /public/debug directory
  • Session expired: Sessions expire after 30 minutes of inactivity
  • OTP not received: Check spam folder and verify email address
  • Browser timeout: May occur with slow internet, increase timeout values in route.ts

Security Notes

  • Cookies are extracted client-side and never stored on the server
  • Sessions are automatically cleaned up after 30 minutes
  • The application uses headless Chromium for security
  • Avoid running this in shared environments

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages