{"id":26796095,"url":"https://github.com/psyhackological/ytxt","last_synced_at":"2026-05-05T05:34:55.472Z","repository":{"id":65543843,"uuid":"502580528","full_name":"Psyhackological/ytxt","owner":"Psyhackological","description":":video_camera: Convert YouTube video subtitles to clean text! Downloads and processes .vtt files into readable .txt.","archived":false,"fork":false,"pushed_at":"2023-04-17T19:05:52.000Z","size":4814,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T18:57:12.203Z","etag":null,"topics":["cli","python","regex","subtitle","subtitles","youtube","yt-dlp"],"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/Psyhackological.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-12T10:11:39.000Z","updated_at":"2024-10-09T21:53:27.000Z","dependencies_parsed_at":"2023-02-15T17:15:24.034Z","dependency_job_id":null,"html_url":"https://github.com/Psyhackological/ytxt","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Psyhackological%2Fytxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Psyhackological%2Fytxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Psyhackological%2Fytxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Psyhackological%2Fytxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Psyhackological","download_url":"https://codeload.github.com/Psyhackological/ytxt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246223314,"owners_count":20743168,"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":["cli","python","regex","subtitle","subtitles","youtube","yt-dlp"],"created_at":"2025-03-29T18:17:19.145Z","updated_at":"2026-05-05T05:34:55.432Z","avatar_url":"https://github.com/Psyhackological.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"img/ytxt_logo.svg\" alt=\"ytxt\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n  YTXT\n\u003c/h1\u003e\n\n![asciinemagifgenerator](img/agg.gif)\n\n\u003cp align=\"center\"\u003e\n  This module downloads subtitles in .vtt file format, then it opens it as a regular .txt file, removes unneeded stuff and finally saves it to a clean looking .txt file with the same name.\n\u003c/p\u003e\n\n# Table of contents\n1. [Main features](#main-features)\n2. [Requirements](#requirements)\n3. [Installation](#installation)\n4. [Troubleshooting](#troubleshooting)\n5. [Usage with examples](#usage-with-examples)\n6. [Contributing](#contributing)\n7. [License](#license)\n\n## Main features\n- Downloads .vtt subtitle files and saves them to a clean looking .txt file with the same name as the subtitle file.\n- Easy to customise using flags. (e.g. easy selection of different subtitle languages)\n- Easy to use command line interface thanks to argparse.\n\nTo understand how it works, see the [samples folder](samples/).\n\n## Requirements\n### For installation\n[python-pip](https://pip.pypa.io/en/stable/) - pip is the package installer for Python. You can use it to install packages from the Python Package Index and other indexes.\n\n### For building\n[python-poetry](https://python-poetry.org/) - Python packaging and dependency management made easy.\n\nInstalling dependencies\n```bash\npoetry install\n```\n\nInstalling dependencies\n```bash\npoetry install\n```\n\nActivating the virtual environment\n```bash\npoetry shell\n```\n\nDeactivating the virtual environment leaving the shell\n```bash\nexit\n```\nor `CTRL + D`\n\nDeactivate the virtual environment without leaving the shell\n```bash\ndeactivate\n```\n\nUpdate dependencies (in the same folder with `pyproject.toml` and `poetry.lock`)\n```bash\npoetry update\n```\n\nFor more commands, see [Python Poetry's Basic Usage](https://python-poetry.org/docs/basic-usage/).\n\n## Installation\nLocally:\n```bash\npip install ytxt-0.1.1-py3-none-any.whl\n```\nFrom [PyPi](https://pypi.org/):\n`Coming soon!`\n\n## Troubleshooting\nWindows: `pip` / `ytxt` is not recognized as an internal or external command, operable program or batch file.\n1. Make sure that you have installed python-pip and ytxt correctly.\n2. If so, then the problem lies in the `Path` environment variable, which is needed to see where Python's scripts are installed and how they can be run.\n\nSolution for system's environment variable using admin privileges in PowerShell\n```powershell\n[Environment]::SetEnvironmentVariable(\"Path\", \"$env:Path;$HOME\\AppData\\Local\\Programs\\Python\\Python311\\Scripts\", \"Machine\")\n```\n\nWhere `Python311` is your version of Python.\n\nSolution for user's environment variable without admin privileges in PowerShell\n```powershell\n[Environment]::SetEnvironmentVariable(\"Path\", \"$env:Path;$HOME\\AppData\\Roaming\\Python\\Python311\\Scripts\", \"User\")\n```\n\nWhere `Python311` is your version of Python.\n\nGNU/Linux / MacOS: bash: `pip` / `ytxt`: command not found\n1. Make sure that you have installed python-pip and ytxt correctly.\n2. If so, MacOS users are doomed and Linux users will figure it out.\n\n## Usage with examples\n\n### Getting help\nSyntax\n```bash\nytxt -h, --help\n```\n\nExample\n```bash\nytxt -h\n```\n\nConsole output\n```bash\nusage: YTXT - YouTube Video to TXT [-h] [-l [LANG ...]] [-sl] URL [URL ...]\n\npositional arguments:\n  URL                   YouTube video URLs\n\noptions:\n  -h, --help            show this help message and exit\n  -l [LANG ...], --languages [LANG ...]\n                        subtitles languages (default=['en', 'en-GB']) (list)\n  -sl, --sub-langs      prints all available subtitles languages\n```\n\n### List subtitles' languages\nSyntax\n```bash\nytxt URL [URL ...] -sl, --sub-langs\n```\n\nExample\n```bash\nytxt https://youtu.be/h6fcK_fRYaI -sl\n```\n\nConsole output (without automatic caption output)\n```bash\n[youtube] Extracting URL: https://youtu.be/I9hJ_Rux9y0\n[youtube] I9hJ_Rux9y0: Downloading webpage\n[youtube] I9hJ_Rux9y0: Downloading android player API JSON\n[info] Available subtitles for h6fcK_fRYaI:\nLanguage Name                     Formats\nar       Arabic                   vtt, ttml, srv3, srv2, srv1, json3\naz       Azerbaijani              vtt, ttml, srv3, srv2, srv1, json3\nbn       Bangla                   vtt, ttml, srv3, srv2, srv1, json3\nbe       Belarusian               vtt, ttml, srv3, srv2, srv1, json3\nbs       Bosnian                  vtt, ttml, srv3, srv2, srv1, json3\nbg       Bulgarian                vtt, ttml, srv3, srv2, srv1, json3\nmy       Burmese                  vtt, ttml, srv3, srv2, srv1, json3\nca       Catalan                  vtt, ttml, srv3, srv2, srv1, json3\nzh       Chinese                  vtt, ttml, srv3, srv2, srv1, json3\nzh-CN    Chinese (China)          vtt, ttml, srv3, srv2, srv1, json3\nzh-Hans  Chinese (Simplified)     vtt, ttml, srv3, srv2, srv1, json3\nzh-TW    Chinese (Taiwan)         vtt, ttml, srv3, srv2, srv1, json3\nhr       Croatian                 vtt, ttml, srv3, srv2, srv1, json3\ncs       Czech                    vtt, ttml, srv3, srv2, srv1, json3\nda       Danish                   vtt, ttml, srv3, srv2, srv1, json3\nnl       Dutch                    vtt, ttml, srv3, srv2, srv1, json3\nen-GB    English (United Kingdom) vtt, ttml, srv3, srv2, srv1, json3\neo       Esperanto                vtt, ttml, srv3, srv2, srv1, json3\net       Estonian                 vtt, ttml, srv3, srv2, srv1, json3\nfil      Filipino                 vtt, ttml, srv3, srv2, srv1, json3\nfi       Finnish                  vtt, ttml, srv3, srv2, srv1, json3\nfr       French                   vtt, ttml, srv3, srv2, srv1, json3\nfr-CA    French (Canada)          vtt, ttml, srv3, srv2, srv1, json3\nfr-FR    French (France)          vtt, ttml, srv3, srv2, srv1, json3\nka       Georgian                 vtt, ttml, srv3, srv2, srv1, json3\nde       German                   vtt, ttml, srv3, srv2, srv1, json3\nel       Greek                    vtt, ttml, srv3, srv2, srv1, json3\niw       Hebrew                   vtt, ttml, srv3, srv2, srv1, json3\nhi       Hindi                    vtt, ttml, srv3, srv2, srv1, json3\nhu       Hungarian                vtt, ttml, srv3, srv2, srv1, json3\nid       Indonesian               vtt, ttml, srv3, srv2, srv1, json3\nit       Italian                  vtt, ttml, srv3, srv2, srv1, json3\nja       Japanese                 vtt, ttml, srv3, srv2, srv1, json3\nkk       Kazakh                   vtt, ttml, srv3, srv2, srv1, json3\nko       Korean                   vtt, ttml, srv3, srv2, srv1, json3\nku       Kurdish                  vtt, ttml, srv3, srv2, srv1, json3\nlv       Latvian                  vtt, ttml, srv3, srv2, srv1, json3\nlt       Lithuanian               vtt, ttml, srv3, srv2, srv1, json3\nms       Malay                    vtt, ttml, srv3, srv2, srv1, json3\nmn       Mongolian                vtt, ttml, srv3, srv2, srv1, json3\nno       Norwegian                vtt, ttml, srv3, srv2, srv1, json3\nfa       Persian                  vtt, ttml, srv3, srv2, srv1, json3\npl       Polish                   vtt, ttml, srv3, srv2, srv1, json3\npt       Portuguese               vtt, ttml, srv3, srv2, srv1, json3\npt-BR    Portuguese (Brazil)      vtt, ttml, srv3, srv2, srv1, json3\npt-PT    Portuguese (Portugal)    vtt, ttml, srv3, srv2, srv1, json3\nro       Romanian                 vtt, ttml, srv3, srv2, srv1, json3\nru       Russian                  vtt, ttml, srv3, srv2, srv1, json3\nsr       Serbian                  vtt, ttml, srv3, srv2, srv1, json3\nsr-Latn  Serbian (Latin)          vtt, ttml, srv3, srv2, srv1, json3\nsk       Slovak                   vtt, ttml, srv3, srv2, srv1, json3\nsl       Slovenian                vtt, ttml, srv3, srv2, srv1, json3\nes       Spanish                  vtt, ttml, srv3, srv2, srv1, json3\nes-419   Spanish (Latin America)  vtt, ttml, srv3, srv2, srv1, json3\nes-MX    Spanish (Mexico)         vtt, ttml, srv3, srv2, srv1, json3\nes-ES    Spanish (Spain)          vtt, ttml, srv3, srv2, srv1, json3\nsv       Swedish                  vtt, ttml, srv3, srv2, srv1, json3\nta       Tamil                    vtt, ttml, srv3, srv2, srv1, json3\nth       Thai                     vtt, ttml, srv3, srv2, srv1, json3\ntr       Turkish                  vtt, ttml, srv3, srv2, srv1, json3\nuz       Uzbek                    vtt, ttml, srv3, srv2, srv1, json3\nvi       Vietnamese               vtt, ttml, srv3, srv2, srv1, json3\n```\n\n### Basic usage\nSyntax\n```\nytxt URL [URL ...]\n```\n\nExample\n```\nytxt https://youtu.be/h6fcK_fRYaI\n```\n\nConsole output\n```bash\n[youtube] Extracting URL: https://youtu.be/h6fcK_fRYaI\n[youtube] h6fcK_fRYaI: Downloading webpage\n[youtube] h6fcK_fRYaI: Downloading android player API JSON\n[info] h6fcK_fRYaI: Downloading subtitles: en-GB\n[info] h6fcK_fRYaI: Downloading 1 format(s): 248+251\n[info] Writing video subtitles to: The Egg - A Short Story [h6fcK_fRYaI].en-GB.vtt\n[download] Destination: The Egg - A Short Story [h6fcK_fRYaI].en-GB.vtt\n[download] 100% of    9.44KiB in 00:00:00 at 83.42KiB/s\nDeleting subtitles heading...\nDone 1/5\nDeleting subtitles timestamps...\nDone 2/5\nDeleting subtitles newlines...\nDone 3/5\nDeleting start and end whitespace...\nDone 4/5\nDeleting double or more whitespace...\nDone. 5/5\nCreating the txt file...\nFinished saving The Egg - A Short Story [h6fcK_fRYaI].en-GB.txt\n```\n\nSee also the 2 files that are stored in your relative path:\n```bash\nThe Egg - A Short Story [h6fcK_fRYaI].en-GB.txt\nThe Egg - A Short Story [h6fcK_fRYaI].en-GB.vtt\n```\n\n### Changing default languages\nSyntax\n```bash\nytxt URL [URL ...] -l LANG [LANG ...], --languages LANG [LANG ...]\n```\n\nExample\n```bash\nytxt https://youtu.be/h6fcK_fRYaI -l de pl\n```\n\nConsole output\n```bash\n[youtube] Extracting URL: https://youtu.be/h6fcK_fRYaI\n[youtube] h6fcK_fRYaI: Downloading webpage\n[youtube] h6fcK_fRYaI: Downloading android player API JSON\n[info] h6fcK_fRYaI: Downloading subtitles: de, pl\n[info] h6fcK_fRYaI: Downloading 1 format(s): 248+251\nDeleting existing file The Egg - A Short Story [h6fcK_fRYaI].de.vtt\n[info] Writing video subtitles to: The Egg - A Short Story [h6fcK_fRYaI].de.vtt\n[download] Destination: The Egg - A Short Story [h6fcK_fRYaI].de.vtt\n[download] 100% of   11.30KiB in 00:00:00 at 98.05KiB/s\nDeleting existing file The Egg - A Short Story [h6fcK_fRYaI].pl.vtt\n[info] Writing video subtitles to: The Egg - A Short Story [h6fcK_fRYaI].pl.vtt\n[download] Destination: The Egg - A Short Story [h6fcK_fRYaI].pl.vtt\n[download] 100% of   10.02KiB in 00:00:00 at 85.40KiB/s\nDeleting subtitles heading...\nDone 1/5\nDeleting subtitles timestamps...\nDone 2/5\nDeleting subtitles newlines...\nDone 3/5\nDeleting start and end whitespace...\nDone 4/5\nDeleting double or more whitespace...\nDone. 5/5\nCreating the txt file...\nFinished saving The Egg - A Short Story [h6fcK_fRYaI].de.txt\nDeleting subtitles heading...\nDone 1/5\nDeleting subtitles timestamps...\nDone 2/5\nDeleting subtitles newlines...\nDone 3/5\nDeleting start and end whitespace...\nDone 4/5\nDeleting double or more whitespace...\nDone. 5/5\nCreating the txt file...\nFinished saving The Egg - A Short Story [h6fcK_fRYaI].pl.txt\n```\n\nSee also the 4 files that are stored in your relative path:\n```bash\nThe Egg - A Short Story [h6fcK_fRYaI].de.txt\nThe Egg - A Short Story [h6fcK_fRYaI].de.vtt\nThe Egg - A Short Story [h6fcK_fRYaI].pl.txt\nThe Egg - A Short Story [h6fcK_fRYaI].pl.vtt\n```\n\n## Contributing\nContribution guidelines are under development.\nHowever, I am already open for pull requests.\n\n## License\n[![GNU GPLv3 Image](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](https://choosealicense.com/licenses/gpl-3.0/)\n\nSoftware licensed under the [GNU GPLv3](https://choosealicense.com/licenses/gpl-3.0/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsyhackological%2Fytxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsyhackological%2Fytxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsyhackological%2Fytxt/lists"}