[GH-ISSUE #61] Add missing "audio" for download (and create db migrations along the way) #8

Closed
opened 2026-10-13 19:45:29 +00:00 by bsakaguchi · 9 comments
Owner

Originally created by @thug21 on GitHub (Aug 19, 2025).
Original GitHub issue: https://github.com/Glitchy-Sheep/boosty-downloader/issues/61

Originally assigned to: @Glitchy-Sheep on GitHub.

If the type type: "audio" is encountered, the download fails with an error. Please add this type for downloading

sample boosty response:

{
  "contentCounters": [
    {
      "type": "audio",
      "count": 1,
      "size": 57415680
    },
    {
      "type": "text",
      "count": 4,
      "size": 0
    }
  ],
  "signedQuery": "?user_id=32792338&content_id=0b923a88-2f67-4fb9-8573-594adb80bfb5&expire_time=1755690633&sign=82c23903b8f35780d4966ebca74aa4c014c4521087a40c1cd400258d387c5ea1",
  "title": "Аудиокнига о создателе советских глушителей. Гл1-5.",
  "advertiserInfo": null,
  "createdAt": 1713234250,
  "count": {
    "comments": 10,
    "reactions": {
      "like": 12,
      "heart": 11,
      "sad": 0,
      "fire": 1,
      "angry": 0,
      "laught": 0,
      "dislike": 0,
      "wonder": 0
    },
    "likes": 11
  },
  "tags": [],
  "price": 300,
  "isCommentsDenied": false,
  "hasAccess": true,
  "isDeleted": false,
  "isPinned": false,
  "publishTime": 1713234250,
  "data": [
    {
      "complete": true,
      "url": "https://cdn.boosty.to/audio/7106c1e1-84c0-4c68-aefc-cf1cacefc5dc",
      "type": "audio_file",
      "id": "7106c1e1-84c0-4c68-aefc-cf1cacefc5dc",
      "fileType": "MP3",
      "album": "",
      "duration": 1435,
      "timeCode": 0,
      "title": "Брамит 1-5 уск.mp3",
      "size": 57415680,
      "artist": "",
      "track": "",
      "showViewsCounter": false,
      "uploadStatus": "ok",
      "viewsCounter": 0
    },
    {
      "modificator": "",
      "content": "[\"\",\"unstyled\",[]]",
      "type": "text"
    },
    {
      "content": "",
      "modificator": "BLOCK_END",
      "type": "text"
    }
  ],
  "currencyPrices": {
    "RUB": 300,
    "USD": 3.9
  },
  "teaser": [
    {
      "modificator": "",
      "content": "[\"Сергей Козлов \\\"Беззвучный бьет\\\". Главы 1-5.\",\"unstyled\",[]]",
      "type": "text"
    },
    {
      "type": "text",
      "modificator": "BLOCK_END",
      "content": ""
    }
  ],
  "comments": {
    "data": [],
    "extra": {
      "isFirst": true,
      "isLast": false
    }
  },
  "isLiked": false,
  "sortOrder": 1713234250,
  "isWaitingVideo": false,
  "donations": 900,
  "showViewsCounter": false,
  "donators": {
    "extra": {
      "isLast": true
    },
    "data": []
  },
  "isBlocked": false,
  "isPublished": true,
  "int_id": 5724750,
  "isRecord": false,
  "id": "0b923a88-2f67-4fb9-8573-594adb80bfb5",
  "subscriptionLevel": {
    "isLimited": false,
    "price": 200,
    "ownerId": 7378931,
    "deleted": false,
    "currencyPrices": {
      "USD": 2.58,
      "RUB": 200
    },
    "name": "Человеческое Спасибо!",
    "data": [
      {
        "modificator": "",
        "content": "[\"Вы получаете доступ к нашим публикациям.\",\"unstyled\",[]]",
        "type": "text"
      },
      {
        "type": "text",
        "modificator": "BLOCK_END",
        "content": ""
      },
      {
        "modificator": "",
        "content": "[\"Спасибо за вашу поддержку\",\"unstyled\",[]]",
        "type": "text"
      },
      {
        "modificator": "BLOCK_END",
        "content": "",
        "type": "text"
      }
    ],
    "isArchived": false,
    "promos": [],
    "id": 818373,
    "createdAt": 1652231130,
    "isHidden": false
  },
  "user": {
    "name": "Konstantin Konev",
    "flags": {
      "showPostDonations": true
    },
    "avatarUrl": "images.boosty.to/user/7378931/avatar?change_time=1652227901",
    "blogUrl": "konev",
    "id": 7378931,
    "hasAvatar": true
  },
  "updatedAt": 1714408386
}
Originally created by @thug21 on GitHub (Aug 19, 2025). Original GitHub issue: https://github.com/Glitchy-Sheep/boosty-downloader/issues/61 Originally assigned to: @Glitchy-Sheep on GitHub. If the type type: "audio" is encountered, the download fails with an error. Please add this type for downloading sample boosty response: ```json { "contentCounters": [ { "type": "audio", "count": 1, "size": 57415680 }, { "type": "text", "count": 4, "size": 0 } ], "signedQuery": "?user_id=32792338&content_id=0b923a88-2f67-4fb9-8573-594adb80bfb5&expire_time=1755690633&sign=82c23903b8f35780d4966ebca74aa4c014c4521087a40c1cd400258d387c5ea1", "title": "Аудиокнига о создателе советских глушителей. Гл1-5.", "advertiserInfo": null, "createdAt": 1713234250, "count": { "comments": 10, "reactions": { "like": 12, "heart": 11, "sad": 0, "fire": 1, "angry": 0, "laught": 0, "dislike": 0, "wonder": 0 }, "likes": 11 }, "tags": [], "price": 300, "isCommentsDenied": false, "hasAccess": true, "isDeleted": false, "isPinned": false, "publishTime": 1713234250, "data": [ { "complete": true, "url": "https://cdn.boosty.to/audio/7106c1e1-84c0-4c68-aefc-cf1cacefc5dc", "type": "audio_file", "id": "7106c1e1-84c0-4c68-aefc-cf1cacefc5dc", "fileType": "MP3", "album": "", "duration": 1435, "timeCode": 0, "title": "Брамит 1-5 уск.mp3", "size": 57415680, "artist": "", "track": "", "showViewsCounter": false, "uploadStatus": "ok", "viewsCounter": 0 }, { "modificator": "", "content": "[\"\",\"unstyled\",[]]", "type": "text" }, { "content": "", "modificator": "BLOCK_END", "type": "text" } ], "currencyPrices": { "RUB": 300, "USD": 3.9 }, "teaser": [ { "modificator": "", "content": "[\"Сергей Козлов \\\"Беззвучный бьет\\\". Главы 1-5.\",\"unstyled\",[]]", "type": "text" }, { "type": "text", "modificator": "BLOCK_END", "content": "" } ], "comments": { "data": [], "extra": { "isFirst": true, "isLast": false } }, "isLiked": false, "sortOrder": 1713234250, "isWaitingVideo": false, "donations": 900, "showViewsCounter": false, "donators": { "extra": { "isLast": true }, "data": [] }, "isBlocked": false, "isPublished": true, "int_id": 5724750, "isRecord": false, "id": "0b923a88-2f67-4fb9-8573-594adb80bfb5", "subscriptionLevel": { "isLimited": false, "price": 200, "ownerId": 7378931, "deleted": false, "currencyPrices": { "USD": 2.58, "RUB": 200 }, "name": "Человеческое Спасибо!", "data": [ { "modificator": "", "content": "[\"Вы получаете доступ к нашим публикациям.\",\"unstyled\",[]]", "type": "text" }, { "type": "text", "modificator": "BLOCK_END", "content": "" }, { "modificator": "", "content": "[\"Спасибо за вашу поддержку\",\"unstyled\",[]]", "type": "text" }, { "modificator": "BLOCK_END", "content": "", "type": "text" } ], "isArchived": false, "promos": [], "id": 818373, "createdAt": 1652231130, "isHidden": false }, "user": { "name": "Konstantin Konev", "flags": { "showPostDonations": true }, "avatarUrl": "images.boosty.to/user/7378931/avatar?change_time=1652227901", "blogUrl": "konev", "id": 7378931, "hasAvatar": true }, "updatedAt": 1714408386 } ```
bsakaguchi 2026-10-13 19:45:29 +00:00
Author
Owner

@Glitchy-Sheep commented on GitHub (Aug 26, 2025):

Oh, thanks for the report!
I haven't encountered audio fragments yet, so I may have occasionally overlooked that problem.

Was there any traceback from the app or specific exception information when that error occurred?

<!-- gh-comment-id:3224507533 --> @Glitchy-Sheep commented on GitHub (Aug 26, 2025): Oh, thanks for the report! I haven't encountered audio fragments yet, so I may have occasionally overlooked that problem. Was there any traceback from the app or specific exception information when that error occurred?
Author
Owner

@Glitchy-Sheep commented on GitHub (Aug 26, 2025):

I don't really remember if there is any protection for unknown data chunks (like audio in your case), but I think they should be skipped and maybe logged as an unknown content type.

I think I should just create a content-creator account and test those cases to be sure.

In general, this looks critical. Thank you again!

<!-- gh-comment-id:3224530935 --> @Glitchy-Sheep commented on GitHub (Aug 26, 2025): I don't really remember if there is any protection for unknown data chunks (like audio in your case), but I think they should be skipped and maybe logged as an unknown content type. I think I should just create a content-creator account and test those cases to be sure. In general, this looks critical. Thank you again!
Author
Owner

@thug21 commented on GitHub (Aug 26, 2025):

Now the download stops because it does not find a suitable type. I just added post_data_types so that such messages are skipped when downloading

<!-- gh-comment-id:3225239968 --> @thug21 commented on GitHub (Aug 26, 2025): Now the download stops because it does not find a suitable type. I just added post_data_types so that such messages are skipped when downloading
Author
Owner

@DZamataev commented on GitHub (Oct 30, 2025):

I just added post_data_types so that such messages are skipped when downloading

Hi! Did you specify it in settings or make changes in the script? I now face total inability to download content even pointing to a post url without audio when audio is present on the first page in the feed.

<!-- gh-comment-id:3467976173 --> @DZamataev commented on GitHub (Oct 30, 2025): > I just added post_data_types so that such messages are skipped when downloading Hi! Did you specify it in settings or make changes in the script? I now face total inability to download content even pointing to a post url without audio when audio is present on the first page in the feed.
Author
Owner

@Glitchy-Sheep commented on GitHub (Nov 2, 2025):

@DZamataev

Yeah, I'm so sorry about that. I didn't know that Boosty had some of those content types back then.

The post URL doesn't work because the script still needs to iterate over pages in order to find a specific post. (Maybe there's a solution for targeted search, but I haven't found one yet.)

The audio chunks problem is quite urgent now, but it's hard to fix quickly because it will change the database schema, which would invalidate other users' caches. I'd really like to avoid that and include some sort of automatic migration system instead.

There is a hotfix, but it won't download any audio chunks, you can add them to the schema, specifically in the file:
github.com/Glitchy-Sheep/boosty-downloader@329506929e/boosty_downloader/src/infrastructure/boosty_api/models/post/base_post_data.py (L24-L36)

So you can create such model in the boosty_downloader/src/infrastructure/boosty_api/models/post/post_data_types and include it, the downloader will just skip it during html generation.

I think I need to generally refactor some parts of code, because it's too coupled right now because of the HTML generation specifically...

<!-- gh-comment-id:3478287086 --> @Glitchy-Sheep commented on GitHub (Nov 2, 2025): @DZamataev **Yeah, I'm so sorry about that.** I didn't know that Boosty had some of those content types back then. The post URL doesn't work because the script still needs to iterate over pages in order to find a specific post. (Maybe there's a solution for targeted search, but I haven't found one yet.) The audio chunks problem is quite urgent now, but it's hard to fix quickly because it will change the database schema, which would invalidate other users' caches. I'd really like to avoid that and include some sort of automatic migration system instead. There is a hotfix, but it won't download any audio chunks, you can add them to the schema, specifically in the file: https://github.com/Glitchy-Sheep/boosty-downloader/blob/329506929e817da4be59a13a78ba02a57f7f43c9/boosty_downloader/src/infrastructure/boosty_api/models/post/base_post_data.py#L24-L36 So you can create such model in the [boosty_downloader/src/infrastructure/boosty_api/models/post/post_data_types](https://github.com/Glitchy-Sheep/boosty-downloader/tree/main/boosty_downloader/src/infrastructure/boosty_api/models/post/post_data_types) and include it, the downloader will just skip it during html generation. I think I need to generally refactor some parts of code, because it's too coupled right now because of the HTML generation specifically...
Author
Owner

@Rast1234 commented on GitHub (Dec 5, 2025):

Hi! Thanks for the tool and it's nice to have a workaround. If i may share another user perspective. Maybe it's worth fixing this issue without heavy refactoring? Just release as next major version with some note that old cache isn't compatible. IMO broken "download all" functionality for indefinite time out of the box, plus blocked implementation of audio downloads - is much worse user experience - than having to redownload cache...

Upgrading with cache reset is a thing user can do, and it's a choice. Broken "download all" and unsupported post types is not something a user can easily fix. And since it's already been like this for several months, keeping old caches becomes less and less important.

I know how demotivating it can be when you have to refactor a lot of code and keep backwards compatibility, been there with my pet project too. Not fun and takes a lot of effort. If it keeps you blocked from making a fix, maybe it's worth fixing without back compat and move on ;)

<!-- gh-comment-id:3615163553 --> @Rast1234 commented on GitHub (Dec 5, 2025): Hi! Thanks for the tool and it's nice to have a workaround. If i may share another user perspective. Maybe it's worth fixing this issue without heavy refactoring? Just release as next major version with some note that old cache isn't compatible. IMO broken "download all" functionality for indefinite time out of the box, plus blocked implementation of audio downloads - is much worse user experience - than having to redownload cache... Upgrading with cache reset is a thing user can do, and it's a choice. Broken "download all" and unsupported post types is not something a user can easily fix. And since it's already been like this for several months, keeping old caches becomes less and less important. I know how demotivating it can be when you have to refactor a lot of code and keep backwards compatibility, been there with my pet project too. Not fun and takes a lot of effort. If it keeps you blocked from making a fix, maybe it's worth fixing without back compat and move on ;)
Author
Owner

@Rast1234 commented on GitHub (Dec 5, 2025):

I got it to work, if anyone is interested you can update several files locally or clone a fork - see MR #77

<!-- gh-comment-id:3615278369 --> @Rast1234 commented on GitHub (Dec 5, 2025): I got it to work, if anyone is interested you can update several files locally or clone a fork - see MR #77
Author
Owner

@Glitchy-Sheep commented on GitHub (Dec 15, 2025):

Yeah, guys, I’m very sorry that I still haven’t fixed this.
The tool was probably really needed by some people during this time.

That’s definitely on me. I thought I could do the fix before December ><


I also really wanted to add audio support with caching (maybe with auto-migration), so users wouldn’t need to re-download many GiBs.

But judging by the stars, the project is clearly valuable to some people, and I really hope to release the fix soon.


@Rast1234 Thanks for your contribution, I'll see the changes soon ❤️

<!-- gh-comment-id:3656981009 --> @Glitchy-Sheep commented on GitHub (Dec 15, 2025): Yeah, guys, I’m very sorry that I still haven’t fixed this. The tool was probably really needed by some people during this time. That’s definitely on me. I thought I could do the fix before December >< --- I also really wanted to add audio support with caching (maybe with auto-migration), so users wouldn’t need to re-download many GiBs. But judging by the stars, the project is clearly valuable to some people, and I really hope to release the fix soon. --- @Rast1234 Thanks for your contribution, I'll see the changes soon ❤️
Author
Owner

@Rast1234 commented on GitHub (Dec 17, 2025):

If you want, i can share my session with access to a page with a lot of heavy posts, it could help with testing. I discovered a lot of issues addressed in my MR trying to scrape it.

<!-- gh-comment-id:3665602078 --> @Rast1234 commented on GitHub (Dec 17, 2025): If you want, i can share my session with access to a page with a lot of heavy posts, it could help with testing. I discovered a lot of issues addressed in my MR trying to scrape it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Glitchy-Sheep/boosty-downloader#8
No description provided.