mirror of
https://github.com/nkanaev/yarr.git
synced 2025-09-15 10:50:15 +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:
@@ -136,6 +136,26 @@ func TestRSSPodcast(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRSSOpusPodcast(t *testing.T) {
|
||||
feed, _ := Parse(strings.NewReader(`
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<item>
|
||||
<enclosure length="100500" type="audio/opus" url="http://example.com/audio.ext"/>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
`))
|
||||
have := feed.Items[0].AudioURL
|
||||
want := "http://example.com/audio.ext"
|
||||
if want != have {
|
||||
t.Logf("want: %#v", want)
|
||||
t.Logf("have: %#v", have)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
// found in: https://podcast.cscript.site/podcast.xml
|
||||
func TestRSSPodcastDuplicated(t *testing.T) {
|
||||
feed, _ := Parse(strings.NewReader(`
|
||||
|
Reference in New Issue
Block a user