Assume no User-Agent is Kindle
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-01-26 22:52:07 +01:00
parent 6e9ebab87b
commit 8b7d8d0cc6

View File

@@ -233,7 +233,9 @@ func handleFeed(outputDir string, feeds []FeedConfig, s *securecookie.SecureCook
var converter convert.Converter var converter convert.Converter
if strings.Contains(r.UserAgent(), "Kobo") && kepubConverter.Available() { if strings.Contains(r.UserAgent(), "Kobo") && kepubConverter.Available() {
converter = kepubConverter converter = kepubConverter
} else if strings.Contains(r.UserAgent(), "Kindle") && mobiConverter.Available() { } else if (strings.Contains(r.UserAgent(), "Kindle") || (len(r.UserAgent()) == 0)) && mobiConverter.Available() {
// Note: Only Kindle browser is that stupid that it forgets to send its User-Agent
// header after user confirms the file is really to be downloaded.
converter = mobiConverter converter = mobiConverter
} }