Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChapterInfo from Audible Api incorrect #278

Closed
Mbucari opened this issue Jun 20, 2022 · 8 comments
Closed

ChapterInfo from Audible Api incorrect #278

Mbucari opened this issue Jun 20, 2022 · 8 comments

Comments

@Mbucari
Copy link
Collaborator

Mbucari commented Jun 20, 2022

I was just running some books through Libation (splitting by chapter), and I noticed that very few of the chapters files were being created. I thought I broke something with my PR, but it looks like Audible is returning incorrect chapter info from the catalog endpoint.

Check out ASINs: "1774246171" and "B002V19RO6"

@Mbucari
Copy link
Collaborator Author

Mbucari commented Jun 20, 2022

OK, I dug a little deeper and discovered that Audible must have recently changed their chapter format. Previously, "chapter_info" contained a "chapters" array . Now, each "chapters" can also contain a "chapters" (useful I suppose for hierarchical chapter structures).

Here's the json from B002V19RO6. We need to fix AudibleApi.Common.

      "chapter_info": {
        "brandIntroDurationMs": 1904,
        "brandOutroDurationMs": 4969,
        "chapters": [
          {
            "length_ms": 9965,
            "start_offset_ms": 0,
            "start_offset_sec": 0,
            "title": "Opening Credits"
          },
          {
            "chapters": [
              {
                "length_ms": 2432004,
                "start_offset_ms": 12965,
                "start_offset_sec": 13,
                "title": "I"
              },
              {
                "length_ms": 1157421,
                "start_offset_ms": 2444969,
                "start_offset_sec": 2445,
                "title": "II"
              },
              {
                "length_ms": 1100161,
                "start_offset_ms": 3602390,
                "start_offset_sec": 3602,
                "title": "III"
              },
              {
                "length_ms": 1367377,
                "start_offset_ms": 4702551,
                "start_offset_sec": 4703,
                "title": "IV"
              },
              {
                "length_ms": 1908030,
                "start_offset_ms": 6069928,
                "start_offset_sec": 6070,
                "title": "V"
              },
              {
                "length_ms": 771088,
                "start_offset_ms": 7977958,
                "start_offset_sec": 7978,
                "title": "VI"
              },
              {
                "length_ms": 1620567,
                "start_offset_ms": 8749046,
                "start_offset_sec": 8749,
                "title": "VII"
              },
              {
                "length_ms": 2904816,
                "start_offset_ms": 10369613,
                "start_offset_sec": 10370,
                "title": "VIII"
              }
            ],
            "length_ms": 3000,
            "start_offset_ms": 9965,
            "start_offset_sec": 10,
            "title": "One"
          },
          {
            "chapters": [
              {
                "length_ms": 1587195,
                "start_offset_ms": 13277429,
                "start_offset_sec": 13277,
                "title": "I"
              },
              {
                "length_ms": 1303986,
                "start_offset_ms": 14864624,
                "start_offset_sec": 14865,
                "title": "II"
              },
              {
                "length_ms": 1254713,
                "start_offset_ms": 16168610,
                "start_offset_sec": 16169,
                "title": "III"
              },
              {
                "length_ms": 1306773,
                "start_offset_ms": 17423323,
                "start_offset_sec": 17423,
                "title": "IV"
              },
              {
                "length_ms": 1176787,
                "start_offset_ms": 18730096,
                "start_offset_sec": 18730,
                "title": "V"
              },
              {
                "length_ms": 374631,
                "start_offset_ms": 19906883,
                "start_offset_sec": 19907,
                "title": "VI"
              },
              {
                "length_ms": 1000362,
                "start_offset_ms": 20281514,
                "start_offset_sec": 20282,
                "title": "VII"
              },
              {
                "length_ms": 1536697,
                "start_offset_ms": 21281876,
                "start_offset_sec": 21282,
                "title": "VIII"
              },
              {
                "length_ms": 5398779,
                "start_offset_ms": 22818573,
                "start_offset_sec": 22819,
                "title": "IX"
              },
              {
                "length_ms": 899309,
                "start_offset_ms": 28217352,
                "start_offset_sec": 28217,
                "title": "X"
              }
            ],
            "length_ms": 3000,
            "start_offset_ms": 13274429,
            "start_offset_sec": 13274,
            "title": "Two"
          },
          {
            "chapters": [
              {
                "length_ms": 1857011,
                "start_offset_ms": 29119661,
                "start_offset_sec": 29120,
                "title": "I"
              },
              {
                "length_ms": 2921117,
                "start_offset_ms": 30976672,
                "start_offset_sec": 30977,
                "title": "II"
              },
              {
                "length_ms": 1932504,
                "start_offset_ms": 33897789,
                "start_offset_sec": 33898,
                "title": "III"
              },
              {
                "length_ms": 1146183,
                "start_offset_ms": 35830293,
                "start_offset_sec": 35830,
                "title": "IV"
              },
              {
                "length_ms": 628611,
                "start_offset_ms": 36976476,
                "start_offset_sec": 36976,
                "title": "V"
              },
              {
                "length_ms": 1522532,
                "start_offset_ms": 37605087,
                "start_offset_sec": 37605,
                "title": "VI"
              }
            ],
            "length_ms": 3000,
            "start_offset_ms": 29116661,
            "start_offset_sec": 29117,
            "title": "Three"
          },
          {
            "length_ms": 1851188,
            "start_offset_ms": 39127619,
            "start_offset_sec": 39128,
            "title": "The Principles of Newspeak"
          }
        ],
        "is_accurate": true,
        "runtime_length_ms": 40978807,
        "runtime_length_sec": 40979
      }

@Mbucari
Copy link
Collaborator Author

Mbucari commented Jun 20, 2022

rmcrackan added a commit that referenced this issue Jun 21, 2022
* #281 -- template bug fix

Thanks for the quick turn-around, @Mbucari !
@rmcrackan
Copy link
Owner

Thanks -- fixed by you in version 8.1

@Mbucari
Copy link
Collaborator Author

Mbucari commented Jun 21, 2022

@mkb79

Did you know about this change?

@rmcrackan
Copy link
Owner

@Mbucari , @mkb79 -- I love that we keep each other up to date on this stuff. Years ago there was a guy (Omar Roth) who made an audible api in a language called crystal. It was one of the first I ever found and when he was active he was super friendly. it's a great legacy that I'm glad persists.

@mkb79
Copy link

mkb79 commented Jun 21, 2022

@Mbucari
Months ago, a user reported on GitHub (I think in the Openaudible repo) that he has an audiobook with such subchapters. He asked if they could be implemented. I didn't pay attention to this myself, because I don't have such audiobooks!

@rmcrackan
Yeah Omar Roth's package is well known by me. He was the one who inspired me to write my Audible package. Or rather, I ported his package to Python. I've used his good documentation and API endpoints description in my docs.

@rmcrackan @Mbucari
I am currently working on a Goodreads API. I found out how to use the API independently of a developer API key.

@Mbucari
Copy link
Collaborator Author

Mbucari commented Jun 21, 2022

because I don't have such audiobooks

Both of those ASINs I listed are audible plus titles, so you can test them. As recently as last week I downloaded the same audiobooks through libation, and at that time they did not have sub chapters. It seems audible may be going through their catalog and updating metadata.

@mkb79
Copy link

mkb79 commented Jun 21, 2022

@Mbucari
Audible Plus is not available in Germany!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants