Skip to main content

Make ZIM file from TED Talks

Project description

ted2zim

Get the best :bulb: TED videos offline :arrow_down:

An offliner to create ZIM :package: files from TED talks

CodeFactor License: GPL v3 codecov PyPI version shields.io PyPI - Python Version

TED (Technology, Entertainment, Design) is a global set of conferences under the slogan "ideas worth spreading". They address a wide range of topics within the research and practice of science and culture, often through storytelling. The speakers are given a maximum of 18 minutes to present their ideas in the most innovative and engaging ways they can. One can eaisly find all the TED videos here.

This project is aimed at creating a sustainable solution to make TED accessible offline by creating ZIM files providing these videos in a similar manner like online.

ted2zim adheres to openZIM's Contribution Guidelines.

ted2zim has implemented openZIM's Python bootstrap, conventions and policies v1.0.2.

Getting started :rocket:

Install the dependencies

Make sure that you have python3, unzip, ffmpeg, wget and curl installed on your system before running the scraper (otherwise you'll get a warning to install them).

Setup the package

One can easily install the PyPI version but let's setup the source version.

First, clone this repository.

If you do not already have it on your system, install hatch to build the software and manage virtual environments (you might be interested by our detailed Developer Setup as well).

pip3 install hatch

Start a hatch shell: this will install software including dependencies in an isolated virtual environment.

hatch shell

That's it. You can now run ted2zim from your terminal

ted2zim --topics [TOPICS] --name [NAME]

For the full list of arguments, see this file or run the following

ted2zim --help

Example usage

ted2zim --topics="augmented reality" --debug --name="augumented_reality" --format=mp4 --title="Augmented Reality" --description="TED videos in AR category" --creator="TED" --publisher="openzim" --output="output" --keep --low-quality

This project can also be run with docker. Use the provided Dockerfile or pre-build images to run it with Docker. See steps here.

Features :robot:

You can create ZIMs for multiple topics (should be same as given here), choose between different video formats (webm/mp4), different compression rates, and even use an S3 based cache.

Want more flexibility? There's a multitool

ted2zim-multi is an extra command available that allows you to do much more with the scraper. It falls back to ted2zim if normal commands are passed. It supports creation of multiple ZIMs with single command for both playlists and topics and even getting metadata from a specified JSON file. It supports the following extra arguments -

  • --indiv-zims - Allows you to create one zim/topic or one zim/playlist
  • --{name|description|zim-file|title}-format - Allows you to add custom format for the equivalent ted2zim arguments. You can add {identity} as a placeholder in these values to get the playlist ID / topic name in it's place (spaces replaced by -). You can now also add {slug} to get the topic/playlist slug.
  • --metadata-from - Path to a JSON file containing the metadata.

Should be of the following format:

{
    "<playlist-id/topic-name-with-underscores>": {
        "name": "sample_name_{identity}",
        "description": "Sample description",
        "title": "Custom title",
        "zim-file": "sample.zim",
        "tags": "tag",
        "creator": "Yourself",
        "build-dir": "/custom_build_dir"
    }
}

See ted2zim-multi --help for details.

License :book:

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

ted2zim-3.0.3.tar.gz (447.9 kB view details)

Uploaded Source

Built Distribution

ted2zim-3.0.3-py3-none-any.whl (3.1 MB view details)

Uploaded Python 3

File details

Details for the file ted2zim-3.0.3.tar.gz.

File metadata

  • Download URL: ted2zim-3.0.3.tar.gz
  • Upload date:
  • Size: 447.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for ted2zim-3.0.3.tar.gz
Algorithm Hash digest
SHA256 9b62b28a22377a7a716d18d757a3d97e7a769b1bee2a6777b5ce37ba5addb6b8
MD5 a42f4d02987da776e54834471e30cd3b
BLAKE2b-256 e84cf64a6c76e7aee3527b403eaf760a7cc40aae4c0386d8b0f2dd23c0702e45

See more details on using hashes here.

File details

Details for the file ted2zim-3.0.3-py3-none-any.whl.

File metadata

  • Download URL: ted2zim-3.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for ted2zim-3.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9a2a6778089b392f8b7765fef473cbae093d53b5f14fcbae00e83403cc5d1242
MD5 9c3b0da36b0d0d1640e6241f8718e9ef
BLAKE2b-256 2aba6c4ed08100640203d00cad9c4d53ae74506318ba994db058825d33a1ea10

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