Is it possible to extract the song info from a live HLS M3U8 radio stream using for example python or any other program?
I can currently view the song info by opening the response in Google DevTools, but I'd like to automatically scrape/extract the song title and save it to a file each time the song changes.
You should try using the Python library (https://github.com/globocom/m3u8) to parse and manipulate m3u8 manifests instead of writing your own script. You have to check if it supports the tags you are trying to get metadata for. If not you should be able to easily extend the library to add the functionality you need.
import m3u8
def get_movie(line, data, lineno):
if line.startswith('#MOVIE-NAME:'):
custom_tag = line.split(':')
data['movie'] = custom_tag[1].strip()
m3u8_obj = m3u8.load('http://videoserver.com/playlist.m3u8',
custom_tags_parser=get_movie)
print(m3u8_obj.data['movie']) # million dollar baby