mirror of
https://github.com/nkanaev/yarr.git
synced 2025-09-17 20:00:14 +00:00
ParseRSS: accept any file with audio/ media type as podcast
There are some podcasts that use audio/opus files (mostly as an alternative, but still), which makes the audio attachment not being displayed. Instead of increasing the list of allowed formats (because audio/mp3 would be quite useful on the list too), I guess it'd be better to give any audio/ media type to the user-agent and let him worry about it. :^)
This commit is contained in:
@@ -71,7 +71,7 @@ func ParseRSS(r io.Reader) (*Feed, error) {
|
||||
for _, srcitem := range srcfeed.Items {
|
||||
podcastURL := ""
|
||||
for _, e := range srcitem.Enclosures {
|
||||
if e.Type == "audio/mpeg" || e.Type == "audio/x-m4a" {
|
||||
if strings.HasPrefix(e.Type, "audio/") {
|
||||
podcastURL = e.URL
|
||||
|
||||
if srcitem.OrigEnclosureLink != "" && strings.Contains(podcastURL, path.Base(srcitem.OrigEnclosureLink)) {
|
||||
|
Reference in New Issue
Block a user