Skip to main content

A tool to download videos from various platforms and create ZIM archives

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Archiver ZIM

Socket Badge

A tool for downloading and archiving videos and podcasts into ZIM files.

Features

  • Continuous running mode for automatic updates
  • Support for YouTube channels, playlists, and podcast feeds
  • Configurable update frequencies
  • Mixed content archives
  • Automatic cleanup after archiving
  • Rich progress tracking and logging
  • Docker support for easy deployment

Installation

Using Docker (Recommended)

  1. Pull the Docker image:
docker pull ghcr.io/sudo-ivan/archiver-zim:latest
  1. Create required directories:
mkdir -p archive/media archive/metadata config
  1. Create a config.yml file in the config directory (see Configuration section below)

  2. Run using Docker:

# Run in continuous mode
docker run -d \
  --name archiver-zim \
  -v $(pwd)/archive:/app/archive \
  -v $(pwd)/config:/app/config \
  -e TZ=UTC \
  ghcr.io/sudo-ivan/archiver-zim:latest manage

# Run single archive
docker run --rm \
  -v $(pwd)/archive:/app/archive \
  ghcr.io/sudo-ivan/archiver-zim:latest archive \
  "https://www.youtube.com/watch?v=VIDEO_ID" \
  --quality 720p \
  --title "My Video" \
  --description "My video collection"

Using Docker Compose

  1. Create a docker-compose.yml file:
version: '3.8'

services:
  archiver:
    image: ghcr.io/sudo-ivan/archiver-zim:latest
    container_name: archiver-zim
    volumes:
      - ./archive:/app/archive
      - ./config:/app/config
    environment:
      - TZ=UTC
    restart: unless-stopped
    # Uncomment and modify the command as needed:
    # command: manage  # For continuous mode
    # command: archive "https://www.youtube.com/watch?v=VIDEO_ID" --quality 720p  # For single archive
  1. Run using Docker Compose:
# Start in continuous mode
docker compose up -d

# Run single archive
docker compose run --rm archiver archive "https://www.youtube.com/watch?v=VIDEO_ID" --quality 720p

# View logs
docker compose logs -f

Manual Installation

  1. Install the required dependencies:
pip install -r requirements.txt
  1. Install yt-dlp (required for video downloads):
pip install yt-dlp

Configuration

Create a config.yml file with your archive configurations. Example:

settings:
  output_base_dir: "./archives"
  quality: "best"
  retry_count: 3
  retry_delay: 5
  max_retries: 10
  max_concurrent_downloads: 3
  cleanup_after_archive: true

archives:
  - name: "youtube_channel_1"
    type: "channel"
    url: "https://www.youtube.com/c/channel1"
    update_frequency: "7d"  # 7 days
    quality: "720p"
    description: "Channel 1 Archive"
    date_limit: 30  # Only keep last 30 days

  - name: "podcast_series_1"
    type: "podcast"
    url: "https://example.com/feed.xml"
    update_frequency: "1d"  # Daily updates
    description: "Podcast Series 1 Archive"
    month_limit: 3  # Keep last 3 months

Configuration Options

Global Settings

  • output_base_dir: Base directory for all archives
  • quality: Default video quality
  • retry_count: Number of retries for failed downloads
  • retry_delay: Base delay between retries in seconds
  • max_retries: Maximum number of retries before giving up
  • max_concurrent_downloads: Maximum number of concurrent downloads
  • cleanup_after_archive: Whether to delete downloaded files after ZIM creation

Archive Settings

  • name: Unique name for the archive
  • type: Type of content ("channel", "playlist", "podcast", or "mixed")
  • url: Source URL
  • update_frequency: How often to update (e.g., "1d", "7d", "1m", "1y")
  • quality: Video quality (overrides global setting)
  • description: Archive description
  • date_limit: Only keep content from last N days
  • month_limit: Only keep content from last N months

Usage

Continuous Mode

Run the manager in continuous mode:

# Using Python
python archiver.py manage

# Using Docker
docker run -d \
  --name archiver-zim \
  -v $(pwd)/archive:/app/archive \
  -v $(pwd)/config:/app/config \
  -e TZ=UTC \
  ghcr.io/sudo-ivan/archiver-zim:latest manage

# Using Docker Compose
docker compose up -d

The manager will:

  1. Load the configuration from config.yml
  2. Check each archive's update frequency
  3. Download and create ZIM files as needed
  4. Clean up temporary files
  5. Repeat the process

Single Archive Mode

Create a single archive:

# Using Python
python archiver.py archive URL1 URL2 --output-dir ./archive --quality 720p

# Using Docker
docker run --rm \
  -v $(pwd)/archive:/app/archive \
  ghcr.io/sudo-ivan/archiver-zim:latest archive \
  "https://www.youtube.com/watch?v=VIDEO_ID" \
  --quality 720p

# Using Docker Compose
docker compose run --rm archiver archive \
  "https://www.youtube.com/watch?v=VIDEO_ID" \
  --quality 720p

Logging

Logs are written to both:

  • Console output
  • archive_manager.log file

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

archiver_zim-0.2.1.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

archiver_zim-0.2.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file archiver_zim-0.2.1.tar.gz.

File metadata

  • Download URL: archiver_zim-0.2.1.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for archiver_zim-0.2.1.tar.gz
Algorithm Hash digest
SHA256 31ae594e6e912af795d697ea4a971a378fa9d479bed5e0831a699313400f1e77
MD5 488c35f93a84ce6568cebffceca8fa10
BLAKE2b-256 8f948b8f941bb15df0a7d2b83619b6858bd148f4a6b4d27ffea9cc08a522e43a

See more details on using hashes here.

Provenance

The following attestation bundles were made for archiver_zim-0.2.1.tar.gz:

Publisher: publish.yml on Sudo-Ivan/archiver-zim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file archiver_zim-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: archiver_zim-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for archiver_zim-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1fe3af1a844c79530c5285c4ef3d357fd81da92dcb07904c124beb5ec4987455
MD5 4642e6c7236f2e3fb694bdae9aeb8d02
BLAKE2b-256 12a7073e563aca8612aa40a70c477d9e993bf7b12ce76590953214b15b7ccc0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for archiver_zim-0.2.1-py3-none-any.whl:

Publisher: publish.yml on Sudo-Ivan/archiver-zim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page