{"id":50411658,"url":"https://github.com/itsrenoria/ptt-go","last_synced_at":"2026-05-31T04:02:01.082Z","repository":{"id":359827352,"uuid":"1148809964","full_name":"itsrenoria/ptt-go","owner":"itsrenoria","description":"Go port of PTT that parses media filenames into clean, structured details.","archived":false,"fork":false,"pushed_at":"2026-05-06T11:00:10.000Z","size":104,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-23T18:03:16.441Z","etag":null,"topics":["filenames","go","media","metadata","parser","ptt"],"latest_commit_sha":null,"homepage":"","language":"Go","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/itsrenoria.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-03T11:49:11.000Z","updated_at":"2026-05-07T11:25:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/itsrenoria/ptt-go","commit_stats":null,"previous_names":["itsrenoria/ptt-go"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/itsrenoria/ptt-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsrenoria%2Fptt-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsrenoria%2Fptt-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsrenoria%2Fptt-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsrenoria%2Fptt-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsrenoria","download_url":"https://codeload.github.com/itsrenoria/ptt-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsrenoria%2Fptt-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33718446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"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":["filenames","go","media","metadata","parser","ptt"],"created_at":"2026-05-31T04:02:00.494Z","updated_at":"2026-05-31T04:02:01.077Z","avatar_url":"https://github.com/itsrenoria.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ptt-go\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/itsrenoria/ptt-go.svg)](https://pkg.go.dev/github.com/itsrenoria/ptt-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/itsrenoria/ptt-go)](https://goreportcard.com/report/github.com/itsrenoria/ptt-go)\n\nptt-go is a Go library for parsing torrent and media filenames to extract structured metadata.\n\n\u003e [!IMPORTANT]\n\u003e This library is a Go port of [dreulavelle/PTT](https://github.com/dreulavelle/PTT) (Python),\n\u003e which was ported from [TheBeastLT/parse-torrent-title](https://github.com/TheBeastLT/parse-torrent-title) (JavaScript).\n\n## Features\n\n- **User-Friendly Interface**: Parse torrent titles with a single function call\n- **Comprehensive Handlers**: 250+ regex patterns for quality, codec, audio, languages, etc.\n- **Anime Detection**: 120+ anime release group patterns\n- **Adult Content Filter**: Keyword-based adult content detection\n- **Highly Extensible**: Add custom handlers and transformers\n\n## Installation\n\n```bash\ngo get github.com/itsrenoria/ptt-go\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    ptt \"github.com/itsrenoria/ptt-go\"\n)\n\nfunc main() {\n    info := ptt.Parse(\"The Simpsons S01E01 1080p BluRay x265 HEVC 10bit AAC 5.1 Tigole\")\n    \n    fmt.Println(info.Title)      // \"The Simpsons\"\n    fmt.Println(info.Seasons)    // [1]\n    fmt.Println(info.Episodes)   // [1]\n    fmt.Println(info.Resolution) // \"1080p\"\n    fmt.Println(info.Quality)    // \"BluRay\"\n    fmt.Println(info.Codec)      // \"hevc\"\n    fmt.Println(info.BitDepth)   // \"10bit\"\n    fmt.Println(info.Audio)      // [\"AAC\"]\n}\n```\n\n## Examples\n\n### Example 1\n\n**Title:** `The Simpsons S01E01 1080p BluRay x265 HEVC 10bit AAC 5.1 Tigole`\n\n**Parsed:**\n```json\n{\n    \"title\": \"The Simpsons\",\n    \"seasons\": [1],\n    \"episodes\": [1],\n    \"resolution\": \"1080p\",\n    \"quality\": \"BluRay\",\n    \"codec\": \"hevc\",\n    \"bit_depth\": \"10bit\",\n    \"audio\": [\"AAC\"]\n}\n```\n\n### Example 2\n\n**Title:** `The.Walking.Dead.S06E07.FRENCH.HDTV.x264-AMB3R.mkv`\n\n**Parsed:**\n```json\n{\n    \"title\": \"The Walking Dead\",\n    \"seasons\": [6],\n    \"episodes\": [7],\n    \"languages\": [\"fr\"],\n    \"quality\": \"HDTV\",\n    \"codec\": \"avc\",\n    \"group\": \"AMB3R\",\n    \"extension\": \"mkv\"\n}\n```\n\n### Example 3\n\n**Title:** `Movie.2024.2160p.UHD.BluRay.REMUX.DV.HDR10+.TrueHD.Atmos.7.1-GROUP`\n\n**Parsed:**\n```json\n{\n    \"title\": \"Movie\",\n    \"year\": 2024,\n    \"resolution\": \"2160p\",\n    \"quality\": \"BluRay REMUX\",\n    \"hdr\": [\"DV\", \"HDR10+\"],\n    \"audio\": [\"TrueHD\", \"Atmos\"],\n    \"group\": \"GROUP\"\n}\n```\n\n## Supported Fields\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `Title` | `string` | Cleaned media title |\n| `Year` | `int` | Release year |\n| `Seasons` | `[]int` | Season numbers |\n| `Episodes` | `[]int` | Episode numbers |\n| `Resolution` | `string` | `2160p`, `1080p`, `720p`, `480p` |\n| `Quality` | `string` | `BluRay`, `WEB-DL`, `WEBRip`, `HDRip`, etc. |\n| `Codec` | `string` | `hevc`, `avc`, `av1`, `xvid` |\n| `Audio` | `[]string` | `DTS Lossless`, `TrueHD`, `Atmos`, `AAC`, etc. |\n| `HDR` | `[]string` | `DV`, `HDR10+`, `HDR` |\n| `BitDepth` | `string` | `10bit`, `8bit` |\n| `Languages` | `[]string` | ISO 639-1 codes: `en`, `fr`, `de`, etc. |\n| `EpisodeCode` | `string` | 8-character hash (anime) |\n| `Group` | `string` | Release group name |\n| `Edition` | `string` | `Directors Cut`, `Extended Edition`, `IMAX` |\n| `Network` | `string` | `Netflix`, `Amazon`, `HBO`, `Disney` |\n| `Container` | `string` | `mkv`, `mp4`, `avi` |\n| `Extension` | `string` | File extension |\n| `Anime` | `bool` | Anime release detected |\n| `Adult` | `bool` | Adult content detected |\n| `Complete` | `bool` | Complete series/collection |\n| `Proper` | `bool` | PROPER release |\n| `Repack` | `bool` | REPACK release |\n| `Remastered` | `bool` | Remastered release |\n| `Documentary` | `bool` | Documentary content |\n| `Dubbed` | `bool` | Dubbed audio |\n| `Subbed` | `bool` | Contains subtitles |\n| `Hardcoded` | `bool` | Hardcoded subtitles |\n| `Trash` | `bool` | CAM/TS quality |\n| `3D` | `bool` | 3D content |\n| `Unrated` | `bool` | Unrated version |\n| `Upscaled` | `bool` | AI upscaled |\n\n## Advanced Usage\n\nCreate a custom parser instance:\n\n```go\npackage main\n\nimport (\n    ptt \"github.com/itsrenoria/ptt-go\"\n)\n\nfunc main() {\n    // Create a new parser\n    parser := ptt.NewParser()\n    \n    // Add default handlers\n    ptt.AddDefaults(parser)\n    \n    // Add custom handler\n    parser.AddRegexHandler(\"custom_field\", \n        regexp.MustCompile(`(?i)\\bMY_PATTERN\\b`),\n        ptt.TransformValue(\"custom_value\"),\n        ptt.HandlerOptions{Remove: true})\n    \n    // Parse\n    result := parser.Parse(\"Title with MY_PATTERN 1080p\")\n}\n```\n\n## Built-in Transformers\n\n- `TransformNone` - Returns matched value unchanged\n- `TransformValue(v)` - Returns static value\n- `TransformInteger` - Converts to integer\n- `TransformBoolean` - Returns true if matched\n- `TransformLowercase` - Lowercases the value\n- `TransformUppercase` - Uppercases the value\n- `TransformRange` - Parses ranges like \"1-5\" into [1,2,3,4,5]\n- `TransformArray(fn)` - Wraps result in array\n- `TransformUniqConcat(fn)` - Appends unique values to list\n\n## Credits\n\nThis library is a Go port of:\n- [dreulavelle/PTT](https://github.com/dreulavelle/PTT) (Python)\n- [TheBeastLT/parse-torrent-title](https://github.com/TheBeastLT/parse-torrent-title) (JavaScript)\n\n## License\n\nMIT License - see [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsrenoria%2Fptt-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsrenoria%2Fptt-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsrenoria%2Fptt-go/lists"}