-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add news feeds for more countries #48
Comments
NOTE these feeds can't be used directly
import requests
def get_tsf():
feed = "https://www.tsf.pt/stream/audio/{year}/{month:02d}/noticias/{day:02d}/not{hour:02d}.mp3"
uri = None
i = 0
status = 404
while status != 200 and i < 5:
uri = feed.format(hour=date.hour, year=date.year, month=date.month, day=date.day)
status = requests.get(uri).status_code
i += 1
return uri
def get_gbp():
feed = "http://feeds.feedburner.com/gpbnews/GeorgiaRSS?format=xml"
data = feedparser.parse(feed)
next_link = data["entries"][0]["links"][0]["href"]
html = requests.get(next_link)
# Find the first mp3 link
# Note that the latest mp3 may not be news,
# but could be an interview, etc.
mp3_find = re.search(b'href="(?P<mp3>.+\.mp3)"', html.content)
if mp3_find is None:
return None
url = mp3_find.group("mp3").decode("utf-8")
return url |
Thanks Jarbas - PR #50 is in motion! |
Title - "Ö3 Nachrichten" |
Title - "Financial Times News Briefing"
This is a channel that I use daily. Thought of contributing it so that others can use it as well. Unfortunately had to use bs4 because the mp3 links are hidden behind a second page! |
Thanks @dcstang this looks great! Given that it all looks good to go, feel free to create a PR directly. We love to keep a record of community contributions. But if you don't have time I can get this integrated for you. |
Contributing to open source is awesome! Have put it in as #73. |
Hello guys! while I was trying to add RAI Radio 1 to your great skill, I came with an idea: why don't do a plugin mechanism with a file per feed and the file can return or a feed RSS type or an audio file to play directly? |
Hey Denics, very open if you have suggestions on better ways to organize the feeds. A full-blown plugin system might be overkill, but may depend on whether the plugins must be installed by the user or just in the skill? |
Hi @krisgesling I was thinking more about a "drop in" plugins folder, with one file per radio. As I said, I am for example adding Radio Rai 1. Instead of putting my hands in your code with the risk to break everything or doing a pull request that can potentially compromise something, it could be more useful for advanced users, to drop in that folder a file radiorai1.py (or whatever naming convention defined by you) that can return OR an RSS feed OR an MP3/ASF/nameit stream. |
Hi @krisgesling . |
Hi @krisgesling shall we close this issue? |
Yeah it's definitely dated - I'll add a new version when we are ready to completely add new stations. |
A generic issue thread for the addition of new feeds or stations, particularly for countries that aren't yet represented. Contributions are warmly welcomed!
A list of the existing feeds can be found here:
skill-npr-news/__init__.py
Lines 29 to 44 in 47c658f
New feeds being proposed must include:
The feed URL may be an RSS feed or a direct audio feed.
The text was updated successfully, but these errors were encountered: