mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Fix:CBC Radio podcast RSS feeds not accepting our user-agent string #3322
This commit is contained in:
		
							parent
							
								
									2a62992c75
								
							
						
					
					
						commit
						45f8b06d56
					
				| @ -228,6 +228,13 @@ module.exports.parsePodcastRssFeedXml = async (xml, excludeEpisodeMetadata = fal | |||||||
| module.exports.getPodcastFeed = (feedUrl, excludeEpisodeMetadata = false) => { | module.exports.getPodcastFeed = (feedUrl, excludeEpisodeMetadata = false) => { | ||||||
|   Logger.debug(`[podcastUtils] getPodcastFeed for "${feedUrl}"`) |   Logger.debug(`[podcastUtils] getPodcastFeed for "${feedUrl}"`) | ||||||
| 
 | 
 | ||||||
|  |   let userAgent = 'audiobookshelf (+https://audiobookshelf.org; like iTMS)' | ||||||
|  |   // Workaround for CBC RSS feeds rejecting our user agent string
 | ||||||
|  |   // See: https://github.com/advplyr/audiobookshelf/issues/3322
 | ||||||
|  |   if (feedUrl.startsWith('https://www.cbc.ca')) { | ||||||
|  |     userAgent = 'audiobookshelf (+https://audiobookshelf.org; like iTMS) - CBC' | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   return axios({ |   return axios({ | ||||||
|     url: feedUrl, |     url: feedUrl, | ||||||
|     method: 'GET', |     method: 'GET', | ||||||
| @ -235,7 +242,7 @@ module.exports.getPodcastFeed = (feedUrl, excludeEpisodeMetadata = false) => { | |||||||
|     responseType: 'arraybuffer', |     responseType: 'arraybuffer', | ||||||
|     headers: { |     headers: { | ||||||
|       Accept: 'application/rss+xml, application/xhtml+xml, application/xml, */*;q=0.8', |       Accept: 'application/rss+xml, application/xhtml+xml, application/xml, */*;q=0.8', | ||||||
|       'User-Agent': 'audiobookshelf (+https://audiobookshelf.org; like iTMS)' |       'User-Agent': userAgent | ||||||
|     }, |     }, | ||||||
|     httpAgent: global.DisableSsrfRequestFilter ? null : ssrfFilter(feedUrl), |     httpAgent: global.DisableSsrfRequestFilter ? null : ssrfFilter(feedUrl), | ||||||
|     httpsAgent: global.DisableSsrfRequestFilter ? null : ssrfFilter(feedUrl) |     httpsAgent: global.DisableSsrfRequestFilter ? null : ssrfFilter(feedUrl) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user