Kodi Community Forum

Full Version: IPTV Recorder
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2018-05-21, 13:36)dzejms Wrote: [ -> ]Great work @primaeval 

I've found unicode related issue. When channel's name has "+" it fails to record. Job is added to the queue though.
 Thanks.

Could you see if the + is encoded in the xmltv or m3u files.
There is a lot of decoding and encoding going on between the source and actual ffmpeg commandline.
Hi,
I getting the following error:

20:04:13.289 T:1858073504   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'timetuple'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 2839, in <module>
                                                plugin.run()
                                              File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 332, in run
                                                items = self._dispatch(self.request.path)
                                              File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 306, in _dispatch
                                                listitems = view_func(**items)
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 1465, in channel
                                                return listing(programmes, scroll=True)
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 1577, in listing
                                                starttime = utc2local(start)
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 169, in utc2local
                                                timestamp = calendar.timegm(utc.timetuple())
                                            AttributeError: 'NoneType' object has no attribute 'timetuple'
                                            -->End of Python script error report<--

Where could be the problem ?
The channels and epg seems to be loaded correctly.

Thanks in advance
Gonçalo
(2018-05-21, 21:11)kaable Wrote: [ -> ]Hi,
I getting the following error:

20:04:13.289 T:1858073504   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'timetuple'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 2839, in <module>
                                                plugin.run()
                                              File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 332, in run
                                                items = self._dispatch(self.request.path)
                                              File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 306, in _dispatch
                                                listitems = view_func(**items)
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 1465, in channel
                                                return listing(programmes, scroll=True)
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 1577, in listing
                                                starttime = utc2local(start)
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 169, in utc2local
                                                timestamp = calendar.timegm(utc.timetuple())
                                            AttributeError: 'NoneType' object has no attribute 'timetuple'
                                            -->End of Python script error report<--

Where could be the problem ?
The channels and epg seems to be loaded correctly.

Thanks in advance
Gonçalo
 Hi. Some program hasn't got a correct start time.
I don't know if it is the symptom of something bigger or just one program that is wrong.
Is it happening for every channel?
Have a look in the files in addon_data\plugin.video.iptv.recorder to see if anything is missing.
Look in xmltv1.xml for channels and programs and channels1.m3u for the streams.
The xmltv.db file should be about the same size as the xmltv1.xml file.

If you can't spot what is wrong pm me a link to some of your data and I'll have a look.
(2018-05-21, 21:51)primaeval Wrote: [ -> ]
(2018-05-21, 21:11)kaable Wrote: [ -> ]Hi,
I getting the following error:

20:04:13.289 T:1858073504   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'timetuple'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 2839, in <module>
                                                plugin.run()
                                              File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 332, in run
                                                items = self._dispatch(self.request.path)
                                              File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 306, in _dispatch
                                                listitems = view_func(**items)
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 1465, in channel
                                                return listing(programmes, scroll=True)
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 1577, in listing
                                                starttime = utc2local(start)
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 169, in utc2local
                                                timestamp = calendar.timegm(utc.timetuple())
                                            AttributeError: 'NoneType' object has no attribute 'timetuple'
                                            -->End of Python script error report<--

Where could be the problem ?
The channels and epg seems to be loaded correctly.

Thanks in advance
Gonçalo
 Hi. Some program hasn't got a correct start time.
I don't know if it is the symptom of something bigger or just one program that is wrong.
Is it happening for every channel?
Have a look in the files in addon_data\plugin.video.iptv.recorder to see if anything is missing.
Look in xmltv1.xml for channels and programs and channels1.m3u for the streams.
The xmltv.db file should be about the same size as the xmltv1.xml file.

If you can't spot what is wrong pm me a link to some of your data and I'll have a look. 
Hi @primaeval,
I couldn't send you a private message,
please find in here the link to download https://transfer.sapo.pt/downloads/98b17...60201625I/ the files requested.

the xmltv.db and xmltv1.xml have almost the same size.

yes all the channels are giving the same error.

Thanks for all help
Gonçalo
(2018-05-21, 18:49)primaeval Wrote: [ -> ]
(2018-05-21, 13:36)dzejms Wrote: [ -> ]Great work @primaeval 

I've found unicode related issue. When channel's name has "+" it fails to record. Job is added to the queue though.
 Thanks.

Could you see if the + is encoded in the xmltv or m3u files.
There is a lot of decoding and encoding going on between the source and actual ffmpeg commandline.    
It's in both. I've edited m3u:

from:
#EXTINF:-1 tvg-id="MiniMini+" ,Minimini+ HD

to:
#EXTINF:-1 tvg-id="MiniMini+" ,Minimini HD

Changing channel's name fixes the issue.

1. Would it be possible to add sorting option to channel's list? i.e. to keep the original order of m3u file?
2. Scheduled recordings on macOS are not working.
version 0.0.52

@kaable  Your start and stop times didn't have a utc offset in them.
I've added some code to add " +0000" to them.
Your xmltv is from Webgrab so I assume the dates are in a valid format.

If IPTV Recorder needs an offset you'll have to add the tvg-shift offset into the m3u file.
See here for how to do it in the example.
https://kodi.wiki/view/Add-on:IPTV_Simple_Client#Usage

If you want to do a Portuguese translation I'll add it in for you.
@dzejms 
I've added a "Sort Channels by Name" option in the Settings. See if that works.

I'm not sure where the code is getting confused about the + in the name.
Does it work if you add a tvg-name field to the channel in the m3u file?
The name after the comma is a fallback name that is used to do some extra searching for missing "tvg-name"s.
What does the name look like in the xmltv file?
Post the <channel></channel section for Minimini+ HD

Tell me some more details about recording on macOS.
Does "record once" work for current programs?
Does recording work for the next program if you leave kodi open?
What version are you on and does your ffmpeg have the right permissions?
Are the recording paths in the .job files correct for macos?
I can't afford a mac so you'll have to do the debugging for me.
(2018-05-22, 10:52)primaeval Wrote: [ -> ]@dzejms 
I've added a "Sort Channels by Name" option in the Settings. See if that works.

Does not make any difference for me.
Quote:I'm not sure where the code is getting confused about the + in the name.
Does it work if you add a tvg-name field to the channel in the m3u file?

No it does not. I still have to add fallback name, otherwise PVR IPT Simple Client won't have display channel's name.

This is the log output when fallback name has "+" => "MiniMini%2B HD"
10:09:51.851 T:123145527291904 NOTICE: [xbmcswift2] Request for "/channel/MiniMini% 2B" matches rule for function "channel"

I've added space between % and 2B, cause otherwise browser renders +.
Quote:What does the name look like in the xmltv file? Post the <channel></channel section for Minimini+ HD
<channel id="MiniMini+">
<display-name lang="pl">MiniMini+ HD</display-name>
<icon src="http://i.imgur.com/xyoxpB2.png"/>
<url>http://www.programtv.interia.pl</url>
</channel>
 
Quote:Tell me some more details about recording on macOS.
Does "record once" work for current programs?
For current one it works fine.
Quote:Does recording work for the next program if you leave kodi open?
Nope.
Quote:What version are you on and does your ffmpeg have the right permissions?
17.6. ffmpeg must have a right perms as it does record current program.
 
Quote:Are the recording paths in the .job files correct for macos?

Yes. They're as the current program is recorded ok.

Happy to help with debuggin on macOS.

I've notice you still have cronjob to do for Linux. I guess it will (should) work on macOS.
One more thing: I have multiple channels like TVN24, TVN24HD, TVN24FHD. They all have the same tvg-id as they're the same channel but different quality. IPTV recorder is showing only one instance: TVN24.
You might have to force an update of my repo to get 0.0.52.
Sometimes you even have to remove my repo and re-add it.
I've never got to the bottom of how Kodi caches repo update checks and when it tries again.

"MiniMini+ HD" doesn't match "Minimini+ HD".
That might be the problem.
The channel names have to be url encoded internally for kodi to handle them.
If it's not that I'll see if I can recreate the problem and have another look.

Only Windows has the option to use an external scheduler so far.
I started work on systemd timers and it got complicated very quickly.
Does macos use systemd or cron or something else?

The default is just to use the internal Kodi timer mechanism.
Maybe there is a problem with that on macos.

Have a look in the jobs folder in
userdata\addon_data\plugin.video.iptv.recorder\jobs
You should get a .py file when the job is created with how it is going to run ffmpeg.
When the ffmpeg recording starts you should get a .pid file with the process id in it.
If you turn on
Settings \ Debug \ debug ffmpeg stdout/stderr
you should get the output of ffmpeg when it runs in .stdout and .stderr files.

Let me know if any of those files gets created for your future program recordings.
Channel's list work for me now. Thanks for the push.

I have tried changing channels names, but with luck. Everytime I go back to the name with "+" recording fails.

I'm also getting a lot of those in Kodi's log:
Quote:11:10:06.689 T:123145307414528 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
11:10:06.717 T:123145307414528  NOTICE: [xbmcswift2] Request for "/" matches rule for function "index"
11:10:06.718 T:123145307414528 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
11:10:08.995 T:123145307414528 WARNING: Previous line repeats 2 times.
11:10:08.995 T:123145307414528  NOTICE: [xbmcswift2] Request for "/groups" matches rule for function "groups"
11:10:09.079 T:123145307414528 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
11:10:10.730 T:123145307414528 WARNING: Previous line repeats 1 times.
11:10:10.731 T:123145307414528  NOTICE: [xbmcswift2] Request for "/group/All+Channels" matches rule for function "group"
11:10:10.731 T:123145307414528 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
11:10:10.749 T:123145307414528 WARNING: Previous line repeats 23 times.
Don't worry about those warnings.

I'll have a deeper look at the +.
Different streams with the same tvg-id used to work. I'll see if I can repair that.
I've added
Settings \ Jobs and Rules \ Url Encode Filenames
in version 0.0.54 to force url encoded filenames in case that is the problem.

I really can't see what else it could be.
My test xmltv file has this now:
<channel id="5starplus1+.uk">
    <display-name lang="en">5* +1</display-name>
  </channel>
and my m3u has this:
Code:
#EXTINF:-1 tvg-name="5* +1" tvg-id="5starplus1+.uk" tvg-logo="None" group-title="UK/Ireland - FreeSat",5* +1

Recording works fine on Windows.
Channels with multiple resolution streams should work now except in the Full EPG.
The Full EPG is just the xmltv's view of the world.
Since version 0.55 I can't record at all:

Code:
15:42:47.676 T:123145483771904  NOTICE: [xbmcswift2] Request for "/record_once/5340/TVP+1/TVP+1+HD" matches rule for function "record_once"
15:42:47.677 T:140736183837568   ERROR: GetDirectory - Error getting plugin://plugin.video.iptv.recorder/record_once/5340/TVP+1/TVP+1+HD
15:42:47.677 T:123145483771904 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
15:42:47.677 T:140736183837568   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.iptv.recorder/record_once/5340/TVP+1/TVP+1+HD) failed
15:42:47.678 T:123145510592512   ERROR: No url for TVP 1 HD