A box With play button
You test it
Also does this Metadata/info or "now playing" on exo player url stream - Discuss - Kodular Community
Still work at all? If it does would the stream I use
Work with the purple block?
A box With play button
You test it
Also does this Metadata/info or "now playing" on exo player url stream - Discuss - Kodular Community
Still work at all? If it does would the stream I use
Work with the purple block?
you forgot to answer the questions
try it and let us know what you find out
Taifun
you just found out yourself, that the url does not return metadata, you get this instead
Taifun
yes live365 told me when they put that url in winamp or vlc
they get the metadata
the documentation we are looking for are not your blocks... it is a documentation which describes what exactly needs to be done to get the metadata of that stream
Taifun
ok where do i get that from?
did you read the document? obviously not
I now asked Gemini for you, below is the response
Taifun
Getting the current song metadata for a stream playing on Live365.com requires inspecting the web player's network activity, as the platform does not provide a single, public-facing, documented API for all streams.
The most reliable technical method for retrieving this information is by using your web browser's Developer Tools.
Here are the general steps to find the metadata endpoint:
F12 on Windows/Linux, or Cmd + Option + I on macOS).nowplaying, station, or the stream ID.https://api.live365.com/station/[station_id], which, when inspected, will contain the streaming URLs and sometimes the current track information.You can see a video about scraping websites by finding the API endpoint, which is the core technique needed to retrieve the Live365 metadata.
Scrape LIVE scores - No BeautifulSoup or Selenium NEEDED!
The task of programmatically getting Live365 stream metadata in an App Inventor app is essentially a three-step process: Connecting, Retrieving, and Parsing the data from the identified API endpoint.
This assumes you have successfully identified the specific API URL (the "metadata endpoint") that Live365 uses to send the current song information, as described in the previous response.
You'll need to use the following built-in components in the Designer:
Web component: To make the HTTP request to the Live365 API URL.Clock component: To periodically check the API for new metadata (e.g., every 5 to 10 seconds).Label components: To display the extracted Artist and Title on the screen.Use the Clock component to call the API on a regular interval.
Clock.TimerInterval property (e.g., to 5000 milliseconds for a 5-second refresh).Clock.Timer block, set the Web1.Url to the specific metadata endpoint URL you found (e.g., https://api.live365.com/station/[station_id]/nowplaying).Web1.Get block. This sends the request to the server.When the server responds, the Web1.GotText event is triggered. This block will contain the JSON data.
responseCode parameter to ensure the request was successful (it should be 200).Web.JsonTextDecodeWithDictionaries block on the responseContent parameter. This converts the raw JSON text into an App Inventor dictionary or list of dictionaries.Once the JSON is decoded into a dictionary, you can extract the Artist and Title.
lookup in dictionary or get value at key path block to navigate the dictionary structure.Label components with the extracted values.Example Blocks Logic (Conceptual):
WHEN
Clock1.TimerDO→ SET
Web1.UrlTO"YOUR_LIVE365_API_URL"→ CALL
Web1.GetWHEN
Web1.GotTextresponseCoderesponseContentDO→ IF
responseCode= 200 THEN→ SET
json_dataTO CALLWeb1.JsonTextDecodeWithDictionariesresponseContent→ SET
Label_Artist.TextTO CALLlookup in dictionarykey"artist"dictionaryjson_data→ SET
Label_Title.TextTO CALLlookup in dictionarykey"title"dictionaryjson_data
This approach leverages the Web component as the standard method in App Inventor for interacting with a web API that returns JSON data.
You can learn more about how to handle the received JSON data in App Inventor by watching this tutorial on using Web APIs with JSON.
http://googleusercontent.com/youtube_content/1
live365 don't have an api
read my previous answer again, I added some more information at the beginning to find out the metadata endpoint...
Taifun
I remove those two in DO
Then we're the arrows are I change them two to
Json_data if I'm understanding you correctly?
What about first finding out; what was returned in response content before blindly trying to extract some data?
Taifun
'Yeeess' it's working!
now, as this is a sharing community, what about sharing your working solution, so someone else with the same question in future can learn from your solution?
Taifun
In this topic I'm helping people get there now playing
Working as I did
So first on the designer
I made a text box for now playing
Then for the cover artist I placed a web viewer In that web viewers HomeUrl I placed the Live365 embedded URL made the height and width to fit
Underneath yet another lable box for Loading Current Track(NOTHING TO DO HERE) but you rename it now playing or whatever you wish to call your lable
If your adding a clock to your project in designer set that to 5000ms
In blocks you add
When clock or whatever you name it .timer DO
Set Web_Nowplaying.url to text box
Now do this whoever your streaming with
May it be radio.co, live365 ect you left click
Inspect element goto the network tab press xhr or media
You'll find the streaming players or now playing API URL there
You then copy that API URL put it in that text box after you set web_nowplaying.url block with a text box
Underneath that you call a purple block web_nowplaying.get
Then you add the blocks in order for this to work for example recently played so you grab the block when recently played.gotText DO add a if then block to that
You go into the math draw grab an equals block the equals that's in the middle
You then make a couple of orange bars rite up the top rename them as seen in the image
you then plug the blue empty
=
into the if section the first empty box you place ResponseCode after = you place 200
In the Then Section again orange
set global json_data to call the purple block web_nowplaying.jsonTextDecode
JsonText now on the end of that you add orange get response content
Underneath that you add set global artists to dark blue get value for key in dictionary or if not found block
You add in the key part text block and put artist
In dictionary you add set global json_data in the if not found you add another text block and add unknown
Underneath all that you a dark green block
Set Label_NowPlaying.text To
Again remember I meantioned about dictionary block yes you got your adding that again to this but this time
In key your adding a blank text box and typing title
In dictionary your adding the same orange block
Get global json_data
Or if not found = another text box again your typing unknown
Images to help as well