Skip to content

allenhsieh/archivebatcheditor

Repository files navigation

Archive.org Batch Metadata Editor

🎡 A beginner-friendly web app for managing your Archive.org collection

Easily edit metadata for hundreds of Archive.org items at once, with YouTube integration and real-time progress tracking.

✨ What This App Does

Perfect for content creators who upload to Archive.org regularly!

βœ… Load your entire collection - See all your Archive.org items in one place
βœ… Batch edit metadata - Update 50+ items with just a few clicks
βœ… YouTube auto-matching - Automatically find matching YouTube videos
βœ… Real-time progress - Watch each item update live with green βœ… or red ❌
βœ… Sequential processing - Handles each item one by one for reliability
βœ… Beginner-friendly - No coding required, just point and click!

Use cases:

  • Concert recordings: Add band names, venues, dates consistently
  • Podcast collections: Standardize titles and descriptions
  • Video archives: Link to YouTube versions and extract metadata
  • Any large Archive.org collection that needs consistent formatting

πŸš€ Quick Start Guide

New to web development? No problem! Follow these simple steps:

Step 1: Install Node.js

  • Go to nodejs.org and download the LTS version (18+)
  • Install it (just click through the installer)
  • Test it worked: Open terminal and type node --version

Step 2: Get Your API Keys

You need these to connect to Archive.org (and optionally YouTube):

Required: Archive.org credentials
Optional: YouTube API (for auto-matching features)

πŸ”‘ Getting Your API Credentials

πŸ“ Archive.org Credentials (Required)

Super easy! Just 2 steps:

  1. Go to: archive.org/account/s3.php
  2. Log in with your Archive.org account
  3. Copy these 3 things:
    • βœ… Access Key (looks like: ABC123XYZ456)
    • βœ… Secret Key (looks like: abcdef1234567890)
    • βœ… Email (your Archive.org login email)

That's it! Keep these safe - you'll paste them in Step 4.


πŸŽ₯ YouTube API (Optional - for auto-matching)

Want YouTube integration? Here's how to get a free API key:

Step 2A: Create Google Cloud Project

  1. Go to Google Cloud Console
  2. Click "Create Project" (top of page)
  3. Give it any name like "Archive YouTube Matcher"
  4. Click "Create"

Step 2B: Enable YouTube API

  1. Search for "YouTube Data API v3" in the search bar
  2. Click on it, then click "Enable"
  3. Wait 30 seconds for it to activate

Step 2C: Get Your API Key

  1. Go to "Credentials" (left sidebar)
  2. Click "+ Create Credentials" β†’ "API Key"
  3. Copy the key (starts with AIzaS...)
  4. Optional: Click "Restrict Key" for security

Step 2D: Find Your YouTube Channel ID

  1. Go to your YouTube channel
  2. Copy your handle (like @YourChannelName)
  3. Use commentpicker.com/youtube-channel-id.php
  4. Paste your handle, get your Channel ID (starts with UC...)

πŸ’‘ Pro Tip: YouTube integration is completely optional! The app works great for metadata editing without it.

πŸ’» Step 3: Download & Install

3A. Download the Code

Option 1: Download ZIP (Easiest)

  • Click the green "Code" button on this page
  • Click "Download ZIP"
  • Extract it to your Desktop or Documents folder

Option 2: Use Git (if you know git)

git clone <repository-url>
cd archivebatcheditor

3B. Install App Dependencies

  1. Open terminal in your project folder
  2. Run this command:
npm install
  1. Wait 2-3 minutes while it downloads everything needed
  2. You should see: "added XXX packages" when done βœ…

πŸ”§ Step 4: Add Your API Keys

Create your secret configuration file:

4A. Create .env File

  1. In your project folder, create a new file called .env (exactly that name)
  2. Copy and paste this template:
# πŸ” Archive.org credentials (REQUIRED - get from step 2)
ARCHIVE_ACCESS_KEY=paste_your_access_key_here
ARCHIVE_SECRET_KEY=paste_your_secret_key_here  
ARCHIVE_EMAIL=paste_your_email_here

# πŸŽ₯ YouTube integration (OPTIONAL - get from step 2)
YOUTUBE_API_KEY=paste_your_youtube_api_key_here
YOUTUBE_CHANNEL_ID=paste_your_channel_id_here

# βš™οΈ Server settings (leave these as-is)
PORT=3001
NODE_ENV=development

4B. Replace the Placeholders

  • Replace paste_your_access_key_here with your real Archive.org access key
  • Replace paste_your_secret_key_here with your real Archive.org secret key
  • Replace paste_your_email_here with your Archive.org email
  • If you got YouTube keys: replace those placeholders too
  • If no YouTube: just leave those lines as-is or delete them

4C. Save and Secure

βœ… Save the file
πŸ”’ Never share this file - it contains your passwords!
🚫 Don't post it online - the app automatically keeps it private


πŸš€ Step 5: Start the App

You need TWO terminal windows:

Terminal 1: Start the Server

npm run server:dev

You should see:

  • "Server running on port 3001" βœ…
  • "Server ready with quota-aware YouTube integration" βœ…
  • "Archive.org credentials loaded successfully" βœ…

Terminal 2: Start the Website

npm run dev

You should see:


πŸŽ‰ Step 6: Open the App

Go to: http://localhost:3000

You should see the Archive.org Batch Editor interface!

πŸ“– How to Use the App

Perfect for beginners! Just follow these simple steps:


πŸ”„ Step 1: Load Your Archive.org Collection

  1. Click the big "Load My Items" button
  2. Wait 5-10 seconds while it fetches your uploads
  3. See all your Archive.org items appear in the list βœ…

What happens behind the scenes:

  • πŸ”„ Fresh data: Loads your items directly from Archive.org each time
  • πŸ” Secure: Only shows YOUR items (filtered by your email automatically)
  • πŸ“Š Sequential: Processes items one by one for reliability

✏️ Step 2: Basic Metadata Editing

Want to update titles, descriptions, or other info? Here's how:

  1. β˜‘οΈ Check the boxes next to items you want to edit
  2. βž• Click "Add Field" and pick what to change (title, creator, description, etc.)
  3. ✏️ Type your new value in the text box
  4. πŸš€ Click "Update X Items" button
  5. πŸ‘€ Watch the magic! Each item updates with live progress:
    • πŸ”„ Blue spinning = currently updating
    • βœ… Green checkmark = success!
    • ❌ Red X = error (shows why)

Pro Tips:

  • ⚑ Batch power: Select 50+ items and update them all at once!
  • 🎯 Replace mode: Your new value completely replaces the old one
  • πŸ“ Test first: Try with 1-2 items before doing large batches

πŸŽ₯ Step 3: YouTube Auto-Matching (Optional)

Have YouTube videos of the same content? Auto-match them!

How it works:

  1. β˜‘οΈ Select Archive.org items you want to match
  2. πŸ” Click "Get YouTube Match" button
  3. ⏳ Wait while it searches YouTube for matching videos
  4. πŸ‘οΈ Review suggestions - it extracts band names, venues, dates automatically!
  5. Choose what to apply:
    • πŸ”— "Add YouTube Links" = Just adds the YouTube URL
    • βœ… "Apply All Selected Fields" = Adds URL + extracted metadata

What gets extracted:

  • 🎸 Band/Artist name from video titles
  • πŸ›οΈ Venue name (like "The Fillmore")
  • πŸ“… Date from video descriptions
  • πŸ”— YouTube URL for cross-referencing

⚑ Pro Features

πŸ”„ Sequential Processing

  • One at a time: Processes items sequentially for reliability
  • Fail-fast: Stops on first error to preserve API quota
  • Fresh data: Always fetches latest information from APIs
  • Status: See real-time processing updates in the server terminal

πŸ“Š Real-Time Progress

  • Live updates: Watch each item process in real-time
  • Error handling: See exactly which items failed and why
  • Streaming: Progress updates even if you have 100+ items
  • Quota-aware: Stops immediately on YouTube API quota exhaustion to preserve usage

πŸ”’ Security & Privacy

  • Local only: Runs on your computer, not in the cloud
  • API keys: Stored securely in .env file
  • No tracking: Your data stays with you

✨ Code Quality & Reliability

  • TypeScript: Full type safety prevents runtime errors
  • Comprehensive testing: 127 tests ensure reliability
  • Robust error handling: Graceful failure with detailed logging
  • API documentation: Self-documenting endpoints with examples

🚨 Help! Something's Not Working

Don't panic! Here are the most common fixes:


😡 "No Items Loading" or Empty List

Most common fixes:

  1. Check your .env file:

    • Is your Archive.org email correct?
    • Did you paste the right access/secret keys?
    • No extra spaces or quotes around your keys?
  2. Try refreshing:

    • Click the "πŸ”„ Refresh" button
    • Wait 10-15 seconds for fresh data
  3. Check the server terminal:

    • Look for red error messages
    • Common: "Invalid credentials" or "Access denied"

Still not working? Your Archive.org account might not have any public items, or your credentials expired.


πŸŽ₯ "YouTube Match Not Found" or "Rate Limit"

Don't worry - YouTube is optional! Your main app still works perfectly.

Common YouTube issues:

  • Quota exhausted: YouTube API has daily limits. The app automatically detects quota exhaustion and stops immediately to preserve remaining quota
  • No matches: Not all Archive items have YouTube versions - totally normal!
  • Wrong Channel ID: Double-check it starts with UC and matches your actual channel

Quick fix: Just use the app without YouTube matching - still super powerful!


πŸ’» "Server Won't Start" or Terminal Errors

Check these basics:

  1. Node.js installed? Type node --version - should show v18+
  2. Wrong folder? Make sure you're in the project folder
  3. Ports busy? Close other apps using ports 3000/3001
  4. Try reinstalling: Run npm install again

Mac users with SQLite errors:

xcode-select --install

Still stuck? Delete the whole folder, re-download, and start over - sometimes that's fastest!


πŸ”„ "Items Stuck Processing" or Updates Not Showing

Quick fixes:

  1. Refresh the webpage (F5 or Cmd+R)
  2. Check your internet - updates stream live
  3. Look at server terminal - shows detailed progress even if UI breaks
  4. Wait it out - large batches can take 5-10 minutes

πŸ—„οΈ "Database or Server Errors"

Nuclear option (fixes most issues):

  1. Close both terminals (Ctrl+C)
  2. Clear any temporary files: Delete any old cache files if they exist
  3. Restart everything: npm run server:dev and npm run dev
  4. Server starts fresh βœ…

πŸ†˜ Still Need Help?

Before asking for help, gather this info:

  • What error message do you see exactly?
  • What step were you on when it broke?
  • Are both terminals still running?
  • What does your .env file look like? (Don't share the actual keys!)

Where to get help:

  • Open a GitHub Issue with your error details
  • Check if others had the same problem in existing Issues

πŸ” Important Security Reminders

Keep your API keys safe:

  • 🚫 Never share your .env file - treat it like your password
  • 🚫 Don't post screenshots of your .env file
  • 🚫 Don't commit it to git - the app automatically ignores it
  • βœ… Test with 1-2 items first before doing big batches

The app is secure by design:

  • 🏠 Runs locally - your keys never leave your computer
  • 🎯 Surgical updates - only changes the metadata you specify
  • πŸ‘οΈ Transparent - you see exactly what changes before applying

πŸ› οΈ For Developers (Optional Reading)

Want to understand how it works or contribute? Here's the technical details:

πŸ“ Project Structure

archivebatcheditor/
β”œβ”€β”€ πŸ–₯️ src/             # Frontend React app (what you see in browser)
β”œβ”€β”€ βš™οΈ server/          # Backend Express server (handles API calls)  
β”œβ”€β”€ πŸ” .env            # Your secret keys (never commit this!)
β”œβ”€β”€ πŸ“¦ package.json    # List of dependencies and scripts
└── πŸ“– README.md      # This guide

πŸ—οΈ Tech Stack Used

  • Frontend: React 18 + TypeScript + Vite (modern web framework)
  • Backend: Node.js + Express + TypeScript (server technology)
  • Real-time: Server-Sent Events (live progress updates)
  • APIs: Archive.org + YouTube Data API v3

πŸ”§ Development Commands

npm run dev          # Start the website (port 3000)
npm run server:dev   # Start the API server (port 3001)  
npm run build        # Build for production hosting
npm run preview      # Test the production build
npm test            # Run the comprehensive test suite (127 tests)
npm run type-check  # Verify TypeScript compilation

πŸ§ͺ Testing & Quality Assurance

This project includes a comprehensive test suite ensuring reliability:

  • πŸ“Š 127 passing tests across 7 test suites (100% pass rate)
  • πŸ”§ Integration tests for all API endpoints
  • πŸ” Authentication regression tests to prevent auth bugs
  • 🌐 End-to-end testing with real server interactions
  • ⚑ TypeScript compilation with zero errors

Run tests before contributing:

npm test                    # Full test suite
npm test -- --watch        # Watch mode for development  
npm run type-check         # TypeScript validation

🀝 Contributing & Support

Found a bug or want a new feature?

Before contributing:

  • βœ… Run tests: npm test to ensure all 127 tests pass
  • βœ… Check types: npm run type-check for TypeScript validation
  • βœ… Test with real data: Test your changes with real Archive.org items
  • 🚫 Don't include: Your .env file in commits
  • πŸ“ Document: Add comments explaining complex code
  • πŸ“– Update docs: Update this README if you change how things work

πŸ“„ License

MIT License - This means:

  • βœ… Use it for personal projects
  • βœ… Use it for commercial projects
  • βœ… Modify it however you want
  • βœ… Share your improvements back (but not required)

πŸŽ‰ Final Notes

Congratulations on setting up your Archive.org Batch Editor!

This tool can save you hours of manual work when managing large media collections. Whether you're organizing concert recordings, podcasts, or any other Archive.org uploads, you now have the power to update hundreds of items with just a few clicks.

Remember:

  • πŸ§ͺ Start small - test with a few items first
  • πŸ”„ Sequential processing - items are handled one by one for reliability
  • πŸ“ Backup important data before large changes
  • πŸ†˜ Ask for help if you get stuck - we're here to help!

Happy archiving! πŸŽ΅πŸ“šπŸŽ¬


Last updated: September 2024

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •