Re: Accessing data in songStreamController
expectingtofly <expectingtofly.akkl2o-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]> Tue, 17 May 2022 12:56:39 +0000
| Newsgroups | gmane.music.equipment.slimdevices.devel |
|---|---|
| Organization | Logitech Squeezebox Forums |
| Message-ID | <[email protected]> |
Paul Webster wrote:
> I am trying to resolve an issue that I have had for ages ... where a
> stream URL changes because of a redirect and then the new stream URL no
> longer matches a regex that I have in place.
> I have been getting around this by working out a set of regex matches
> that work for the original and for the one redirected to but have now
> hit one that this is not feasible to do.
>
> So - time has come to do it properly and use the original URL.
>
> I do this because I have to set up a timer to call me back to go out and
> find metadata for the currently playing song (since it is not in the
> stream metadata).
>
> My recollection of the history of this is that if my timer expires but
> the listener has changed to play something else then I must not
> overwrite the now playing information with the track info from what is
> now the previous station being listened to ... so I get the current
> stream via
>
> >
Code:
--------------------
> >
> my $song = $client->playingSong();
> if ( $song && $song->streamUrl ) { $playingURL = $song->streamUrl}
--------------------
> >
>
> However, I dumped out a bunch of stuff and saw ... (edited) ...
>
> >
Code:
--------------------
> >
> 'songStreamController' => bless( [
> bless( [
> 'Slim::Player::Protocols::HTTPS',
> 0,
> bless( [
> -157146472,
> 1,
> undef,
> undef,
> 'h t t p s ://currentlyplaying.stream/mp3',
> 'h t t p://originally.launched.stream/mp3',
> 'mp3',
> 192000,
> 0,
> undef,
> undef,
> undef,
> undef,
> undef,
> 'station name',
>
--------------------
> >
>
> So my question ... what is the correct way to get those 2 URLs from
> songStreamController ?
> Is the first one the same as
> $song->streamUrl
>
> I tried to find where the blessed object is defined but without luck
> so far.
This might be correct, it certainly is with protocol handlers when I
handle the redirect myself :
original URL is : $song->streamUrl
actual URL is : $song->track()->url
Stuart McLean
expectingtofly plugins :
'bbc sounds' (https://github.com/expectingtofly/lms_bbc_sounds_plugin),'
global player (uk)'
(https://github.com/expectingtofly/lms_globalplayer_plugin), 'times
radio' (https://github.com/expectingtofly/lms_times_radio_plugin), 'uk
radio player'
(https://github.com/expectingtofly/lms_ukradioplayer_plugin), 'virgin
radio (uk)' (https://github.com/expectingtofly/lms_virgin_radio_plugin)
and the 'radio favourites plugin'
(https://github.com/expectingtofly/lms_radio_favourites_plugin)
for bbc sounds help see the 'bbc sounds wiki'
(https://github.com/expectingtofly/lms_bbc_sounds_plugin/wiki).
------------------------------------------------------------------------
expectingtofly's Profile: http://forums.slimdevices.com/member.php?userid=63263
View this thread: http://forums.slimdevices.com/showthread.php?t=116388