MycroftAI / skill-npr-news

Mycroft AI official News Skill, providing the latest news report from your favorite broadcast.
https://mycroft.ai/skills
Apache License 2.0
9 stars 42 forks source link

Bugfix for NPR query strings #88

Closed krisgesling closed 4 years ago

krisgesling commented 4 years ago

Full details in issue #87

As outlined in linked issue, this adds a temporary workaround for the NPR News feed stripping the query strings off the media url. This should not be done to all urls as these may be used for routing.

Also added a check on the downloaded file to see if it's HTML rather than audio. The url provided by NPR here (including query strings) returns a header.content-type of audio but the curl download is clearly a HTML error page. The check is not robust for most uses, but should catch clear HTML vs audio/media files.

forslund commented 4 years ago

One thing to note is that until the next release of Mycroft core, it's not recommended to use multiple files due to reloading issues.

krisgesling commented 4 years ago

Damn, forgot about that... will revert the function extraction

forslund commented 4 years ago

Re-tested and working fine with the latest updates as well :+1: