SkyRanger Posted October 19, 2020 Share Posted October 19, 2020 Working on a media player for my website that users can download and listen to without needing to install 3rd party media player. I am having a problem pulling and showing the information from the array. Dim tags As String() = Bass.BASS_ChannelGetTagsMETA(stream) If tags Is Nothing Then ' try http... tags = Bass.BASS_ChannelGetTagsHTTP(stream) End If If Not (tags Is Nothing) Then Dim tag As String For Each tag In tags Console.WriteLine(tag) Next tag End If This is an example of what is being pulled and shown in console: Quote StreamTitle='Judy Garland - Have Yourself A Merry Little Christmas';StreamUrl='&artist=Judy%20Garland&title=Have%20Yourself%20A%20Merry%20Little%20Christmas& album=100%20Classic%20Christmas%20Songs&duration=164754&songtype=S&overlay=NO&buycd=&website=&pictur e=az_99_100%20Classic%20Christmas%20Songs_Judy%20Garland.jpg'; Information I am trying to pull is StreamTitle, Artist and Title. Quote Link to comment Share on other sites More sharing options...
requinix Posted October 19, 2020 Share Posted October 19, 2020 I'm thinking a regular expression that matches letters + '=' + single quote + stuff up until the next single quote + single quote. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted October 20, 2020 Author Share Posted October 20, 2020 Thanks requinix. Looking in to how to do that, should not be too difficult. Quote Link to comment Share on other sites More sharing options...
requinix Posted October 20, 2020 Share Posted October 20, 2020 By the way, you should probably find yourself a stream that has an apostrophe in the title and see what the corresponding StreamTitle looks like. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted October 20, 2020 Author Share Posted October 20, 2020 Something like this: StreamTitle='Franke Carle - Little Jack Frost Get Lost';StreamUrl='&artist=Franke%20Carle&title=Little%20Jack%20Frost%20Get%20Lost&album=100%20Classic%20Christmas%20Songs&duration=164937&songtype=S&overlay=NO&buycd=&website=&picture=az_80_100%20Classic%20Christmas%20Songs_Franke%20Carle.jpg'; Quote Link to comment Share on other sites More sharing options...
requinix Posted October 20, 2020 Share Posted October 20, 2020 What about that? If you're responding to my thing about apostrophes, I don't see any in there. Besides the ones used around the StreamTitle and StreamUrl values. I meant a title with an apostrophe in the value, like... maybe "Frankie Carle - Ridin' High, Vocalion". On that note, the guy's name is apparently Frankie Carle. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted October 20, 2020 Author Share Posted October 20, 2020 Sorry wrong one...lol. Been playing with a few. StreamTitle='Nat 'King' Cole - The Christmas Song';StreamUrl='&artist=Nat%20'King'%20Cole&title=The%20Christmas%20Song&album=100%20Classic%20Christmas%20Songs&duration=192601&songtype=S&overlay=NO&buycd=&website=&picture=az_2_100%20Classic%20Christmas%20Songs_Nat%20'King'%20Cole.jpg'; Quote Link to comment Share on other sites More sharing options...
requinix Posted October 20, 2020 Share Posted October 20, 2020 Ugh. That's really not that great. So the "stuff up until the next single quote" I said won't work because it'll stop just before "King". Only other option is to match anything, but be "ungreedy" about it: meaning to match as little as possible so that the regular expression can keep going. Immediately after that comes the closing apostrophe, then letters and an equals sign. That last part won't match when it hits "King", so the engine will go back and match Nat + King. Then it won't match again with Cole, so it'll finally go all the way through "Song" at which point everything will work. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted October 21, 2020 Author Share Posted October 21, 2020 Thanks requinix got it working. Went a different way about it but did the trick. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.