Home of the Squeezebox™ & Transporter® network music players.
Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 59
  1. #21
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    4,517
    Imagine that the real underlying URL is somewhat secret (not 100% secret but should not be readily disclosed) or one that can change each time it is invoked so would not work well if it was saved as a favourite or put in a playlist.

    So myplugin://name results in the generation of the correct underlying URL (e.g. h t t p : //service/stream?key=abc) for LMS to use each time it is invoked - and the various regular UIs only ever show myplugin://name

    We have examples here where people are posting stream URLs that contain personal details. That can help in diagnosing things but should not really be done.
    Some that notice it go back and edit the URL to xxxx out the private parts.
    My reason to want to be able to do this (and it is now working in my test code) is not quite the same but I could see it being useful.
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  2. #22
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    7,481
    Quote Originally Posted by Paul Webster View Post
    Imagine that the real underlying URL is somewhat secret (not 100% secret but should not be readily disclosed) or one that can change each time it is invoked so would not work well if it was saved as a favourite or put in a playlist.

    So myplugin://name results in the generation of the correct underlying URL (e.g. h t t p : //service/stream?key=abc) for LMS to use each time it is invoked - and the various regular UIs only ever show myplugin://name

    We have examples here where people are posting stream URLs that contain personal details. That can help in diagnosing things but should not really be done.
    Some that notice it go back and edit the URL to xxxx out the private parts.
    My reason to want to be able to do this (and it is now working in my test code) is not quite the same but I could see it being useful.
    If I understood well what you want, I think this is the smallest example that does it - it's really simple. You can try to play in Tune In a "myph://whatever" and you'll hear RadioParadise aac stream (hardcoded) but normally you should not see the link. When you look, at the "info" it is still the "myph://" URL.
    Attached Files Attached Files
    Last edited by philippe_44; 2021-05-19 at 18:18.
    LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

  3. #23
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    4,517
    Thanks for this.
    Am about to try it out.
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  4. #24
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    4,517
    Tried it out and it does work.
    So thanks - it makes the code a bit smaller and helped me understand a bit more.

    An issue that remains is that the bitrate is not shown.
    I think it needs to call Scanner::Remote::readRemoteHeaders to get it.

    So I will see if I can call that and preserve the discovered info.
    An added bonus would be if the discovered format (aac v mp3 v ...) could also be preserved so that there is not need to hard-code it in getFormatForURL and getNextTrack ... especially as it is readRemoteHeaders that calls parseAACHeader/parseFlacHeader etc.
    Last edited by Paul Webster; 2021-05-20 at 03:02.
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  5. #25
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    7,481

    scanUrl not being called

    Quote Originally Posted by Paul Webster View Post
    Tried it out and it does work.
    So thanks - it makes the code a bit smaller and helped me understand a bit more.

    An issue that remains is that the bitrate is not shown.
    I think it needs to call Scanner::Remote::readRemoteHeaders to get it.

    So I will see if I can call that and preserve the discovered info.
    An added bonus would be if the discovered format (aac v mp3 v ...) could also be preserved so that there is not need to hard-code it in getFormatForURL and getNextTrack ... especially as it is readRemoteHeaders that calls parseAACHeader/parseFlacHeader etc.
    You can do, like in Wimp (Tidal), an update of metadata in the call back once parseAacHeader call has been done.

    I donĺt recall on top of my head the methods name but there is one, I think for setting bitrate in the $song context and a metadata update command that is used everywhere in LMS/plugins
    Last edited by philippe_44; 2021-05-20 at 09:36.
    LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

  6. #26
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    4,517
    Next problem ...

    I have myplugin://something playing OK when I use the Radio/Tune in URL function.

    However, if I put the item into OPML menu then it fails

    Code:
    [21-05-23 16:34:18.6325] Plugins::MyPlugin::ProtocolHandler::new (76) Remote streaming MyPlugin track: https://example.com/something.aac/playlist.m3u8
    [21-05-23 16:34:18.7997] Slim::Formats::Playlists::parseList (54) Type: aac for: myplugin://something
    [21-05-23 16:34:18.8007] Slim::Formats::Playlists::parseList (84) Error: While running $playlistClass->read(): [Can't locate object method "read" via package "Slim::Formats::Movie" at /usr/local/slimserver/Slim/Formats/Playlists.pm line 82.
    ]
    [21-05-23 16:34:18.8032] Slim::Networking::IO::Select::__ANON__ (130) Error: Select task failed calling Slim::Networking::Async::HTTP::_http_read_body: Can't use an undefined value as a HASH reference at /usr/local/slimserver/Slim/Player/Song.pm line 530.
    ; fh=Slim::Networking::Async::Socket::HTTPS=GLOB(0x84ff1f0)
    I am working through it trying to understand if this is a fundamental problem or I have not set something correctly.
    This line might indicate an issue
    Code:
    Slim::Formats::Playlists::parseList (54) Type: aac for: myplugin://something
    because it is showing my PH url not the one that my ProtocolHandler module had already calculated and passed in.
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  7. #27
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    7,481
    Quote Originally Posted by Paul Webster View Post
    Next problem ...

    I have myplugin://something playing OK when I use the Radio/Tune in URL function.

    However, if I put the item into OPML menu then it fails

    Code:
    [21-05-23 16:34:18.6325] Plugins::MyPlugin::ProtocolHandler::new (76) Remote streaming MyPlugin track: https://example.com/something.aac/playlist.m3u8
    [21-05-23 16:34:18.7997] Slim::Formats::Playlists::parseList (54) Type: aac for: myplugin://something
    [21-05-23 16:34:18.8007] Slim::Formats::Playlists::parseList (84) Error: While running $playlistClass->read(): [Can't locate object method "read" via package "Slim::Formats::Movie" at /usr/local/slimserver/Slim/Formats/Playlists.pm line 82.
    ]
    [21-05-23 16:34:18.8032] Slim::Networking::IO::Select::__ANON__ (130) Error: Select task failed calling Slim::Networking::Async::HTTP::_http_read_body: Can't use an undefined value as a HASH reference at /usr/local/slimserver/Slim/Player/Song.pm line 530.
    ; fh=Slim::Networking::Async::Socket::HTTPS=GLOB(0x84ff1f0)
    I am working through it trying to understand if this is a fundamental problem or I have not set something correctly.
    This line might indicate an issue
    Code:
    Slim::Formats::Playlists::parseList (54) Type: aac for: myplugin://something
    because it is showing my PH url not the one that my ProtocolHandler module had already calculated and passed in.
    Don't you need to explode the playlist in your handler?

    [edit]: no, in fact you can, in the new() set the ${*$self}{contentType} to the real content-type and then the Song.pm:pen will do the job, I think
    [edit2]: or, better than hacking the ${*$self}{contentType} (which some still do), you can define a sub contentType(). It think this will still work b/c the handler is still your PH
    Last edited by philippe_44; 2021-05-23 at 10:54.
    LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

  8. #28
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    4,517
    After your first message (before the edits) I put the sub explodeplaylist back into the code (I had taken it out in one of the earlier iterations).

    This does allow the item to be played ... but it then takes me back to the original issue and the base stream URL appears in More ... which is what I was trying to avoid.

    Thanks for the extra ideas around sub new
    I'll try again tomorrow.
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  9. #29
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    20,749
    Triode used the following to hide iplayer:// URls in More info display - basically it intercepts any request for the "url" item and if it was an "iplayer://" - return "undef" to hide it. I suppose you could change then text being returned - not sure if there would be side effects..

    It was inserted in InitPlugin

    Code:
    	# hide iplayer:// from track info displays...
    	my $trackInfoUrl = Slim::Menu::TrackInfo->getInfoProvider->{'url'};
    	my $old = $trackInfoUrl->{'func'};
    
    	$trackInfoUrl->{'func'} = sub {
    		my $info = &$old(@_);
    		
    		return undef if $info->{'label'} eq 'URL' && $info->{'name'} =~ /^iplayer:\/\//;
    		return $info;
    	};

  10. #30
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    4,517
    ... I have a new theory on why things are not working for me ...

    The URLs that are now failing are for HLS streams.

    I /think/ when it goes via the sub "new" in my ProtocolHandler.pm it does not subsequently make its way to PlayHLS plugin.

    Having enabled debug logging for various things I can see that if I invoke the stream directly via Tune In URL - of form
    h t t p s : / / somewhere.com/stream.m3u8?somestuff
    then it plays and PlayHLS is invoked
    but if I invoke via
    myplugin://stream - which returns the same URL as above as a streamURL then it does not get to PlayHLS in the same way

    I am sure that this is not enough info to go on ... but ... bpa ... if I bundle up a build of this unreleased plugin for you (along with some instructions for how to repeat the issue) do you think you could take a look?
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •