2020-09-28 18:31:57 +02:00
|
|
|
from parser import BaseFetcher
|
2018-02-13 22:31:30 +01:00
|
|
|
from utils import *
|
|
|
|
|
|
|
|
URL = "http://www.arabella.at/live-feed/ajax.php?station=zenon-rp-wien"
|
|
|
|
|
|
|
|
|
2020-09-28 18:31:57 +02:00
|
|
|
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
|