{"id":15914954,"url":"https://github.com/san650/subtitle","last_synced_at":"2025-04-03T04:26:07.847Z","repository":{"id":70307819,"uuid":"208524518","full_name":"san650/subtitle","owner":"san650","description":"Elixir library to parse subtitle files (SubRip .srt files or MicroDVD .sub files)","archived":false,"fork":false,"pushed_at":"2019-09-16T12:57:49.000Z","size":30,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T18:31:27.411Z","etag":null,"topics":["elixir","microdvd","subrip","subtitles"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/san650.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-15T01:12:22.000Z","updated_at":"2024-04-13T17:53:15.000Z","dependencies_parsed_at":"2023-02-25T02:45:53.331Z","dependency_job_id":null,"html_url":"https://github.com/san650/subtitle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/san650%2Fsubtitle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/san650%2Fsubtitle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/san650%2Fsubtitle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/san650%2Fsubtitle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/san650","download_url":"https://codeload.github.com/san650/subtitle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246935559,"owners_count":20857446,"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":["elixir","microdvd","subrip","subtitles"],"created_at":"2024-10-06T17:20:52.538Z","updated_at":"2025-04-03T04:26:07.823Z","avatar_url":"https://github.com/san650.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Subtitle\n\nElixir library to parse subtitle files.\n\nCurrent supported formats:\n\n* SubRip subtitle files (`.srt`).\n* MicroDVD subtitle fiels (`.txt` or `.sub`).\n\n## Installation\n\nAdd `subtitle` to your list of dependencies in `mix.exs`:\n\n```elixir\ndefp deps do\n  [{:subtitle, github: \"https://github.com/san650/subtitle\"}]\nend\n```\n\nInstall via `mix deps.get`.\n\n## Usage\n\nAfter installing just write a little Elixir function:\n\n```elixir\n# Returns a stream of %Subtitle.Frame{} structs\nSubtitle.from_file(\"lord_of_the_rings.srt\")\n|\u003e Enum.to_list\n```\n\nStreaming subtitles from any `IO.stream`\n\n```elixir\nsubtitle = \"\"\"\n1\n00:00:00,000 --\u003e 00:00:01,000\nHello, world!\n\n2\n00:00:02,000 --\u003e 00:00:03,000\nThis is the second frame\n\n3\n00:00:04,000 --\u003e 00:00:05,000\nThis is the third line\n\n\"\"\"\n\n{:ok, file} = StringIO.open(subtitle, [:line])\nfile\n|\u003e IO.stream(:line)\n|\u003e Subtitle.SubRip.stream()\n|\u003e Enum.take(1)\n# =\u003e %Subtitle.Frame{\n#      index: 1,\n#      begin_time: ~T[00:00:00.000000],\n#      end_time: ~T[00:00:01.000000],\n#      caption: \"Hello, world!\"\n#    }\n```\n\n## License\n\n`Subtitle` is licensed under the MIT license.\n\nSee [LICENSE](./LICENSE) for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsan650%2Fsubtitle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsan650%2Fsubtitle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsan650%2Fsubtitle/lists"}