{"id":20643502,"url":"https://github.com/dxing97/subs2cia","last_synced_at":"2025-10-06T02:14:47.873Z","repository":{"id":43092476,"uuid":"236063398","full_name":"dxing97/subs2cia","owner":"dxing97","description":"Condensed Immersive Audiovisual media generator from subtitles for language learning","archived":false,"fork":false,"pushed_at":"2025-06-24T23:09:52.000Z","size":193,"stargazers_count":115,"open_issues_count":12,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-29T18:34:27.377Z","etag":null,"topics":["language-learning","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dxing97.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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,"zenodo":null}},"created_at":"2020-01-24T18:52:38.000Z","updated_at":"2025-09-28T09:00:06.000Z","dependencies_parsed_at":"2025-05-26T09:12:14.193Z","dependency_job_id":"cd46302a-add0-4db3-a850-1029310e6163","html_url":"https://github.com/dxing97/subs2cia","commit_stats":{"total_commits":127,"total_committers":5,"mean_commits":25.4,"dds":0.03937007874015752,"last_synced_commit":"a88fcb9b032071696a9c5fe708e049fb8383732d"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/dxing97/subs2cia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxing97%2Fsubs2cia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxing97%2Fsubs2cia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxing97%2Fsubs2cia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxing97%2Fsubs2cia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxing97","download_url":"https://codeload.github.com/dxing97/subs2cia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxing97%2Fsubs2cia/sbom","scorecard":{"id":361830,"data":{"date":"2025-08-11","repo":{"name":"github.com/dxing97/subs2cia","commit":"c204b5901f85e20e9af2cba380e1b682a09e7034"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":3,"reason":"4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 7/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2023-177 / GHSA-x7m3-jprg-wc5g","Warn: Project is vulnerable to: PYSEC-2025-49 / GHSA-5rjg-fvgr-3xxf","Warn: Project is vulnerable to: GHSA-cx63-2mw6-8hw5","Warn: Project is vulnerable to: PYSEC-2022-43012 / GHSA-r9hx-vwmv-q579","Warn: Project is vulnerable to: PYSEC-2017-74","Warn: Project is vulnerable to: GHSA-g7vv-2v7x-gj9p"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T11:02:51.243Z","repository_id":43092476,"created_at":"2025-08-18T11:02:51.243Z","updated_at":"2025-08-18T11:02:51.243Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278547821,"owners_count":26004775,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["language-learning","python3"],"created_at":"2024-11-16T16:13:00.577Z","updated_at":"2025-10-06T02:14:47.845Z","avatar_url":"https://github.com/dxing97.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"subs2cia - Extract subtitled dialogue from audiovisual media for use in language acquisition \n\n\n## Features\n * Generates _condensed_ media from subtitled media that only contains spoken dialogue (`subs2cia condense`)\n     * No unnatural stutters: simultaneous and overlapping subtitles lines are merged for seamless listening\n     * Automatically generate condensed subtitles, audio, and video from input sources (video must be enabled with `-m`)\n     * Automagically chooses subtitle and audio tracks from a certain language or manually specify what inputs to condense\n     (`-tl`, `-si`, `-ai`, `-ls`)\n     * Automatically filter out subtitles that don't contain dialogue using built in heuristics or user-defined regexes (`-ni`, `-R`)\n     * Ignore subtitled music found in openings/endings manually (`-I`) or by chapter (`-Ic`)  \n     * Reinserts natural spacing between sentences that start and end close together (`-t`)\n     * Subtitles not perfectly aligned? Pad subtitles with additional audio (`-p`)\n     * Process multiple files with batch mode (`-b`)\n * **EXPERIMENTAL**: Export subtitles with audio and screenshots into your flashcard SRS of choice (`subs2cia srs`)\n\n## Dependencies\n* Python 3.6 or later\n* ffmpeg\n    * `ffmpeg` and `ffprobe` must be on your PATH (i.e. can execute `ffmpeg` and `ffprobe` from the command line)\n* pip packages:\n    * ffmpeg-python\n    * pycountry\n    * pysubs2\n    * setuptools\n    * tqdm\n    * pandas\n    * gevent\n    * colorlog\n\n## Installation Instructions\nsubs2cia is currently a command-line script. Usage requires interaction with a terminal interface.\n### Windows\nInstall Python 3.6 or later. During or after the installation process, make sure you add Python to your PATH and also install pip.\n\nInstructions for installing and adding ffmpeg to your path can be found [here](http://blog.gregzaal.com/how-to-install-ffmpeg-on-windows/).\n\nThe subs2cia installation process is generally the same as for Linux, although some commands may have different aliases\n(e.g. instead of `pip3`, you may need to run `py -m pip` instead). Running\n```\npy -m pip install subs2cia\n```\nin command prompt should work. \n\nSome useful links on installing `pip` and python packages:\n* https://pip.pypa.io/en/stable/installing/\n* https://docs.python.org/3/installing/index.html\n\nYou may need to restart Command Prompt for path changes to take effect when installing `pip`.\n\n### macOS:\nInstall Python and ffmpeg through the method of your choice, e.g. [Homebrew](https://brew.sh/). In Terminal, run:\n```\n# run this after installing Homebrew\nbrew install python ffmpeg\n```\nHomebrew should have also installed `pip` for you, which you can use to install subs2cia from PyPI:\n```\npip3 install subs2cia\n```\nYou should now be able to run the script:\n```\nsubs2cia condense -h\n```\n\n### Linux\nOn systems with the `apt` package manager (Ubuntu, Debian, etc):\n```\nsudo apt install python3 python3-pip ffmpeg\npip3 install subs2cia\nsubs2cia condense -h\n```\n\n### Install from source\nDownload or clone the repository and navigate to it:\n```\n$ git clone \"https://github.com/dxing97/subs2cia\"\n$ cd subs2cia\n```\nUse pip to install:\n```\n$ pip3 install .\n```\nOn WSL, you may need to add `~/.local/bin` to your PATH first.\n\n### Run Without Installing\nIf you prefer, you can also download the repository and run ``subs2cia/main.py`` directly.\n\n\n## Condense Quickstart and Examples\n```\nsubs2cia condense -i \"My Video.mkv\"\n```\n* Condense `My Video.mkv` into `My Video.condensed.mp3` and `My Video.condensed.srt` (if embedded subtitles are SRT formatted)\n\n```\nsubs2cia condense -i video.mkv -p 150 -t 1000 -tl english\n```\n* Condense `video.mkv` into `video.condensed.mp3` and `video.condensed.srt`\n* Prefer english subtitle/audio tracks if they exist. \n* Pad each subtitle's start/end time by 150ms\n* Merge subtitles that start within 1300ms (1000 + 2x150) of each other (i.e. also add silences shorter than 1300ms)\n\n```\nsubs2cia condense -i video.mkv \"video subtitles.ass\" -ae flac --no-gen-subtitle\n```\n\n* Condense `video.mkv` using `video subtitles.ass` into `video.condensed.flac`. \n    * Note: subs2cia will default to try using external subtitle/audio files first.\n* Don't generate condensed subtitles.\n\n```subs2cia condense -i audio.mp3 subtitles.ass```\n* Condense `audio.mp3` and `subtitles.srt` into `audio.condensed.mp3` and `audio.condensed.srt`\n\n```subs2cia condense -b -i *.mkv *.srt -I 0m 1m30s -I e2m +1m30s -tl ja -t 1500 -p 100``` \n* Condense all `.mkv` and `.srt` files in a directory organized according to Plex standards. \n* Ignore the first 1m30s of subtitles and the 1m30s of subtitles 2 minutes from the end. \n* Prefer Japanese audio/subtitles. \n* Set subtitle padding to 100ms and threshold to merge subtitles to 1700ms:\n\nFor a more complete usage guide, run `subs2cia condense -h` or take a look at [USAGE](USAGE.md).\n\n## SRS Export Quickstart and Examples\nMost options are shared with `condense`. See `subs2cia srs -h` for a full list of options. \n### Example commands\n```subs2cia srs -i video.mkv```\n* extract the first audio and first subtitle track in `video.mkv`  and generate `video.tsv` and a lotta `.mp3` and `.jpg` files\n\n```\nsubs2cia srs -b -i *.mkv *.ja.srt -d srs_export -p 100 -N \n```\n* enable batch mode and use all `.mkv` and japanese `.srt` files in the current directory\n* save output files to a directory called srs_export\n* pad timings by 100ms\n* normalize audio to be roughly the same volume\nNote that each input file group will have its own `.tsv` output\n\n### Usage notes\n\nThe same overall idea is the same: give subs2cia an audio and subtitle source. Instead of generating a set of \ncondensed outputs, a .tsv (tab-seperated values) file is generated\nalong with audio clips and screenshots (if a video source is given). \n\nEach column of the .tsv file represents the following:\n1. Subtitle text\n2. Time range of subtitle in milliseconds: `start-end`\n3. Audio:`[sound:media_start-end.mp3]`\n4. Screenshot: `\u003cimg src='media_start-end.jpg'\u003e`\n   * Screenshot resolution is the video file's resolution\n5. Video clip (currently disabled)\n6. Comma-seperated list of input files used\n\nNote that in batch mode, multiple .tsv files are generated, one for each input group. \n\nSince there could be hundreds output files, it's highly recommended to specify an output\ndirectory with `-d` in order to avoid cluttering your filesystem. \n\n### Anki Import Instructions\n1. In the main screen, click on `File-\u003eImport...`\n2. Select the .tsv file you would like to import\n3. In the Import dialog box:\n   1. Choose the note type and deck you'd like to import to\n   2. Make sure fields are separated by tabs\n   3. Make sure `Allow HTML in fields` is checked\n   4. Adjust the 6 fields (detailed above) to fit your note type\n   5. Click `Import`\n4. Verify audio and screenshots were automagically imported as well. If audio and/or screenshots are missing, they may \n    need to be manually moved into your collections folder. If the .tsv file isn't in the same directory as the generated\n    audio clips and images, Anki won't copy them for you. \n    \n## Limitations and Assumptions\n* Won't work on bitmap subtitles (e.g. PGS subtitles), only text-based supports subtitle formats supported by ffmpeg and pysubs2 \n  encoded in UTF-8 will work\n* Subtitles must be properly aligned to audio. No attempt is made by subs2cia to align subtitles. \n\n# subzipper\nRenames subtitle files to match a reference (video) file to conform with Plex-style naming standards, \noptionally adding language information to the suffix. Intended for use with shell wildcards.\n\n## Usage\n```\n$ subzipper -h\nusage: subzipper.py [-h] -s \u003cinput files\u003e [\u003cinput files\u003e ...] -r \u003cinput files\u003e\n                    [\u003cinput files\u003e ...] [-l ISO_LANG_CODE] [-ns] [-d] [-v]\n\nSubZipper: Map video files to subtitle files\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -s \u003cinput files\u003e [\u003cinput files\u003e ...], --subtitle \u003cinput files\u003e [\u003cinput files\u003e ...]\n                        List of subtitle files. Number of subtitle files\n                        should equal number of reference files.\n  -r \u003cinput files\u003e [\u003cinput files\u003e ...], --reference \u003cinput files\u003e [\u003cinput files\u003e ...]\n                        List of reference files, typically video files. Number\n                        of subtitle files should equal number of reference\n                        files.\n  -l ISO_LANG_CODE, --language ISO_LANG_CODE\n                        Language code to append to end of subtitle file.\n                        Optional. If set, will be checked for validity.\n  -ns, --no-sort        If set, will not sort input files alphabetically.\n  -d, --dry-run         If set, will print out mappings but will not write any\n                        changes to disk.\n  -v, --verbose         Verbose output if set.\n```\n\n## Examples\nRename ``episode01.ass`` to ``MyShow_S01E01.ja.ass`` and ``episode02.ass`` to ``MyShow_S01E02.ja.ass``, \n```\nsubzipper -s \"episode01.ass\" \"episode02.ass\" -r \"MyShow_S01E01.mkv\" \"MyShow_S01E02.mkv\" -l ja\n```\nMap all subtitles to all video files,\n```\nsubzipper -s *.ass -r *.mkv -l ja\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxing97%2Fsubs2cia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxing97%2Fsubs2cia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxing97%2Fsubs2cia/lists"}