Skip to main content

Make ZIM file from a Youtube channel, user or playlist(s)

Project description

Youtube2zim

CodeFactor License: GPL v3 PyPI version shields.io

youtube2zim allows you to create a ZIM file from a Youtube Channel/Username or one-or-more Playlists.

It downloads the video (webm or mp4 extension – optionnaly recompress them in lower-quality, smaller size), the thumbnails, the subtitles and the authors' profile pictures ; then, it create a static HTML files folder of it before creating a ZIM off of it.

Requirements

  • ffmpeg for video transcoding (only used with --lower-quality).
  • zimwriterfs for ZIM file packaging. Use --no-zim to skip this step.
  • curl and unzip to install Javascript dependencies. See get_js_deps.sh if you want to do it manually.

Installation

Here comes a few different ways to install youtube2zim.

Virtualenv

youtube2zim is a Python3 software. If you are not using the Docker image, you are advised to use it in a virtualenv to avoid installing software dependences on your system.

virtualenv -p python3 ./ # Create virtualenv
source bin/activate      # Activate the virtualenv
pip3 install youtube2zim # Install dependencies
youtube2zim --help       # Display youtube2zim help

At the end, call deactivate to quit the virtual environment.

See requirements.txt for the list of python dependencies.

Docker

docker run -v my_dir:/output openzim/youtube youtube2zim --help

Globally (on GNU/Linux)

sudo pip3 install -U youtube2zim

Usage

youtube2zim uses Youtube API v3 to fetch data from Youtube. You thus need to provide an API_KEY to use the scraper.

To get an API:

  1. Connect to Google Developers Console
  2. Create a new Project then Select it.
  3. When asked, choose Create Credentials and select the API Key type. (Credentials page)
youtube2zim --api-key "<your-api-key>" --type user --id "Vsauce"

Notes

  • Your API_KEY is subject to usage quotas (10,000 requests/day) so use --only_test_branding when adjusting parameters and branding to not waste your quota.
  • On macOS, the locale setting is buggy. You need to launch it with LANGUAGE environment variable (as ISO-639-1) for the translations to work.
LANGUAGE=fr youtube2zim --language fra

Development

Before contributing be sure to check out the CONTRIBUTING.md guidelines.

License

GPLv3 or later, see LICENSE for more details.

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

youtube2zim-2.1.4.tar.gz (3.5 MB view details)

Uploaded Source

Built Distribution

youtube2zim-2.1.4-py3-none-any.whl (3.6 MB view details)

Uploaded Python 3

File details

Details for the file youtube2zim-2.1.4.tar.gz.

File metadata

  • Download URL: youtube2zim-2.1.4.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for youtube2zim-2.1.4.tar.gz
Algorithm Hash digest
SHA256 9251e73b844422b835f4f872cf104df2a36c484399d374851428e399809aef6c
MD5 0e4d3588c759154e1a500a7288a94fa7
BLAKE2b-256 5cef7421e13c0d7f285cbcc2e24fafa429776c49873938c59e253161eb0281a4

See more details on using hashes here.

File details

Details for the file youtube2zim-2.1.4-py3-none-any.whl.

File metadata

  • Download URL: youtube2zim-2.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for youtube2zim-2.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 27955adb6352620de829e05c3b8cfb76b3078d61fa769c063f7de5cb63477f7f
MD5 832e7a28e99a95bbaa7b22a45d15ed5f
BLAKE2b-256 a9d6d4d864890e61c14dc44eec8055c9317c50ff109cd7b3a94d49bc175b2dd9

See more details on using hashes here.

Supported by

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