Skip to content

Commit

Permalink
Add support for downloading episodes with many redirects (pdst.fm)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdowney committed Apr 19, 2024
1 parent a58bae5 commit abef050
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/services/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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) {
Expand Down

0 comments on commit abef050

Please sign in to comment.