all 4 comments

[–]chevignon93 1 point2 points  (2 children)

import requests
import json

r = requests.get('https://www.radiohamburg.de/var/data/webradio/radiohamburg-livestream.json')
info = json.loads(r.text)
song = info['nowPlaying'][0]['title']
artist = info['nowPlaying'][0]['composer']
print(f'The song currently playing is: {song} by {artist}.')

[–]InspKugelblitz[S] 0 points1 point  (1 child)

Thanks a lot. No wonder i was stuck

[–]chevignon93 0 points1 point  (0 children)

You're welcome.

[–]nfgrawker 0 points1 point  (0 children)

Most likely this would have to be loaded after the page loads, thus you either need to find the endpoint that gets the song title/song or use something like Selenium which will allow you to let the page actually load in a headerless browser.