diff --git a/server/Server.js b/server/Server.js index e9e77f00f0..c3e73aec82 100644 --- a/server/Server.js +++ b/server/Server.js @@ -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) } diff --git a/server/utils/ffmpegHelpers.js b/server/utils/ffmpegHelpers.js index f81f889c9a..a365ca9e24 100644 --- a/server/utils/ffmpegHelpers.js +++ b/server/utils/ffmpegHelpers.js @@ -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 diff --git a/server/utils/podcastUtils.js b/server/utils/podcastUtils.js index bc9892b2db..af5229230f 100644 --- a/server/utils/podcastUtils.js +++ b/server/utils/podcastUtils.js @@ -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',