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
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
Requires:
- Python 3.10+
- libzim
- ffmpeg
Using Docker (Recommended)
- Pull the Docker image:
docker pull ghcr.io/sudo-ivan/archiver-zim:latest
- Create required directories:
mkdir -p archive/media archive/metadata config
-
Create a
config.ymlfile in the config directory (see Configuration section below) -
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
- Create a
docker-compose.ymlfile:
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
- 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
- Install the required dependencies:
pip install -r requirements.txt
- Install yt-dlp (required for video downloads):
pip install yt-dlp
Using pip
Install directly from PyPI:
pip install archiver-zim
Install using pipx for isolated environment:
pipx install archiver-zim
CLI
The tool provides a command-line interface with two main commands:
Manage Command
archiver-zim manage [OPTIONS]
Options:
--config PATH: Path to config file (default: ./config/config.yml)--log-level LEVEL: Set logging level (default: INFO)
Archive Command
archiver-zim archive [URLS]... [OPTIONS]
Options:
--output-dir PATH: Output directory for archives--quality QUALITY: Video quality (e.g., 720p, 1080p)--title TEXT: Archive title--description TEXT: Archive description--type TYPE: Content type (channel, playlist, podcast, mixed)--update-frequency FREQ: Update frequency (e.g., 1d, 7d, 1m)
Example:
archiver-zim archive "https://www.youtube.com/watch?v=VIDEO_ID" \
--quality 720p \
--title "My Video Collection" \
--description "Personal video archive" \
--type mixed
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 archivesquality: Default video qualityretry_count: Number of retries for failed downloadsretry_delay: Base delay between retries in secondsmax_retries: Maximum number of retries before giving upmax_concurrent_downloads: Maximum number of concurrent downloadscleanup_after_archive: Whether to delete downloaded files after ZIM creation
Archive Settings
name: Unique name for the archivetype: Type of content ("channel", "playlist", "podcast", or "mixed")url: Source URLupdate_frequency: How often to update (e.g., "1d", "7d", "1m", "1y")quality: Video quality (overrides global setting)description: Archive descriptiondate_limit: Only keep content from last N daysmonth_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:
- Load the configuration from
config.yml - Check each archive's update frequency
- Download and create ZIM files as needed
- Clean up temporary files
- 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.logfile
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file archiver_zim-0.2.3.tar.gz.
File metadata
- Download URL: archiver_zim-0.2.3.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70074ca0dd9ec6068b7a7bbb5a589b68616c13cfe89343f28287a215f03e238d
|
|
| MD5 |
4f8d46293066ed158b7b52f079730788
|
|
| BLAKE2b-256 |
6eb32e0dd49981aec22811e5bee4a6fce71bba08d86a55b1866f0bb04702826e
|
Provenance
The following attestation bundles were made for archiver_zim-0.2.3.tar.gz:
Publisher:
publish.yml on Sudo-Ivan/archiver-zim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
archiver_zim-0.2.3.tar.gz -
Subject digest:
70074ca0dd9ec6068b7a7bbb5a589b68616c13cfe89343f28287a215f03e238d - Sigstore transparency entry: 206627371
- Sigstore integration time:
-
Permalink:
Sudo-Ivan/archiver-zim@d26da3e1e18965c583bd6c8943f7c3ae990dbeeb -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/Sudo-Ivan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d26da3e1e18965c583bd6c8943f7c3ae990dbeeb -
Trigger Event:
push
-
Statement type:
File details
Details for the file archiver_zim-0.2.3-py3-none-any.whl.
File metadata
- Download URL: archiver_zim-0.2.3-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cd2dd8e07c3e3132132489201c9fb2d83a4c24ed2a734fcb1b6265b50dcde2d
|
|
| MD5 |
55b867c40e7f6d9f8412e7117690bc18
|
|
| BLAKE2b-256 |
c2ebe87d2a75ad367475ba10985a4a8fe97426f3613e53525c945dbdd0996f67
|
Provenance
The following attestation bundles were made for archiver_zim-0.2.3-py3-none-any.whl:
Publisher:
publish.yml on Sudo-Ivan/archiver-zim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
archiver_zim-0.2.3-py3-none-any.whl -
Subject digest:
8cd2dd8e07c3e3132132489201c9fb2d83a4c24ed2a734fcb1b6265b50dcde2d - Sigstore transparency entry: 206627372
- Sigstore integration time:
-
Permalink:
Sudo-Ivan/archiver-zim@d26da3e1e18965c583bd6c8943f7c3ae990dbeeb -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/Sudo-Ivan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d26da3e1e18965c583bd6c8943f7c3ae990dbeeb -
Trigger Event:
push
-
Statement type: