{"id":13610516,"url":"https://github.com/tpaschalis/gophersub","last_synced_at":"2025-04-03T16:21:09.607Z","repository":{"id":111537576,"uuid":"184747693","full_name":"tpaschalis/gophersub","owner":"tpaschalis","description":"(Rough, WIP) Go library and command-line utility to work with subtitle files.","archived":false,"fork":false,"pushed_at":"2019-06-03T19:52:45.000Z","size":146,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T04:45:42.094Z","etag":null,"topics":["go","golang","golang-library","srt","subtitles","webvtt"],"latest_commit_sha":null,"homepage":"","language":"Go","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/tpaschalis.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":"roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-03T11:58:19.000Z","updated_at":"2022-07-11T06:22:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0352ca5-c57c-4f89-8aeb-066c70549e87","html_url":"https://github.com/tpaschalis/gophersub","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/tpaschalis%2Fgophersub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpaschalis%2Fgophersub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpaschalis%2Fgophersub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpaschalis%2Fgophersub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpaschalis","download_url":"https://codeload.github.com/tpaschalis/gophersub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247033817,"owners_count":20872533,"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":["go","golang","golang-library","srt","subtitles","webvtt"],"created_at":"2024-08-01T19:01:45.502Z","updated_at":"2025-04-03T16:21:09.584Z","avatar_url":"https://github.com/tpaschalis.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# gophersub\n\n![GitHub](https://img.shields.io/github/license/tpaschalis/gophersub.svg)\n![Travis (.com)](https://img.shields.io/travis/com/tpaschalis/gophersub.svg)\n![Codecov](https://img.shields.io/codecov/c/github/tpaschalis/gophersub.svg)\n\n\nGo library and command-line utility to work with subtitle files.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg style=\"float: right;\" src=\"assets/gopher-tv.png\" alt=\"gophersub logo\"/\u003e\n\u003c/p\u003e\n\ngophersub aims to be a powerful library, that makes working with subtitle files a breeze!!\n\n## Features\n* Works with SubRip `.srt` (and WebVTT `.vtt` soon!) files\n* Designed with modularity and extensibility in mind\n* Extensively tested using Table-Driven Tests. Always at \u003e95% coverage\n* Easy to work with, either as an imported package or a command-line application (soon!)\n\nMost of the actions you might expect from such a tool are already implemented! \n\nTimeshifting, pacing, searching, adding and deleting new subs, getting practical information (such as running time, or average characters-per-minute)\n\n\n## Roadmap \nSince starting the 'project' I've been jotting down my brainstorming, and created a notepad of ideas that I'd like to implement in the future. All these ideas are available [roadmap.md](/roadmap.md). You're more than welcome to take a look, and propose new ones!\n\n***Currently working on :*** \n- [ ] WebVTT support\n- [ ] Modularize/Split code\n- [ ] Add cli support\n- [ ] Run SQL Queries\n\n## Examples\n\n```go\ngot := ParseSRTFile(\"game-of-thorns-s01e01.srt\")\n\nts := time.Duration(2 * time.Second)\n\n// Subtitle files can be timeshifted\ngot = TimeshiftSubtitle(got, ts)\n\n// And also their 'pace can be adjusted, eg. to match video playing at 1.5x speed\ngot, err = PaceSubtitleFile(got, 1.5)\n\n// Subtitles are available for searching, even using Regular Expressions\nmentionsOfJon, err := SearchSubtitleFile(got, \"Jon\")\nmentionsOfJD, err := SearchSubtitleFiles(got, \"Jon|Dany\")\n\n// Along with other common actions, such as adding new subtitles, or deleting unwanted ones\ngot, err = RemoveSubtitle(got, 10)\ngot, err = AddSubtitle(got, \"5m2.120s\", \"5m3.302s\", \"SPOILER ALERT!\")\n\n\n// Save the edited subtitle file\nerr = ToSRTFile(got, \"exports/got-s01e01.srt\")\n\n// Subtitle File information is available, such as\n// detected overlaps, characters-per-minute, total running time etc\nPrintSubfileInfo(got)\n\n// The library can try some optimizations, such as serializing the subtitle indices, removing illegal HTML tags or ...\n\n```\n\n## Prerequisites\n* Go \u003e= 1.12\n* `go-cmp`(https://github.com/google/go-cmp/) to compare structs, in place of reflection\n\n\ngo-cmp is used to compare structs, in place of reflection and can be installed by running\n```\ngo get -u github.com/google/go-cmp/cmp\n```\nThe library requires at least Go 1.12. Most of the functionality was developed using the standard library, and conscious steps to avoid complicated dependencies \ngithub.com/google/go-cmp/cmp\n\n## Installation\n\n\n## Logo Information\nThe logo is homemade. The gopher comes from [egonelbre's repo](https://github.com/egonelbre/gophers) and while the television icon is made by [Freepik](https://www.freepik.com/) from www.flaticon.com.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpaschalis%2Fgophersub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpaschalis%2Fgophersub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpaschalis%2Fgophersub/lists"}