{"id":26745121,"url":"https://github.com/bogem/id3v2","last_synced_at":"2025-03-28T08:01:50.119Z","repository":{"id":8573153,"uuid":"58877778","full_name":"n10v/id3v2","owner":"n10v","description":"🎵 ID3 decoding and encoding library for Go","archived":false,"fork":false,"pushed_at":"2023-10-28T15:04:52.000Z","size":14674,"stargazers_count":337,"open_issues_count":23,"forks_count":52,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-10-29T10:45:09.824Z","etag":null,"topics":["go","golang","id3","id3v2","music"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/bogem/id3v2/v2","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/n10v.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":"2016-05-15T18:36:53.000Z","updated_at":"2024-10-12T06:29:54.000Z","dependencies_parsed_at":"2024-06-09T21:23:15.332Z","dependency_job_id":"fe017c6e-ea47-4a8f-b69c-31a862470b7c","html_url":"https://github.com/n10v/id3v2","commit_stats":null,"previous_names":["bogem/id3v2"],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n10v%2Fid3v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n10v%2Fid3v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n10v%2Fid3v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n10v%2Fid3v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n10v","download_url":"https://codeload.github.com/n10v/id3v2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991572,"owners_count":20706127,"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","id3","id3v2","music"],"created_at":"2025-03-28T08:01:30.144Z","updated_at":"2025-03-28T08:01:50.100Z","avatar_url":"https://github.com/n10v.png","language":"Go","funding_links":[],"categories":["Audio and Music","音频和音乐","音频和音乐库","Uncategorized","音频和视频","Audio/Music","音頻和音樂","\u003cspan id=\"音频和音乐-audio-and-music\"\u003e音频和音乐 Audio and Music\u003c/span\u003e"],"sub_categories":["Contents"],"readme":"# id3v2\n\nImplementation of ID3 v2.3 and v2.4 in native Go.\n\n## Installation\n\n```\ngo get -u github.com/bogem/id3v2/v2\n```\n\n## Documentation\n\nhttps://pkg.go.dev/github.com/bogem/id3v2/v2\n\n## Usage example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/bogem/id3v2/v2\"\n)\n\nfunc main() {\n\ttag, err := id3v2.Open(\"file.mp3\", id3v2.Options{Parse: true})\n\tif err != nil {\n \t\tlog.Fatal(\"Error while opening mp3 file: \", err)\n \t}\n\tdefer tag.Close()\n\n\t// Read tags\n\tfmt.Println(tag.Artist())\n\tfmt.Println(tag.Title())\n\n\t// Set tags\n\ttag.SetArtist(\"Aphex Twin\")\n\ttag.SetTitle(\"Xtal\")\n\n\tcomment := id3v2.CommentFrame{\n\t\tEncoding:    id3v2.EncodingUTF8,\n\t\tLanguage:    \"eng\",\n\t\tDescription: \"My opinion\",\n\t\tText:        \"I like this song!\",\n\t}\n\ttag.AddCommentFrame(comment)\n\n\t// Write tag to file.mp3\n\tif err = tag.Save(); err != nil {\n\t\tlog.Fatal(\"Error while saving a tag: \", err)\n\t}\n}\n```\n\n## Read multiple frames\n\n```go\npictures := tag.GetFrames(tag.CommonID(\"Attached picture\"))\nfor _, f := range pictures {\n\tpic, ok := f.(id3v2.PictureFrame)\n\tif !ok {\n\t\tlog.Fatal(\"Couldn't assert picture frame\")\n\t}\n\n\t// Do something with picture frame\n\tfmt.Println(pic.Description)\n}\n```\n\n## Encodings\n\nFor example, if you want to set comment frame with custom encoding,\nyou may do the following:\n\n```go\ncomment := id3v2.CommentFrame{\n\tEncoding:    id3v2.EncodingUTF16,\n\tLanguage:    \"ger\",\n\tDescription: \"Tier\",\n\tText:        \"Der Löwe\",\n}\ntag.AddCommentFrame(comment)\n```\n\n`Text` field will be automatically encoded with UTF-16BE with BOM and written to w.\n\nUTF-8 is default for v2.4, ISO-8859-1 - for v2.3.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogem%2Fid3v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbogem%2Fid3v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogem%2Fid3v2/lists"}