primaeval / script.tvguide.fullscreen

tv guide fullscreen
GNU General Public License v2.0
25 stars 26 forks source link

Integration with VPN #92

Closed Zomboided closed 7 years ago

Zomboided commented 7 years ago

Hey man, I'm the author of the VPN Manager plugin https://github.com/Zomboided/service.vpn.manager, which 100s of people seem to be using (I've a thread on LibreELEC and a dead thread on OpenELEC) My add-on has the ability to switch the VPN profile/location (or disconnect) being used based on the add-on being used. I pick up the add-on in use by picking up the name of the window in use.

However, where the add-on is accessed via another add-on (like a TV), it struggles to notice that the add-on is being used and doesn't change the VPN connection. I've just added some direct APIs for third party add-ons (TV guides...) to switch VPNs on the fly based on the add-on in use. I've done some prototyping and have made your lovely TV guide flip the VPN based on the add-on that's been saved before starting the stream.

Would you want to add this function to your add-on properly? It can be added as a file that's included with your add-on with no external dependencies (best) or you can cite my add-on as a dependency in the XML (less good for people who don't use VPN or Android users, which I don't support). It's about 4 lines of code to set everything up, and 2 lines of code before kicking off the stream via a plugin. It'd be good to have it switchable in the settings.xml as well. Happy to send you my modifications to your gui.py code if you wanna have a look, or there's a third party API page on my GitHub wiki which has some more words.

Cheers.

primaeval commented 7 years ago

It should be ok as long as it doesn't break the Kodi Forum rules. Do you want to propose a Pull Request.

primaeval commented 7 years ago

The best way for me is to include links to generic scripts in the addon_data folder that can be modified by the user. If they exist they can be triggered on addon startup, shutdown and playing and stopping a channel. Have a look at how the AutoPlayWith code works. That is similar.

Zomboided commented 7 years ago

Thanks man, I'll take a look and come back to you here if I've any questions

On 18 Mar 2017, at 10:38, primaeval notifications@github.com wrote:

The best way for me is to include links to generic scripts in the addon_data folder that can modified by the user. If they exist they can be triggered on addon startup, shutdown and playing and stopping a channel. Have a look at how the AutoPlayWith code works. That is similar.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Zomboided commented 7 years ago

Hello, can you give me some indication of when playWithChannel (from gui.py) is used please? I'm switching the connection in playChannel, if I detect a plugin is being used (as opposed to a stream/substream/m3u), but I don't understand if playWithChannel is also able to directly drive streams from add-ons.

primaeval commented 7 years ago

The playWithChannel is if you want to run the AutoPlayWith on a channel immediately. The main use is to start recording now. I expect you just want to start your script in playChannel.

I'm not sure if this will work for you but something you might want to investigate is how to monitor the Kodi Player for events, maybe in your own addon. Have a look at how my Replay addon monitors the Player and makes a list of played streams. https://github.com/primaeval/plugin.video.replay/blob/master/service.py#L31

Zomboided commented 7 years ago

To filter (and change VPN connections) I need to pass in the string that represents the path(?) to the plugin (e.g. plugin://plugin.video.iplayerwww/?url=bbc_one_hd...etc). I've just done a pull request that works with the regular playChannel stuff and it would be good to get our collective users trying this out, but I'm not clear if I'd also want to look at the other PlayMedia calls in the code and filter those out there.

I'm hampered by not fully understanding all the function in your awesome add-on so if there are other places I should be messing with the connection (I think autoplay might be one, assuming it can use add-ons?), then a shove in the right direction (or link to a forum post where the function is explained) would be grand.

primaeval commented 7 years ago

AutoPlay and AutoPlayWith are scheduled as Alarms in autoplay.py and autoplaywith.py. The Alarms run the scripts play.py and playwith.py. I expect you need your code before the PlayMedia calls in there.

If the user is using their own scripts they need to copy the ones from script.tvguide.fullscreen\resources\playwith to the addon_data folder and modify them for their ffmpeg or other way to play the files. Have a look at the readme in there.

Zomboided commented 7 years ago

Updated and tested autoplay, and have scribbled some comments in the example scripts. Thinks this is ready for merging now if you want to take a look. Thanks for your help.

primaeval commented 7 years ago

Thanks. I'll merge it tomorrow when I'm more fresh.

primaeval commented 7 years ago

Are you Zomboided on the kodi forum too? I'll send you my email address there if you are.

Zomboided commented 7 years ago

Yup. I tried to PM you there before opening an issue on GitHub but it wouldn't let me. Cheers

On 24 Mar 2017, at 22:07, primaeval notifications@github.com wrote:

Are you Zomboided on the kodi forum too? I'll send you my email address there if you are.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

primaeval commented 7 years ago

You need 10 posts first. I guess they're trying to stop all the penis enlargement ads. ;)

primaeval commented 7 years ago

I send you a PM at the forum with my email.