Kodi Community Forum
TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) (/showthread.php?tid=282157)



RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - FXB78 - 2017-01-12

I have it setup using Windows & ffmpeg. I made a few small changes to your original PlayWith.py, most notably I added in some filters to remove regex characters from the filename by using "import re". I also changed the file output to show a regular date/time using strftime. This is the section with the changes:

Code:
# Play with your own preferred player and paths
if url:
    name = "%s = %s = %s" % (channel,title,time.strftime('%d%m%Y-%H%M'))
    name = re.sub("\?",'',name)
    name = re.sub(":|<>\/",'',name)
    name = name.encode("cp1252")
    filename = xbmc.translatePath("C:\Users\Kodi\AppData\Roaming\Kodi\Recordings\%s.ts" % name)
    ffmpeg = r"c:\utils\bin\ffmpeg.exe"
    cmd = [ffmpeg, "-y", "-i", url, "-c", "copy", "-t", str(seconds), filename]
    p = Popen(cmd,shell=False)



RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2017-01-12

(2017-01-12, 11:09)FXB78 Wrote: I have it setup using Windows & ffmpeg. I made a few small changes to your original PlayWith.py, most notably I added in some filters to remove regex characters from the filename by using "import re". I also changed the file output to show a regular date/time using strftime. This is the section with the changes:

Code:
# Play with your own preferred player and paths
if url:
    name = "%s = %s = %s" % (channel,title,time.strftime('%d%m%Y-%H%M'))
    name = re.sub("\?",'',name)
    name = re.sub(":|<>\/",'',name)
    name = name.encode("cp1252")
    filename = xbmc.translatePath("C:\Users\Kodi\AppData\Roaming\Kodi\Recordings\%s.ts" % name)
    ffmpeg = r"c:\utils\bin\ffmpeg.exe"
    cmd = [ffmpeg, "-y", "-i", url, "-c", "copy", "-t", str(seconds), filename]
    p = Popen(cmd,shell=False)

Thanks. Actually that is a really good idea to have a seperate limited account to run Kodi in.
If you ever install a rogue addon it could potentially read any data on your computer that Kodi has access to and send it back to its evil master.


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - FXB78 - 2017-01-12

Absolutely, it's probably not really needed but better to be safe! If you're looking at AutoPlayWiths again I have noticed that the "Clear AutoPlayWiths" option in the settings doesn't currently work. I did look at it once over but couldn't figure it out, for some reason "Clear AutoPlay" works fine but I couldn't see any real difference in the options.


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2017-01-12

(2017-01-12, 11:20)FXB78 Wrote: Absolutely, it's probably not really needed but better to be safe! If you're looking at AutoPlayWiths again I have noticed that the "Clear AutoPlayWiths" option in the settings doesn't currently work. I did look at it once over but couldn't figure it out, for some reason "Clear AutoPlay" works fine but I couldn't see any real difference in the options.

version 0.0.292
- clear Autoplaywiths fix (thanks FXB78)

The function clearAllAutoplaywiths was actually missing. Thanks.


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - ködi-zömbie - 2017-01-12

(2017-01-11, 23:24)Cangeoboy Wrote: Kodi attempted to update to 0.291 but is giving me an update failed error. I running Kodi 17 RC2. Anyone else getting this?
Search for updates manually and THEN make update. You 'll see next current versions of possible updates


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - xDetoursx - 2017-01-12

(2017-01-12, 10:14)primaeval Wrote: There are a couple of sneaky addons that can still defeat these addons unless you modify a bit of their code.

Make sure you can play the stream normally in its own addon.

Check if another addon will play. I always use iPlayer WWW to test but pick one that you have access to in your country.

If you get stuck pm me with some more info and I'll see if I can help.

There are still a few unicode problems that I'm coming across and trying to fix.

iPlayer WWW works fine, but the other one is still having issues. PM sent. Thanks.


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - enerdude - 2017-01-12

Just got a question regarding the the addons.ini and the c --> Add Alt Stream behaviour of the guide.

lets say I have an EPG channel "bbc1" and have already mapped a stream to it, if I have the addons.ini file present containing "bbc1" as well and then perform the action above, it will overwrite previous stream mapped. I would actually want the option to add it as alternate stream without going through the whole "c, stream setup, browse, choose addon and then only choose stream" procedure. Would this be possible?

Thanks in advance.


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2017-01-12

(2017-01-12, 18:24)enerdude Wrote: Just got a question regarding the the addons.ini and the c --> Add Alt Stream behaviour of the guide.

lets say I have an EPG channel "bbc1" and have already mapped a stream to it, if I have the addons.ini file present containing "bbc1" as well and then perform the action above, it will overwrite previous stream mapped. I would actually want the option to add it as alternate stream without going through the whole "c, stream setup, browse, choose addon and then only choose stream" procedure. Would this be possible?

Thanks in advance.

I'm confused because it works ok for me.

If I set the primary stream for BBC One as iPlayerWWW \ BBC One,
I can do Menu \ Add Alt Stream and choose another addon \ BBC One
then do it again.
When I play BBC One I now have 3 choices.

Doesn't that work for you?


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - enerdude - 2017-01-12

Let me explain in detail:

I have a xml channel list in livestreamspro addon. So if I use the addons.ini creator and export it and then go into TVGF and click on "bbc one" it will open without me setting up the stream seeing that it exists in addons.ini and matches the EPG channel name. So now I exit and subscribe a different xml channel list existing inside livestreamspro and overwrite the old addons.ini containing also "bbc one" but its a different link to the old one. So now if I go Menu \ Alt stream (not menu \ Stream setup \ browse for addon \ choose stream \ save stream) as this is too tedious, I want it to ask me to add it as alternate stream and not overwrite my previous selection.


Edit: The way I understand addons.ini creator work is if lets say I subscribe two xmls (2 folders) in e.g. livestreamspro and both have the same channel name, one will overwrite the next and the resulting addons.ini will e.g contain only one "bbc one". Can we make it maybe export both and then when present in TVGF it will parse the file and select the first instance of "bbc one" but when doing the Menu \ Alt stream it should parse the addons.ini file, detect that there is 2 occurences of "bbc one" and offer to add it as alt stream?


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2017-01-12

(2017-01-12, 20:00)enerdude Wrote: Let me explain in detail:

I have a xml channel list in livestreamspro addon. So if I use the addons.ini creator and export it and then go into TVGF and click on "bbc one" it will open without me setting up the stream seeing that it exists in addons.ini and matches the EPG channel name. So now I exit and subscribe a different xml channel list existing inside livestreamspro and overwrite the old addons.ini containing also "bbc one" but its a different link to the old one. So now if I go Menu \ Alt stream (not menu \ Stream setup \ browse for addon \ choose stream \ save stream) as this is too tedious, I want it to ask me to add it as alternate stream and not overwrite my previous selection

The primary key for the Alternative Streams table in the database is the channel id and the url.
https://github.com/primaeval/script.tvguide.fullscreen/blob/90d50d547bba78f0d31e044c4e0199db05b5353f/source.py#L1239
If they match the previous entry in the table then just the channel name will be updated. No new entry will be created.
https://github.com/primaeval/script.tvguide.fullscreen/blob/90d50d547bba78f0d31e044c4e0199db05b5353f/source.py#L1029


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - enerdude - 2017-01-12

(2017-01-12, 20:17)primaeval Wrote: The primary key for the Alternative Streams table in the database is the channel id and the url.
https://github.com/primaeval/script.tvguide.fullscreen/blob/90d50d547bba78f0d31e044c4e0199db05b5353f/source.py#L1239
If they match the previous entry in the table then just the channel name will be updated. No new entry will be created.
https://github.com/primaeval/script.tvguide.fullscreen/blob/90d50d547bba78f0d31e044c4e0199db05b5353f/source.py#L1029

What happens when channel id match and url is different? This is my issue....

Edit:
Ok maybe I don't understand how addons.ini is used by the addon. Is it read every time a channel is started to see if it must update the database? What I'm really asking is a way to import stream urls all at once. So initially I use an addons.ini containing stream names and urls that match the EPG channel names to import it into the database. I then delete the addons.ini and put another there with same channel names but different urls. I now want to import them as secondary (alternate streams). If at all, how can I accomplish this - either one by one by clicking on Menu \ Alt stream or another way doing all at once?


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - myname - 2017-01-12

In between cases of beer i've still been messing around with the skin adding some flair. Everything in my images works with mouse, but i haven't finalized button navigation for a remote until i decide what i'm going to keep. All the images are ripped into our skin so we have total control over the images, and the variables are player dependent, not skin specific. So far it works in Confluence\Estuary and Kodi 16\17 without a hitch. For the menu, i like the current title, player controls, the vertical estuary media flags, the progress and the progress times. For the OSD i like the horizontal player controls. This is all just a proof of concept of whats available. By using the horizontal and vertical button layouts you can add whatever you want without much hassle or co-ordinates as it dynamically populates the list. All this is done within the skin too; i didn't have to touch the core addon at all (py files). If i have an id to use as an anchor for navigation focus it can be added to the menu easily, but the osd would require a little messing around. With a mouse everything is fine, but with a remote the up\down\left\right would need to be for navigating the controls and you would have to click on the up\down\left\right arrows instead. You could in theory replace the kodi osd altogether now as i think i managed to steal all the proper controls from the default osd.


Menu
Image
- shows current playing title
- player controls (default buttons)
- thumbnail
- progress bar, progress, duration, timeleft, actual time program ends.
- estuary and confluence flags horizontal\vertical - resolution, aspect ratio, video codec, speaker channels, audio codec, and if applicable genre and audio language.


OSD
Image

Company just showed up so gotta go, but the controls are the same as my old navigation buttons, mixed in with the player controls.


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2017-01-12

(2017-01-12, 21:58)enerdude Wrote:
(2017-01-12, 20:17)primaeval Wrote: The primary key for the Alternative Streams table in the database is the channel id and the url.
https://github.com/primaeval/script.tvguide.fullscreen/blob/90d50d547bba78f0d31e044c4e0199db05b5353f/source.py#L1239
If they match the previous entry in the table then just the channel name will be updated. No new entry will be created.
https://github.com/primaeval/script.tvguide.fullscreen/blob/90d50d547bba78f0d31e044c4e0199db05b5353f/source.py#L1029

What happens when channel id match and url is different? This is my issue....

Edit:
Ok maybe I don't understand how addons.ini is used by the addon. Is it read every time a channel is started to see if it must update the database? What I'm really asking is a way to import stream urls all at once. So initially I use an addons.ini containing stream names and urls that match the EPG channel names to import it into the database. I then delete the addons.ini and put another there with same channel names but different urls. I now want to import them as secondary (alternate streams). If at all, how can I accomplish this - either one by one by clicking on Menu \ Alt stream or another way doing all at once?

The addons.ini file gives you a list of potential streams for your channels.

If you want to force the match you can use a mapping.ini file or M3U file in
Settings \ Optional \ Channel Mappings

When you run the guide a template file of all the channels is created in:
userdata\addon_data\script.tvguide.fullscreen\channels.ini
You can fill the streams in there by hand and rename it to mapping.ini to load in the Channel Mappings.

When the guide is closed it writes a file with the latest channel mappings in:
userdata\addon_data\script.tvguide.fullscreen\custom_stream_urls_autosave.ini

At the moment that is just for the primary stream for each channel.
There is nothing for the Alternative Streams. You have to do them one at a time.

I could make an import function for you if that is what you need.

The other options are to use the new addons:
Stream Searcher does a new search in selected addon folders every time.
addons.ini Player does a search in an addons.ini file each time.

[EDIT] You can merge in an extra addons.ini file in Settings \ Optional too.


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2017-01-12

(2017-01-12, 22:35)myname Wrote: ^^^

Don't drink and code! I tried it over the Summer and had to fix all the mistakes the next sober morning. Wink

Is there a way to hide the controls in the xml until the mouse moves or does that need to be in gui.py as the main epg does it?


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - enerdude - 2017-01-13

(2017-01-12, 22:42)primaeval Wrote: The addons.ini file gives you a list of potential streams for your channels.

If you want to force the match you can use a mapping.ini file or M3U file in
Settings \ Optional \ Channel Mappings

When you run the guide a template file of all the channels is created in:
userdata\addon_data\script.tvguide.fullscreen\channels.ini
You can fill the streams in there by hand and rename it to mapping.ini to load in the Channel Mappings.

but these mappings are for the primary url right? I need to add alternate streams. The import function you talking about might just do it. Basically I need it to import addons.ini as alternate url.

Guess I can use my winautomation tool to read the addons.ini and write it into the database directly, just thought maybe you can add such an import function in settings \ optional to import contents of addons.ini into alt_custom_stream_url database table, provided there are already an entry in custom_stream_url database table, otherwise it can be added there as the primary url