1
0
Fork 0
mirror of https://github.com/Findus23/RadioStats.git synced 2024-09-19 16:03:48 +02:00
RadioStats/parser/ara.py

18 lines
666 B
Python
Raw Normal View History

from parser import BaseFetcher
from utils import *
URL = "http://www.arabella.at/live-feed/ajax.php?station=zenon-rp-wien"
class ArabellaFetcher(BaseFetcher):
def get(self, channel):
response = fetch(URL, True)
if response:
for track in response["songs"]:
artist = track["artist"]
title = track["title"]
dt = track["start_date_time"]
time = datetime(year=int(dt["year"]), month=int(dt["month"]), day=int(dt["day"]),
hour=int(dt["hours"]), minute=int(dt["minutes"]), second=int(dt["seconds"]))
yield time, artist, title