From abef050357d406e44acd8b4233b4a6996a0eaba7 Mon Sep 17 00:00:00 2001 From: Mitch Downey Date: Fri, 19 Apr 2024 01:29:15 -0500 Subject: [PATCH] Add support for downloading episodes with many redirects (pdst.fm) #2161 --- src/services/tools.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/services/tools.ts b/src/services/tools.ts index edca81b83..96fe53b6b 100644 --- a/src/services/tools.ts +++ b/src/services/tools.ts @@ -3,7 +3,9 @@ import { errorLogger } from '../lib/logger' import { request } from './request' const forceSecureRedirectDomains = { - 'feeds.gty.org': true + 'feeds.gty.org': true, + // we've found pdst.fm mp3s to use up to 6 redirects, which causes errors with Android downloads + 'pdst.fm': true } export const getSecureUrl = async (mediaUrl: string) => { @@ -21,7 +23,7 @@ export const getSecureUrl = async (mediaUrl: string) => { const secureUrlInfo = response?.data || {} const { secureUrl } = secureUrlInfo - if (secureUrl) { + if (secureUrl?.startsWith('https://')) { finalUrl = secureUrl } } else if (mediaUrl.indexOf('http://') >= 0) {