Open tijmenb opened 10 months ago
If nothing else, we could show the artwork for the currently selected station at least.
It's true that no API provides that information at the moment. I can provide you what I did in JavaScript to extract the last playing song from the website itself, in case can be useful.
const NOW_PLAYING_PICTURE_DEFAULT = 'https://www.intergalactic.fm/sites/default/files/covers/blanco.png';
const NOW_PLAYING_PICTURE_REQUEST_PREFIX = 'https://www.intergalactic.fm/channel-content/';
var selectedChannel;// 1, 2 or 3
async function extractCoverFromChannelContent() {
var extractedCoverUrl = NOW_PLAYING_PICTURE_DEFAULT;
var response = await fetch(NOW_PLAYING_PICTURE_REQUEST_PREFIX + selectedChannel);
var body = await response.text();
var startOfCoverImgIndex = body.indexOf('<img');
var endOfCoverImgIndex = body.indexOf('alt=""/>') + 10;
var extractedCoverHTML = body.substring(startOfCoverImgIndex, endOfCoverImgIndex);
feedHTML(NOW_PLAYING_COVER_DIV_ID, extractedCoverHTML);
}
Thanks! This could probably be ported over to the app.
here is the IFM-minimal player I developed where you can see this code in action https://intergalactic.fm/sd/
It would be nice if we could show the original artwork for the track in the Now playing thing. It's visible on the site, but not the tracks API. Would there be a way to get it?