[PR #3099] [MERGED] Add user agent string to feed requests #3864

Closed
opened 2026-04-25 00:17:21 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3099
Author: @mattbasta
Created: 6/23/2024
Status: Merged
Merged: 6/25/2024
Merged by: @advplyr

Base: masterHead: patch-1


📝 Commits (2)

  • 2843a3b Add user agent string to feed requests
  • 2673742 Update User-Agent strings

📊 Changes

3 files changed (+29 additions, -24 deletions)

View changed files

📝 server/utils/ffmpegHelpers.js (+22 -23)
📝 server/utils/fileUtils.js (+3 -0)
📝 server/utils/podcastUtils.js (+4 -1)

📄 Description

Hey folks, I work on Pinecast (https://pinecast.com). We recently had a customer write in that their audiobookshelf server stopped updating feeds from us. It turns out that we'd seen a huge uptick in requests from the default Axios user agent string, which caused requests with that user agent to get served a captcha. My suspicion is that companies have started scraping more aggressively.

Podcast apps have (by and large) done a good job of providing descriptive User-Agent headers. Identifying your app allows podcasters to get informed analytics data and helps hosting companies like mine to identify and fix problems more easily.


In this PR, I'm adding the user-agent HTTP request header. I've chosen a value that is fairly straightforward: the name of the project, a link to the project, and like iTMS to indicate that the client should be treated similarly to Apple's podcast crawler. I do not have strong feelings about this UA string, but I'll suggest that if you decide to go with something else, you avoid adding a version number. There's a balance between user privacy (less information) and transparency (more descriptive information) and compatibility (more information that looks like another user agent).

This PR does not update the client calls to download media. I am not too familiar with the project and do not want to regress any features. However, I strongly suspect this function will need a similar update:

https://github.com/advplyr/audiobookshelf/blob/master/server/utils/fileUtils.js#L254

I'm glad to make that change as well, if you think it's appropriate.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3099 **Author:** [@mattbasta](https://github.com/mattbasta) **Created:** 6/23/2024 **Status:** ✅ Merged **Merged:** 6/25/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (2) - [`2843a3b`](https://github.com/advplyr/audiobookshelf/commit/2843a3b6d7cffeea7f1b20772fd28b8374f484d7) Add user agent string to feed requests - [`2673742`](https://github.com/advplyr/audiobookshelf/commit/2673742d8d17e3cce4202e1c5a3d9008593c8689) Update User-Agent strings ### 📊 Changes **3 files changed** (+29 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/ffmpegHelpers.js` (+22 -23) 📝 `server/utils/fileUtils.js` (+3 -0) 📝 `server/utils/podcastUtils.js` (+4 -1) </details> ### 📄 Description Hey folks, I work on Pinecast (https://pinecast.com). We recently had a customer write in that their audiobookshelf server stopped updating feeds from us. It turns out that we'd seen a huge uptick in requests from the default Axios user agent string, which caused requests with that user agent to get served a captcha. My suspicion is that companies have started scraping more aggressively. Podcast apps have (by and large) done a good job of providing descriptive `User-Agent` headers. Identifying your app allows podcasters to get informed analytics data and helps hosting companies like mine to identify and fix problems more easily. --- In this PR, I'm adding the `user-agent` HTTP request header. I've chosen a value that is fairly straightforward: the name of the project, a link to the project, and `like iTMS` to indicate that the client should be treated similarly to Apple's podcast crawler. I do not have strong feelings about this UA string, but I'll suggest that if you decide to go with something else, you avoid adding a version number. There's a balance between user privacy (less information) and transparency (more descriptive information) and compatibility (more information that looks like another user agent). This PR does not update the client calls to download media. I am not too familiar with the project and do not want to regress any features. However, I strongly suspect this function will need a similar update: https://github.com/advplyr/audiobookshelf/blob/master/server/utils/fileUtils.js#L254 I'm glad to make that change as well, if you think it's appropriate. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:17:21 +02:00
adam closed this issue 2026-04-25 00:17:21 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3864