Zomboided / service.vpn.manager

VPN plugin for Kodi
GNU General Public License v2.0
310 stars 80 forks source link

Addon filter not triggering from shortcuts (strm files) #326

Closed oliviercommelarbre closed 3 years ago

oliviercommelarbre commented 3 years ago

I've tested another very interesting add-on called "Library Integration Tool" (see https://forum.kodi.tv/showthread.php?tid=327514) that works on the basis of shortcuts (.strm files) towards Video content (Movie or TV Show) provided through Video addons (essentially working with any Video add-on). however i've noted that while i could have configured a specific add-on to automatically trigger a specific VPN config in the settings, playing stream content via an .strm file pointing to an element published though that addon does not in my case trigger the addon filter. The filter triggers nominally when activating the addon interface itself (including when triggering the addon interface at any level from the favorites), however it does not seem to work when directly triggering playing the leaf content provided through that addon. PS: if Is there anything i could have missed in the config that could solve the problem? Or could there be alternative means to support this use case in concert with Library Integration Tool, e.g. a mean to trigger a VPN filter on the basis of e.g. a specific TV show being activated from the TV show library window of kodi? thanks for any help or for considering for possible correction or as future improvement.

Zomboided commented 3 years ago

You can trigger on an add-on or on a window ID. Filtering on a stream is not gonna happen because the add-on doesn’t get told until a stream starts at which point it’s too late to chop and restart the connection.

On 26 Feb 2021, at 22:29, oliviercommelarbre notifications@github.com wrote:

 I've tested another very interesting add-on called "Library Integration Tool" (see https://forum.kodi.tv/showthread.php?tid=327514) that works on the basis of shortcuts (.strm files) towards Video content (Movie or TV Show) provided through Video addons (essentially working with any Video add-on). however i've noted that while i could have configured a specific add-on to automatically trigger a specific VPN config in the settings, playing stream content via an .strm file pointing to an element published though that addon does not in my case trigger the addon filter. The filter triggers nominally when activating the addon interface itself (including when triggering the addon interface at any level from the favorites), however it does not seem to work when directly triggering playing the leaf content provided through that addon. PS: if Is there anything i could have missed in the config that could solve the problem? Or could there be alternative means to support this use case in concert with Library Integration Tool, e.g. a mean to trigger a VPN filter on the basis of e.g. a specific TV show being activated from the TV show library window of kodi? thanks for any help or for considering for possible correction or as future improvement.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

oliviercommelarbre commented 3 years ago

thanks for your (very!) quick feedback. I see your point, indeed it is why i was thinking of that approach with additional filtering capabilities based on e.g. library TV shows being activated. That would give the necessary intermediate step for opening the VPN, before the user then asks to play an episode from it (these TV shows would be the ones served 'virtually' via the strm files, all episodes sharing the same addon behind serving all episodes of that show). I suppose the window filtering capabilities cannot help here, the window identifiers being (most probably) generic to the type of window being activated rather than specific to a specific activation.

Alternatively, and going back to your clarification, i was wondering whether another way could be possible, e.g. by having the VPN manager take the lead in that case. i.e. it would grab the stream url being triggered and associated to the addon being filtered, force the playing of the stream to abort in some way, then trigger the configured VPN, then take the lead in (re-)triggering the player to play the content as soon as the VPN would result effective. Could that be a possible solution at least conceptually? thanks again

Zomboided commented 3 years ago

You're asking for me to change connection based on what's displayed on the current screen. I don't see anything in the API that lets me do that and even if there were, you'd need to consider that different skins could display that TV season screen in different ways. I could conceive that you could write something in a skin to do this but I'm absolutely not going to start writing skins.

I've already addressed your alternative...I could restart a stream no problems, but if it doesn't start playing then the add-on doesn't get told the stream is starting - this is effectively a geo-locking use case. If your goal is to hide yourself when playing a stream, then starting a stream to then stop it and change connection is not a good idea either.

The way to solve this problem is to have whatever add-on is doing the browsing have some VPN connection/TV stream awareness and switch before starting the stream. I put this functionality into a PVR ages ago using the VPN Mgr API and conceptual it works just fine. I'm not going to start writing add-ons to browse libraries though, that just doesn't interest me at all.

On Sat, Feb 27, 2021 at 12:54 AM oliviercommelarbre < notifications@github.com> wrote:

thanks for your (very!) quick feedback. I see your point, indeed it is why i was thinking of that approach with additional filtering capabilities based on e.g. library TV shows being activated. That would give the necessary intermediate step for opening the VPN, before the user then asks to play an episode from it (these TV shows would be the ones served 'virtually' via the strm files, all episodes sharing the same addon behind serving all episodes of that show). I suppose the window filtering capabilities cannot help here, the window identifiers being (most probably) generic to the type of window being activated rather than specific to a specific activation.

Alternatively, and going back to your clarification, i was wondering whether another way could be possible, e.g. by having the VPN manager take the lead in that case. i.e. it would grab the stream url being triggered and associated to the addon being filtered, force the playing of the stream to abort in some way, then trigger the configured VPN, then take the lead in (re-)triggering the player to play the content as soon as the VPN would result effective. Could that be a possible solution at least conceptually? thanks again

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Zomboided/service.vpn.manager/issues/326#issuecomment-786970309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECJZZOB7PAQDNANYOOWFEDTBA7DVANCNFSM4YJGVJQA .

oliviercommelarbre commented 3 years ago

All clear thank you. indeed you must be right, there is no easy path to resolving this, except through an ad-hoc addon or by having the core provide a hook on streams opening just before they are opened. thanks again for having looked into it and helped clarify. btw, i use the manager on a mac, i managed to get it to work without too much hassle, and it has worked now since about two years. i'll post as soon i get a bit of time.