n10v / id3v2

🎵 ID3 decoding and encoding library for Go
https://pkg.go.dev/github.com/bogem/id3v2/v2
MIT License
340 stars 52 forks source link

Are chapters supported? #34

Closed Crabtr closed 6 years ago

Crabtr commented 6 years ago

I'm currently working with some podcasts and I'm specifically trying to pull out their chapters. From what I can tell a CHAP (chapter) frame should be returned in an AllFrames() call, but only a TIT2 frame is being returned. Here's my code:

func main() {
    mp3, err := id3v2.Open(os.Args[1], id3v2.Options{Parse: true})
    if err != nil {
        panic(err)
    }
    defer mp3.Close()

    for key, frame := range mp3.AllFrames() {
        fmt.Println(key)
        fmt.Println(frame)
    }
}

Is this the correct method or does the library not support chapters? Also, here's the specific file I'm working with:

https://audio.fireside.fm/podcasts/audio/b/b44de5fa-47c1-4e94-bf9e-c72f8d1c8f5d/episodes/2/2bedf85e-f897-41e5-b498-243b1dea12b4/2bedf85e-f897-41e5-b498-243b1dea12b4.mp3

Edit: I think I should be looking for CHAP frames and not CTOC frames.

n10v commented 6 years ago

Hi! Thank you for submitting this issue. The problem is that the second frame in the tag (COMM) has invalid size format: 11010000 on binary. It isn't allowed by specification (all sizes should always start with 0) and id3v2 can't parse these sizes correctly yet.

n10v commented 6 years ago

Related to #13

n10v commented 6 years ago

Fixed in https://github.com/bogem/id3v2/commit/3845103da5b1698289b82a90f5d2559b770bd996