{"id":19794219,"url":"https://github.com/openzim/youtube","last_synced_at":"2025-05-01T02:30:59.927Z","repository":{"id":50748045,"uuid":"51274025","full_name":"openzim/youtube","owner":"openzim","description":"Create a ZIM file from a Youtube channel/username/playlist","archived":false,"fork":false,"pushed_at":"2025-04-24T06:34:52.000Z","size":11344,"stargazers_count":66,"open_issues_count":25,"forks_count":32,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-24T07:42:14.114Z","etag":null,"topics":["openzim","scraper","youtube","zim"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openzim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"kiwix","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-02-08T01:05:16.000Z","updated_at":"2025-04-24T06:34:56.000Z","dependencies_parsed_at":"2023-11-16T16:47:29.141Z","dependency_job_id":"27087ea4-df5b-4afa-ba9e-2c2672169ba4","html_url":"https://github.com/openzim/youtube","commit_stats":{"total_commits":391,"total_committers":13,"mean_commits":"30.076923076923077","dds":0.59846547314578,"last_synced_commit":"0574bce2795bd816f6b8d9b5eb4b942dc198366e"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openzim%2Fyoutube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openzim%2Fyoutube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openzim%2Fyoutube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openzim%2Fyoutube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openzim","download_url":"https://codeload.github.com/openzim/youtube/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251812309,"owners_count":21647885,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openzim","scraper","youtube","zim"],"created_at":"2024-11-12T07:12:33.717Z","updated_at":"2025-05-01T02:30:59.452Z","avatar_url":"https://github.com/openzim.png","language":"Python","funding_links":["https://github.com/sponsors/kiwix"],"categories":[],"sub_categories":[],"readme":"Youtube2zim\n=============\n\n[![CodeFactor](https://www.codefactor.io/repository/github/openzim/youtube/badge)](https://www.codefactor.io/repository/github/openzim/youtube)\n[![Docker](https://ghcr-badge.egpl.dev/openzim/youtube/latest_tag?label=docker)](https://ghcr.io/openzim/youtube)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/youtube2zim.svg)](https://pypi.org/project/youtube2zim/)\n\n`youtube2zim` allows you to create a [ZIM file](https://openzim.org)\nfrom a Youtube Channel/Username or one-or-more Playlists.\n\nIt downloads the videos (`webm` or `mp4` extension – optionally\nrecompress them in lower-quality, smaller size), the thumbnails, the\nsubtitles and the authors' profile pictures; It then produces JSON files containing content for the channel, playlists, and videos, which are used by the UI, which is a Vue.js application that needs to be compiled as a static website with Vite and is then embedded inside the ZIM.\n\n`youtube2zim` adheres to openZIM's [Contribution Guidelines](https://github.com/openzim/overview/wiki/Contributing).\n\n`youtube2zim` has implemented openZIM's [Python bootstrap, conventions and policies](https://github.com/openzim/_python-bootstrap/blob/main/docs/Policy.md) **v1.0.2**.\n\n# Documentation\n\nFor more details / advanced usage than what is in this README, see the [Manual](https://github.com/openzim/youtube/wiki/Manual) and [FAQ/FEE](https://github.com/openzim/youtube/wiki/FAQ---FEE).\n\n# Requirements\n\n* [`ffmpeg`](https://ffmpeg.org/) for video transcoding.\n* [`Yarn`](https://yarnpkg.com/getting-started/install) to install Javascript dependencies for the Vue.js UI.\n\n# Installation\n\nHere comes a few different ways to install `youtube2zim`.\n\n## Virtualenv\n\n`youtube2zim` is a Python3 software. If you are not using the [Docker](https://docker.com) image,\nyou are advised to use it in a [virtualenv](https://virtualenv.pypa.io) to avoid installing software\ndependencies on your system. [Hatch](https://hatch.pypa.io/) is the proper tool to create the\nvirtualenv and install the software locally. Ensure to use proper Python version as well (see\npyproject.toml).\n\nIf you do not already have it on your system, install hatch to build the software and manage virtual\nenvironments (you might be interested by our detailed\n[Developer Setup](https://github.com/openzim/_python-bootstrap/blob/main/docs/Developer-Setup.md) as well,\nespecially regarding how to configure hatch globally for proper detection of its virtual environments\nby Visual Studio Code).\n\n``` bash\npip3 install hatch\n```\n\nStart a hatch shell: this will install software including dependencies in an isolated virtual environment.\n\n``` bash\ncd scraper\nhatch shell\n```\n\n```bash\nyoutube2zim --help       # Display youtube2zim help\n```\n\n## Docker\n\n```bash\ndocker run -v my_dir:/output ghcr.io/openzim/youtube youtube2zim --help\n```\n\n# Usage\n\n`youtube2zim` uses Youtube API v3 to fetch data from Youtube. You thus need to provide an `API_KEY` to use the scraper.\n\nTo get an API Key:\n\n1. Connect to [Google Developers Console](https://console.developers.google.com/apis)\n2. Create a new _Project_ then Select it.\n3. When asked, choose _Create Credentials_ and select the **API Key** type. ([Credentials page](https://console.developers.google.com/apis/credentials))\n\nYou can then create a ZIM from a singe channel / user / handle like `Vsauce`:\n\n```bash\nyoutube2zim --api-key \"\u003cyour-api-key\u003e\" --id \"Vsauce\" --name \"tests_hi_avanti\"\n```\n\nWhen scraping a channel, you must pass one single value in `--id` and it can be the handle, user, or even the corresponding technical ID (see [FAQ/FEE](https://github.com/openzim/youtube/wiki/FAQ---FEE) for more details).\n\nOr you can create a ZIM from two playlists like `PL3rEvTTL-Jm8cBdskZoQaDTlDT4t7F6kp` and `PL3rEvTTL-Jm_OuyYpMfxtJW3Mcr9fFS2Z`:\n\n```bash\nyoutube2zim --api-key \"\u003cyour-api-key\u003e\" --id \"PL3rEvTTL-Jm8cBdskZoQaDTlDT4t7F6kp,PL3rEvTTL-Jm_OuyYpMfxtJW3Mcr9fFS2Z\" --name \"tests_hi_avanti\"\n```\n\nWhen scraping playlists, you can pass multiple playlist IDs separated by a comma in `--id`.\n\nFor more details / advanced usage, see the [Manual](https://github.com/openzim/youtube/wiki/Manual).\n\n## Notes\n\n* Your API_KEY is subject to usage quotas (10,000 requests/day by default). Be careful to not waste your quota, especially when scraping large channels.\n\n# youtube2zim-playlists\n\n`youtube2zim` produces a single ZIM file for a youtube request (`channel`, `user`, `handle`, `playlist`).\n\n`youtube2zim-playlists` allows you to **automatically create one ZIM file per playlist** of a given channel or user instead.\n\nThis script is a wrapper around `youtube2zim` and is bundled with the main package.\n\n## Usage\n\nSample usage:\n\n```\nyoutube2zim-playlists --indiv-playlists --api-key XXX --id Vsauce --playlists-name=\"vsauce_en_playlist-{playlist_id}\"\n```\n\nThose are the required arguments for `youtube2zim-playlists` but **you can also pass any regular `youtube2zim` argument**. Those will be forwarded to `youtube2zim` (which will be run independently for each playlist).\n\nFor more details / advanced usage, see the [Manual](https://github.com/openzim/youtube/wiki/Manual).\n\n# Development\n\nBefore contributing be sure to check out the\n[CONTRIBUTING.md](CONTRIBUTING.md) guidelines.\n\n# License\n\n[GPLv3](https://www.gnu.org/licenses/gpl-3.0) or later, see\n[LICENSE](LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenzim%2Fyoutube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenzim%2Fyoutube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenzim%2Fyoutube/lists"}