Files
anyclip-video-manager/README.md
Varun Shah e32d475aa9 Add AnyClip integration tools and extracted source code
- Add authentication scripts with SubtleCrypto password encryption
- Add sourcemap extraction pipeline (update-urls, download-sourcemaps, extract-sources)
- Add Playwright API interception script for monetization endpoints
- Document two-step auth flow with JWT tokens and dual cookies
- Move extracted source from root to anyclip/ directory
- Add project configuration (.env.example, .gitignore, CLAUDE.md)
2026-01-21 10:36:51 +08:00

1.7 KiB

AnyClip Integration

Tools for integrating with AnyClip's Video Manager API.

Setup

cp .env.example .env
# Edit .env with your AnyClip credentials
bun install

Project Structure

├── anyclip/              # Extracted source code (from sourcemaps)
├── docs/                 # Documentation
├── scripts/              # CLI tools
├── sourcemaps/           # Raw .map files (gitignored)
└── urls.txt              # JS file URLs to download

Scripts

Authentication

# Login and save session to session.json
bun scripts/auth.ts

Programmatic usage:

import { login, getAuthHeaders } from './scripts/auth';

const session = await login(email, password);
const headers = getAuthHeaders(session);
// session.cookies contains both required cookies

See docs/auth.md for details on the two-step auth flow.

Source Extraction

Extract AnyClip's frontend source from public sourcemaps:

# 1. Update urls.txt from build manifest
bun scripts/update-urls.ts

# 2. Download sourcemaps for all URLs
bun scripts/download-sourcemaps.ts

# 3. Extract source files to anyclip/
bun scripts/extract-sources.ts

Or run all three:

bun scripts/update-urls.ts && bun scripts/download-sourcemaps.ts && bun scripts/extract-sources.ts

Script Options

extract-sources.ts:

bun scripts/extract-sources.ts [options]
  --output, -o <dir>   Output directory (default: anyclip)
  --input, -i <dir>    Sourcemaps directory (default: sourcemaps)
  --verbose, -v        Verbose output
  --no-clean           Don't delete output directory first

Documentation

  • docs/auth.md - Authentication system (two-step flow, cookies, encryption)