Kodi Community Forum

Full Version: Live TV Playlist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
You're watching live Over-The-Air (OTA) TV in Kodi. While you're sitting there watching TV, Kodi is automatically changing the channel to each of your favorite TV shows without you lifting a finger. Is this a futuristic dream or is it a reality today? With the Live TV Playlist Add-on, the future is now. This Add-on enhances your live TV viewing experience in Kodi because you now have the ability to create a playlist of your favorite OTA TV shows. When it's time for your show to air, the Add-on changes the TV channel for you a few seconds before the program starts, thus insuring that you don't miss any of your favorite shows.

So how does the TV Playlist do this? Live TV Playlist operates similarly to the audio playlists except it maintains a list of your favorite “Over The Air” (OTA) TV shows. The Add-on sets an alarm for each TV show in the list and when that alarm goes off, it tells Kodi to change the channel. This process occurs without your intervention, which means you can sit back, relax and enjoy watching your favorite shows.

Image
1. Playlist Manager

Image
2. You use the EPG to select which favorite TV show to put into the playlist.

Image
3. A Notification Dialog appears in the lower right hand corner of your TV screen that counts down to the moment the channel will change.

Get the Add-on here:jmooremcc.repo.zip
Wiki:Live TV Playlist Wiki

Please note that this Add-on requires a PVR Add-on to be installed.

FAQ:

1. Can I control the playlist with my TV remote control?
   Yes. If your remote can control Kodi, the Add-on will let you easily program which button on your remote activates the playlist manager.
2. How do I enter my favorite shows into the playlist?
    It's very simple:
       a. Bring up the EPG (Electronic Program Guide)
       b. Select your TV show
       c. Acccess the EPG's context menu and click on "Add to Live TV Playlist".
3. What if I go out of town for work or go on vacation, will the playlist be running while I'm away?
   Not at all. You can activate Vacation Mode in the playlist manager which will suspend all operations.
Just what I've been waiting for! There seems to be a problem with time format, though:
Code:

2019-04-07 02:24:49.737 T:4856 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ValueError'>
Error Contents: time data '08.04.2019 9:25' does not match format '%d.%m.%Y %I:%M %p'
Traceback (most recent call last):
File "C:\Users\JoScha\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py", line 820, in <module>
epgData = getEPG_Data()
File "C:\Users\JoScha\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py", line 193, in getEPG_Data
liDateTime = datetime.strptime(xbmc.getInfoLabel('Listitem.Date'), dateformat)
File "C:\Program Files\Kodi\system\python\Lib\_strptime.py", line 332, in _strptime
(data_string, format))
ValueError: time data '08.04.2019 9:25' does not match format '%d.%m.%Y %I:%M %p'
-->End of Python script error report<--
How about overlapping shows? (a frequent occurrence) Can you specify one to watch now, and the other to be recorded and possibly auto-played later? Might be good to have record and record-series functions all in one place.
The add-on requires the system time display to be the 12 hour format with am/pm. The wiki has installation instructions that goes into more detail.
https://github.com/jmooremcc/Repository....stallation
See step 2.
@aegidius, when you select a show that conflicts with one already in the playlist, you'll get a notification to that effect immediately. Since you're already in the EPG, you can to choose to record the conflicting item instead.
Sounds great but I'm getting error when selecting to 'Add To Live TV Playlist' whether via context menu or mapped remote key:
Quote:ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
          - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
     Error Type: <type 'exceptions.TypeError'>
     Error Contents: attribute of type 'NoneType' is not callable
     Traceback (most recent call last):
          File "C:\Users\[username]\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py", line 820, in <module>
               epgData = getEPG_Data()
          File "C:\Users\[username]\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py", line 193, in getEPG_Data
               liDateTime = datetime.strptime(xbmc.getInfoLabel('Listitem.Date'), dateformat)
     TypeError: attribute of type 'NoneType' is not callable
     -->End of Python script error report<--
(2019-04-07, 05:41)jmooremcc Wrote: [ -> ]The add-on requires the system time display to be the 12 hour format with am/pm. The wiki has installation instructions that goes into more detail.
https://github.com/jmooremcc/Repository....stallation
See step 2.
I just had a look at the instructions and must say, I don't want to set a time format that puts month first (US). My background is European, I'm used to a logical display, either d-m-y or y-m-d. But thanks for your effort!
(2019-04-07, 10:39)HeresJohnny Wrote: [ -> ]
(2019-04-07, 05:41)jmooremcc Wrote: [ -> ]The add-on requires the system time display to be the 12 hour format with am/pm. The wiki has installation instructions that goes into more detail.
https://github.com/jmooremcc/Repository....stallation
See step 2.
I just had a look at the instructions and must say, I don't want to set a time format that puts month first (US). My background is European, I'm used to a logical display, either d-m-y or y-m-d. But thanks for your effort!   
I had the same initial reaction when I read that both date and time must be set to one specific format in the Kodi system settings, whereas best practice should be that the addon handles whatever the default format is set in Kodi.

However, based on the error message in HeresJohnny's log, it seems to me that only 12hr time format is required and that date format might already be correctly based on what's set for Kodi (or the OS), i.e. according to the error message both encountered and expected date formats are d/m/y (our preference)...

ValueError: time data '08.04.2019 9:25' does not match format '%d.%m.%Y %I:%M %p'

I still agree that users should not have to forego their preferred time format set for Kodi because one add-on demands that it must be a different format.
(2019-04-07, 10:39)HeresJohnny Wrote: [ -> ]
(2019-04-07, 05:41)jmooremcc Wrote: [ -> ]The add-on requires the system time display to be the 12 hour format with am/pm. The wiki has installation instructions that goes into more detail.
https://github.com/jmooremcc/Repository....stallation
See step 2.
I just had a look at the instructions and must say, I don't want to set a time format that puts month first (US). My background is European, I'm used to a logical display, either d-m-y or y-m-d. But thanks for your effort! 
This is the kind of feedback I've been looking for.
I will look into developing a solution to this issue.
Thank you for offering this valuable information.
(2019-04-07, 11:51)b'sketti Wrote: [ -> ]
(2019-04-07, 10:39)HeresJohnny Wrote: [ -> ]
(2019-04-07, 05:41)jmooremcc Wrote: [ -> ]The add-on requires the system time display to be the 12 hour format with am/pm. The wiki has installation instructions that goes into more detail.
https://github.com/jmooremcc/Repository....stallation
See step 2.
I just had a look at the instructions and must say, I don't want to set a time format that puts month first (US). My background is European, I'm used to a logical display, either d-m-y or y-m-d. But thanks for your effort!                
I had the same initial reaction when I read that both date and time must be set to one specific format in the Kodi system settings, whereas best practice should be that the addon handles whatever the default format is set in Kodi.

However, based on the error message in HeresJohnny's log, it seems to me that only 12hr time format is required and that date format might already be correctly based on what's set for Kodi (or the OS), i.e. according to the error message both encountered and expected date formats are d/m/y (our preference)...

ValueError: time data '08.04.2019 9:25' does not match format '%d.%m.%Y %I:%M %p'

I still agree that users should not have to forego their preferred time format set for Kodi because one add-on demands that it must be a different format.             

I just ran a test to duplicate what you experienced. My test involved changing my regional time format to UK d-m-y and my add-on did not crash.
The playlist is designed to work with different regional 12 hour formats and the playlist manager does display dates in the local regional time format.

I decided to take a closer look at the debug log you provided and concluded that the problem you experienced was not caused by the date format but was caused by your regional time format. In your case, the format that was used to convert the selected EPG item's start time into a datetime object was '%d.%m.%Y %I:%M %p'. The %p represents the locale’s equivalent of either AM or PM. I need this designation to turn a 12 hour clock's time into a 24 hour datetime object. Your time displayed: '08.04.2019 9:25' and did not include the equivalent of an am/pm designation which subsequently caused an exception in Python.

The fix is very simple and does not require you to change your date format.
You only need to change your regional time format to "h:mmConfuseds xx" in the Kodi settings.

I will update the installation instructions so that it is clear that only the time format needs to be changed in Kodi's settings.
Hm, I set the time to what you requested but I'm still getting an error:

Code:
2019-04-07 18:19:30.444 T:7784 DEBUG: Thread LanguageInvoker start, auto delete: false
2019-04-07 18:19:30.444 T:7784 INFO: initializing python engine.
2019-04-07 18:19:30.444 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): start processing
2019-04-07 18:19:30.503 T:7784 DEBUG: -->Python Interpreter Initialized<--
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): the source file to load is "C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py"
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): setting the Python path to C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl;C:\Program Files\video\Kodi\system\python\DLLs;C:\Program Files\video\Kodi\system\python\Lib;C:\Program Files\video\Kodi\python27.zip;C:\Program Files\video\Kodi\system\python\lib\plat-win;C:\Program Files\video\Kodi\system\python\lib\lib-tk;C:\Program Files\video\Kodi;C:\Program Files\video\Kodi\system\python;C:\Program Files\video\Kodi\system\python\lib\site-packages
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): entering source directory C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): instantiating addon using automatically obtained id of "service.ltvpl" dependent on version 2.25.0 of the xbmc.python api
2019-04-07 18:19:30.526 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting definitions
2019-04-07 18:19:30.526 T:7784 DEBUG: CAddonSettings[service.ltvpl]: trying to load setting definitions from old format...
2019-04-07 18:19:30.526 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting values
2019-04-07 18:19:30.526 T:7784 DEBUG: CSettingsManager: requested setting (FOLDER) was not found.
2019-04-07 18:19:30.729 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting definitions
2019-04-07 18:19:30.729 T:7784 DEBUG: CAddonSettings[service.ltvpl]: trying to load setting definitions from old format...
2019-04-07 18:19:30.730 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting values
2019-04-07 18:19:30.780 T:7784 DEBUG: unconverted data remains: AM
2019-04-07 18:19:30.782 T:7784 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ValueError'>
Error Contents: unconverted data remains: AM
Traceback (most recent call last):
File "C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py", line 820, in <module>
epgData = getEPG_Data()
File "C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py", line 193, in getEPG_Data
liDateTime = datetime.strptime(xbmc.getInfoLabel('Listitem.Date'), dateformat)
File "C:\Program Files\video\Kodi\system\python\Lib\_strptime.py", line 335, in _strptime
data_string[found.end():])
ValueError: unconverted data remains: AM
-->End of Python script error report<--
2019-04-07 18:19:30.782 T:7784 DEBUG: CPythonInvoker::onExecutionDone(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py)
2019-04-07 18:19:30.794 T:7652 DEBUG: ------ Window Init (DialogNotification.xml) ------
2019-04-07 18:19:30.860 T:7784 INFO: Python interpreter stopped
2019-04-07 18:19:30.861 T:7784 DEBUG: Thread LanguageInvoker 7784 terminating
I will try other time settings in the meantime.

UPDATE:
Nope, neither h:mmConfuseds xx nor hh:mmConfuseds xx seem to work (while leaving my previous date setting untouched.
(2019-04-07, 18:21)HeresJohnny Wrote: [ -> ]Hm, I set the time to what you requested but I'm still getting an error:

Code:
2019-04-07 18:19:30.444 T:7784 DEBUG: Thread LanguageInvoker start, auto delete: false
2019-04-07 18:19:30.444 T:7784 INFO: initializing python engine.
2019-04-07 18:19:30.444 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): start processing
2019-04-07 18:19:30.503 T:7784 DEBUG: -->Python Interpreter Initialized<--
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): the source file to load is "C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py"
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): setting the Python path to C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl;C:\Program Files\video\Kodi\system\python\DLLs;C:\Program Files\video\Kodi\system\python\Lib;C:\Program Files\video\Kodi\python27.zip;C:\Program Files\video\Kodi\system\python\lib\plat-win;C:\Program Files\video\Kodi\system\python\lib\lib-tk;C:\Program Files\video\Kodi;C:\Program Files\video\Kodi\system\python;C:\Program Files\video\Kodi\system\python\lib\site-packages
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): entering source directory C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): instantiating addon using automatically obtained id of "service.ltvpl" dependent on version 2.25.0 of the xbmc.python api
2019-04-07 18:19:30.526 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting definitions
2019-04-07 18:19:30.526 T:7784 DEBUG: CAddonSettings[service.ltvpl]: trying to load setting definitions from old format...
2019-04-07 18:19:30.526 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting values
2019-04-07 18:19:30.526 T:7784 DEBUG: CSettingsManager: requested setting (FOLDER) was not found.
2019-04-07 18:19:30.729 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting definitions
2019-04-07 18:19:30.729 T:7784 DEBUG: CAddonSettings[service.ltvpl]: trying to load setting definitions from old format...
2019-04-07 18:19:30.730 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting values
2019-04-07 18:19:30.780 T:7784 DEBUG: unconverted data remains: AM
2019-04-07 18:19:30.782 T:7784 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ValueError'>
Error Contents: unconverted data remains: AM
Traceback (most recent call last):
File "C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py", line 820, in <module>
epgData = getEPG_Data()
File "C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py", line 193, in getEPG_Data
liDateTime = datetime.strptime(xbmc.getInfoLabel('Listitem.Date'), dateformat)
File "C:\Program Files\video\Kodi\system\python\Lib\_strptime.py", line 335, in _strptime
data_string[found.end():])
ValueError: unconverted data remains: AM
-->End of Python script error report<--
2019-04-07 18:19:30.782 T:7784 DEBUG: CPythonInvoker::onExecutionDone(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py)
2019-04-07 18:19:30.794 T:7652 DEBUG: ------ Window Init (DialogNotification.xml) ------
2019-04-07 18:19:30.860 T:7784 INFO: Python interpreter stopped
2019-04-07 18:19:30.861 T:7784 DEBUG: Thread LanguageInvoker 7784 terminating
I will try other time settings in the meantime.

UPDATE:
Nope, neither h:mmConfuseds xx nor hh:mmConfuseds xx seem to work (while leaving my previous date setting untouched.
Please send me a screenshot of your regional settings page?
Thanks.
(2019-04-07, 04:14)aegidius Wrote: [ -> ]How about overlapping shows? (a frequent occurrence) Can you specify one to watch now, and the other to be recorded and possibly auto-played later? Might be good to have record and record-series functions all in one place.

I like your suggestion for resolving a conflict.
I could bring up another dialog that asks you to select which conflicting element to record.
If you choose the new item, that item would be set to record.
If you choose the existing playlist item, that item would be set to record and the new item would replace it in the playlist.
Would that work for you?
(2019-04-07, 19:14)jmooremcc Wrote: [ -> ]
(2019-04-07, 18:21)HeresJohnny Wrote: [ -> ]Hm, I set the time to what you requested but I'm still getting an error:

Code:
2019-04-07 18:19:30.444 T:7784 DEBUG: Thread LanguageInvoker start, auto delete: false
2019-04-07 18:19:30.444 T:7784 INFO: initializing python engine.
2019-04-07 18:19:30.444 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): start processing
2019-04-07 18:19:30.503 T:7784 DEBUG: -->Python Interpreter Initialized<--
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): the source file to load is "C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py"
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): setting the Python path to C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl;C:\Program Files\video\Kodi\system\python\DLLs;C:\Program Files\video\Kodi\system\python\Lib;C:\Program Files\video\Kodi\python27.zip;C:\Program Files\video\Kodi\system\python\lib\plat-win;C:\Program Files\video\Kodi\system\python\lib\lib-tk;C:\Program Files\video\Kodi;C:\Program Files\video\Kodi\system\python;C:\Program Files\video\Kodi\system\python\lib\site-packages
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): entering source directory C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl
2019-04-07 18:19:30.503 T:7784 DEBUG: CPythonInvoker(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py): instantiating addon using automatically obtained id of "service.ltvpl" dependent on version 2.25.0 of the xbmc.python api
2019-04-07 18:19:30.526 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting definitions
2019-04-07 18:19:30.526 T:7784 DEBUG: CAddonSettings[service.ltvpl]: trying to load setting definitions from old format...
2019-04-07 18:19:30.526 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting values
2019-04-07 18:19:30.526 T:7784 DEBUG: CSettingsManager: requested setting (FOLDER) was not found.
2019-04-07 18:19:30.729 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting definitions
2019-04-07 18:19:30.729 T:7784 DEBUG: CAddonSettings[service.ltvpl]: trying to load setting definitions from old format...
2019-04-07 18:19:30.730 T:7784 DEBUG: CAddonSettings[service.ltvpl]: loading setting values
2019-04-07 18:19:30.780 T:7784 DEBUG: unconverted data remains: AM
2019-04-07 18:19:30.782 T:7784 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ValueError'>
Error Contents: unconverted data remains: AM
Traceback (most recent call last):
File "C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py", line 820, in <module>
epgData = getEPG_Data()
File "C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py", line 193, in getEPG_Data
liDateTime = datetime.strptime(xbmc.getInfoLabel('Listitem.Date'), dateformat)
File "C:\Program Files\video\Kodi\system\python\Lib\_strptime.py", line 335, in _strptime
data_string[found.end():])
ValueError: unconverted data remains: AM
-->End of Python script error report<--
2019-04-07 18:19:30.782 T:7784 DEBUG: CPythonInvoker::onExecutionDone(49, C:\Users\JPS\AppData\Roaming\Kodi\addons\service.ltvpl\addon.py)
2019-04-07 18:19:30.794 T:7652 DEBUG: ------ Window Init (DialogNotification.xml) ------
2019-04-07 18:19:30.860 T:7784 INFO: Python interpreter stopped
2019-04-07 18:19:30.861 T:7784 DEBUG: Thread LanguageInvoker 7784 terminating
I will try other time settings in the meantime.

UPDATE:
Nope, neither h:mmConfuseds xx nor hh:mmConfuseds xx seem to work (while leaving my previous date setting untouched.
Please send me a screenshot of your regional settings page?
Thanks.    
It would also be helpful if you would turn debug logging on.
One way to do that is by adding the following to your advancedsettings.xml file:
Code:

<advancedsettings>
   <loglevel>1</loglevel>
   .
   .
   .
</advancedsettings>
Then paste your complete debug log to pastebin and post a link to it.
Here are my settings:
Image
The log excerpt above was already in debug mode. Hope this helps, if not I can still get a complete debug log.
Pages: 1 2 3