Skip to content

Commit

Permalink
Merge pull request #3771 from sbyrx/master
Browse files Browse the repository at this point in the history
Adds a configuration for podcast feed and episode download timeout
  • Loading branch information
advplyr authored Jan 8, 2025
2 parents 1649fb4 + e64302f commit 05ff5f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions server/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ class Server {
}
}

if (process.env.PODCAST_DOWNLOAD_TIMEOUT) {
global.PodcastDownloadTimeout = process.env.PODCAST_DOWNLOAD_TIMEOUT
} else {
global.PodcastDownloadTimeout = 30000
}

if (!fs.pathExistsSync(global.ConfigPath)) {
fs.mkdirSync(global.ConfigPath)
}
Expand Down
2 changes: 1 addition & 1 deletion server/utils/ffmpegHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ module.exports.downloadPodcastEpisode = (podcastEpisodeDownload) => {
headers: {
'User-Agent': 'audiobookshelf (+https://audiobookshelf.org)'
},
timeout: 30000
timeout: global.PodcastDownloadTimeout
}).catch((error) => {
Logger.error(`[ffmpegHelpers] Failed to download podcast episode with url "${podcastEpisodeDownload.url}"`, error)
return null
Expand Down
2 changes: 1 addition & 1 deletion server/utils/podcastUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ module.exports.getPodcastFeed = (feedUrl, excludeEpisodeMetadata = false) => {
return axios({
url: feedUrl,
method: 'GET',
timeout: 12000,
timeout: global.PodcastDownloadTimeout,
responseType: 'arraybuffer',
headers: {
Accept: 'application/rss+xml, application/xhtml+xml, application/xml, */*;q=0.8',
Expand Down

0 comments on commit 05ff5f1

Please sign in to comment.