Giter Club home page Giter Club logo

plugin.video.iptv.recorder's Introduction

IPTV Recorder

plugin.video.iptv.recorder

Kodi addon for recording streams from the IPTV Simple Client pvr plugin or xmltv/m3u files.

Adding recording from the IPTV Simple Client is possible and has been done but it is too hard for most people to build for their devices.

This addon is an easily extensible python addon that should work with any device.

You will need a version of ffmpeg for your device.

https://ffmpeg.org/

Android builds are here: https://github.com/WritingMinds/ffmpeg-android/releases/latest

On Android this addon will copy ffmpeg to the /data/data folder so it can run.

Quick Start

TODO

  • cron jobs on Linux.

plugin.video.iptv.recorder's People

Contributors

deadlocker8 avatar johanburati avatar mickaelblondeau avatar primaeval avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugin.video.iptv.recorder's Issues

FIX ADDON RUNNING WITH NO PVR ENABLED

add this to server & default py files

stops running if no PVR addon found as cant get any data

if not xbmc.getCondVisibility('System.HasPVRAddon'):
exit()

Program not found

Hello,

When i press button "IPTV Recorder" in the Program info menu i get an error saying

IPTV Recorder
program not found

Does anyone know what the problem is?

Using RPi3 LibreElec

Thank you!

Synology nas

Thank your for this useful tool!

Is it possible to run it on docker Synology nas?

iptv recording

hi. I'm a beginner and i wish to know how to record channales in IPTV SIMPLE CLIENT using windows and android ?

Special characters not handled properly in channel name and TV program name

When launching a record with a channel name or a TV program name that has special characters (%... in the /record_epg/... URL), it leads to a Python script error.
Here is the kodi.log:
2020-04-07 21:48:04.103 T:10591 DEBUG: [xbmcswift2] Handling incoming request for /record_epg/LCP+Assembl%C3%A9e+Nationale/D%C3%A9batDoc/2020-04-07 21:30:00/2020-04-07 22:00:00
2020-04-07 21:48:04.104 T:10591 NOTICE: [xbmcswift2] Request for "/record_epg/LCP+Assembl%C3%A9e+Nationale/D%C3%A9batDoc/2020-04-07 21:30:00/2020-04-07 22:00:00" matches rule for function "record_epg"
2020-04-07 21:48:04.115 T:10591 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeEncodeError'>
Error Contents: 'ascii' codec can't encode character u'\xe9' in position 11: ordinal not in range(128)
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.iptv.recorder/main.py", line 3484, in
plugin.run()
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 345, in run
items = self._dispatch(self.request.path)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 319, in _dispatch
listitems = view_func(**items)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.iptv.recorder/main.py", line 548, in record_epg
log("Scheduling record for '{}: {} ({} to {})'".format(channelname, name, start, stop))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 11: ordinal not in range(128)
-->End of Python script error report<--
2020-04-07 21:48:04.115 T:10591 DEBUG: onExecutionDone(5, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.iptv.recorder/main.py)

non-ascii characters in search input

When you search for title/category/plot with non-ascii characters, next time you open the search dialog it crashes with following error:

2019-03-13 22:28:57.889 T:3509703536 WARNING: Previous line repeats 1 times.                                                     
2019-03-13 22:28:57.889 T:3509703536  NOTICE: [xbmcswift2] Request for "/search_title_dialog" matches rule for function "search_title_dialog"              
2019-03-13 22:28:57.900 T:3509703536   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--   
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!                                                     
                                            Error Type: <type 'exceptions.KeyError'>                                                                         
                                            Error Contents: u'\u0142'                                                                            
                                            Traceback (most recent call last):                                                                   
                                              File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 3162, 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 1398, in search_title_dialog    
                                                context_items.append((_("Delete Search"), 'XBMC.RunPlugin(%s)' % (plugin.url_for(delete_search_title, title=search))))
                                              File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 295, in url_for                    
                                                pathqs = rule.make_path_qs(items)                                                                                     
                                              File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/urls.py", line 160, in make_path_qs                 
                                                path = self._make_path(url_items)                                                                                     
                                              File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/urls.py", line 110, in _make_path                   
                                                items[key] = quote_plus(val)                                                                                          
                                              File "/usr/lib/python2.7/urllib.py", line 1303, in quote_plus                                          
                                              File "/usr/lib/python2.7/urllib.py", line 1298, in quote                                               
                                            KeyError: u'\u0142'                                                                                      
                                            -->End of Python script error report<--                                                                        
2019-03-13 22:28:58.086 T:3492918128   ERROR: GetDirectory - Error getting plugin://plugin.video.iptv.recorder/search_title_dialog                 
2019-03-13 22:28:58.091 T:4093035296   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.iptv.recorder/search_title_dialog) failed

It seems the problem is with encoding when it tries to get search history and add it to the list.
To resolve that the search items must be first UTF-8 encoded.

Example:

    for search in searches:                                         
        context_items = []                                          
        log(search)                                                   
        context_items.append((_("Delete Search"), 'XBMC.RunPlugin(%s)' % (plugin.url_for(delete_search_title, title=search.encode("utf8")))))
        items.append({                                                                                                                       
            "label": search,                                                                                                                 
            "path": plugin.url_for('search_title', title=search.encode("utf8")),                                                             
            "thumbnail": get_icon_path('search'),                                                                                            
            'context_menu': context_items,                                                                                                   
            })                                                                                                                               
    return items 

I can prepare PR in next days if you want.

Python version problem

Hi all,

I have installed this plugin.

Be appear, the plugin is writed with python 2 instead of python 3 is installed.

2024-01-26 15:13:46.826 T:1310    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'sqlite3.OperationalError'>
                                                   Error Contents: no such table: favourites
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 3450, in <module>
                                                       plugin.run()
                                                     File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 338, in run
                                                       items = self._dispatch(self.request.path)
                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 312, in _dispatch
                                                       listitems = view_func(**items)
                                                                   ^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 2164, in favourite_channels
                                                       return group(section="FAVOURITES")
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 2196, in group
                                                       favourite_channels = cursor.execute("SELECT * FROM favourites ORDER BY channelname").fetchall()
                                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                   sqlite3.OperationalError: no such table: favourites
                                                   -->End of Python script error report<--
                                                   
2024-01-26 15:13:46.971 T:1309    error <general>: GetDirectory - Error getting plugin://plugin.video.iptv.recorder/favourite_channels
2024-01-26 15:13:46.980 T:1067    error <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.iptv.recorder/favourite_channels) failed
2024-01-26 15:13:47.648 T:1312  warning <general>: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2024-01-26 15:13:47.680 T:1312     info <general>: [xbmcswift2] Request for "/" matches rule for function "index"
2024-01-26 15:13:47.681 T:1312  warning <general>: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2024-01-26 15:13:49.990 T:1317     info <general>: Skipped 3 duplicate messages..
2024-01-26 15:13:49.990 T:1317     info <general>: [xbmcswift2] Request for "/groups" matches rule for function "groups"
2024-01-26 15:13:50.007 T:1317    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'sqlite3.OperationalError'>
                                                   Error Contents: no such table: streams
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 3450, in <module>
                                                       plugin.run()
                                                     File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 338, in run
                                                       items = self._dispatch(self.request.path)
                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 312, in _dispatch
                                                       listitems = view_func(**items)
                                                                   ^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.iptv.recorder/main.py", line 2348, in groups
                                                       channelgroups = cursor.execute("SELECT DISTINCT groups FROM streams ORDER BY groups").fetchall()
                                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                   sqlite3.OperationalError: no such table: streams
                                                   -->End of Python script error report<--

Error parsing dates (Kodi)

Hi there

When I try to record a program trought the TV program grid > "Schedule IPTV Recorder", I have this message "IPTV Recorder > Error parsing dates".

Kodi : v18

PVR IPTV Simple Client : 3.8.4 by nightik.
- Local m3u file (not on the internet, on the Android TV Box).

IPTV Recorder : v 0.0.131 by Primaeval, Chychy (the repository.primaeval-0.0.2 doesn't work : the Configure and Run buttons are grey, I don't know why).

A/ Display :

  • Show create Estuary (IPTV  Recorder skin) : activated

B/ Job and Rules : 

  • pipe ffmpeg output ... : activated
  • ffmpeg : ffmpeg-4.2.1.tar.bz2 located in Download directory.

C/ Data : 

  • External xmltv 1 : IPTV Simple Client
  • External m3u 1 : IPTV Simple Client

Regional : 

  • Regional default format : France
  • Short date format : Régional (13/10/2019)
  • Long date format : Régional (Dimanche 13 octobre 2019)
  • Time format : Régional (H:mm:ss)
  • Use 12/24 hour format : 24 hours

Thank you for your help

OperationalError: no such column: tvg_name

Crash when trying to record a channel

2020-12-27 20:45:59.078 T:123145343946752 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'sqlite3.OperationalError'>
Error Contents: no such column: tvg_name
Traceback (most recent call last):
File "/Users/gdufour/Library/Application Support/Kodi/addons/plugin.video.iptv.recorder/main.py", line 3484, in
plugin.run()
File "/Users/gdufour/Library/Application Support/Kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 342, in run
items = self._dispatch(self.request.path)
File "/Users/gdufour/Library/Application Support/Kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 316, in _dispatch
listitems = view_func(**items)
File "/Users/gdufour/Library/Application Support/Kodi/addons/plugin.video.iptv.recorder/main.py", line 1448, in broadcast
channel = cursor.execute("SELECT * FROM channels WHERE tvg_name=?", (channelname, )).fetchone()
OperationalError: no such column: tvg_name
-->End of Python script error report<--
2020-12-27 20:45:59.110 T:123145342337024 ERROR: GetDirectory - Error getting plugin://plugin.video.iptv.recorder/broadcast/11114/%7CFR%7C+TV++FAMILY+HD

Indeed the schema does not match the code

sqlite> .schema channels
CREATE TABLE channels(uid INTEGER PRIMARY KEY ASC, id TEXT, name TEXT, icon TEXT);
sqlite>

channel = cursor.execute("SELECT * FROM streams WHERE name=?", (channelname,)).fetchone()
if not channel:
    channel = cursor.execute("SELECT * FROM channels WHERE tvg_name=?", (channelname, )).fetchone()
    uid, tvg_id, name, tvg_logo = channel
    url = ""
else:
    uid,

Kodi crash

When i recording a show Kodi crash on different french channel
Do you have any ideas ?

ffmpeg exe not found

running nvidia shield with kodi 18.2. Im trying to start a recording but it says ffmpeg exe not found.
I have downloaded the android version of ffmpeg from the linked site in the readme, extracted a file named ffmpeg from the armeabi-v7a folder and copied it to a created directory on the shield. in the IPTV Recorder addon I have pointed ffmpeg to that file. do I need to place ffmpeg file somewhere specific on the shield to get it to work? is there a different version of ffmpeg needed for the shield?

Failure to record a program when there is a '/' character in the program name

I am using iptv.recorder version 0.0.73 on Linux.
When trying to record a program with a '/' character in the program name it fails because the slash is a directory separator in Linux.

For example if the program name is "Team1 / Team2 - SPORTS2 - 2018-09-29 18-00"
ffmpeg will think the "Team1 " part is a directory and will fail to save the file:
/tmp/Team1 / Team2 - SPORTS2 - 2018-09-29 18-00.ts: No such file or directory

I tried to use the filename.urlencode to true but the urllib.quote does not convert the '/' character.

I made a commit to replace the '/' character with %2F in all cases, please review and merge.

Available on google tv

Its possible to work with google tv? Seems use fdmpeg.exe and this is only Windows file
Thx

IPTV Recorder error

Hello,

I've tried your version with the latest build of kodi : it installs well but I can't succeed in using it
each time I select an item in the menu like Favourite channels, Channel groups etc... I have the error message appearing
I've attached the log

Thanks
Chris

kodi.log

cron jobs on linux

Hi, will this work OK on Linux? I'm using Libreelec edition. Could you explain what's the left todo "cron jobs on linux" for? Is it some data clean-up or it's needed for recording to work? Thanks!

Problem Recording

Hi there,

Thanks for the awesome initiative.. Just taking this for a spin the first time; I'm running libreelec v18 on a r pi 4. Installed FFMPEG Tools addon from the Lirbrelec repository. Set a couple of streams up to record (on my external usb drive plugged into the pi permanently). Setup seemed fine; checked the recordings folder this morning & there were two .ts files (on for each recording) with a file size of 0 Bytes.

Checked the kodi.log file & this is all I could find that seemed pertinent:

WARNING: could not find codec parameters for /var/media/USBDRIVE/recordings/Other/The show i was trying to record.ts
2021-06-01 09:39:06.418 T:2366632816 ERROR: Open - error probing input format, /var/media/USBDRIVE/recordings/Other/Show Name/The show I was trying to record.ts

Any ideas?

Comparison with nexPVR recording...

Can't we also just use, instead of PVR Simple, the nexPVR which apparently also allows multiple IPTV URLs ( aggregates all in a single playlist in Kodi Live TV)?

Any pros/cons including platform support (Win/Android/LibreElec-Coreelec JeOS)?

V19 update? Python 3 compatibility.

Hi thanks for the great work for this addon. Will this addon be updated for V19? Python 3? I am getting errors with import ctypes init.py cannot import name union from line 8. i am running Windows10 and Kodi V19. I've managed to get a couple of other addons working for Py3 but I'm a noob and this is beyond my current knowledge. Error Contents: cannot import name 'Union' from 'ctypes' (C:\Program Files\Kodi\system\python\Lib\ctypes_init_.py) Traceback (most recent call last): File "C:\Users\All\AppData\Roaming\Kodi\addons\plugin.video.iptv.recorder\main.py", line 10, in import ctypes
File "C:\Program Files\Kodi\system\python\Lib\ctypes_init_.py", line 8, in from ctypes import Union, Structure, Array ImportError: cannot import name 'Union' from 'ctypes' (C:\Program Files\Kodi\system\python\Lib\ctypes_init_.py)

Works for LibreElec/CoreElec ?

Great work !

Will this work on LibreElec/CoreElec, e.g., the ffmpeg download problem?
LE/CE are read only JeOSes. Bit CoreElec does have the Entware manager. Don't know if that helps.

Fail to play or record all channels that contain extra lines like #EXTVCOPT...

Fail to play or record all channels that contain extra lines like #EXTVCOPT...

#EXTINF:0,Blonde
#EXTVLCOPT:network-caching=2000
http://.......
2020-08-28 13:05:32.937 T:139779184842496  NOTICE: [xbmcswift2] Request for "/record_one_time/Blonde" matches rule for function "record_one_time"
2020-08-28 13:05:47.846 T:139779184842496 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2020-08-28 13:05:47.918 T:139780239124224 WARNING: Previous line repeats 18 times.
2020-08-28 13:05:47.918 T:139780239124224 WARNING: CPythonInvoker(18): Script invoked without an addon. Adding all addon modules installed to python path as fallback. This behaviour will be removed in future version.
2020-08-28 13:07:32.412 T:139779903579904  NOTICE: AddOnLog: PVR IPTV Simple Client: LoadEPG EPG Loaded - 23 (ms)
2020-08-28 13:07:55.573 T:139781522585344 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2020-08-28 13:07:55.586 T:139781522585344  NOTICE: [xbmcswift2] Request for "/play_channel/Blonde" matches rule for function "play_channel"
2020-08-28 13:07:55.586 T:139781522585344 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2020-08-28 13:07:55.606 T:139781828340416  NOTICE: VideoPlayer::OpenFile: #EXTVLCOPT:network-caching=2000
2020-08-28 13:07:55.607 T:139779064702720  NOTICE: Creating InputStream
2020-08-28 13:07:55.607 T:139779064702720   ERROR: CVideoPlayer::OpenInputStream - error opening [#EXTVLCOPT:network-caching=2000]
2020-08-28 13:07:55.607 T:139779064702720  NOTICE: CVideoPlayer::OnExit()
2020-08-28 13:07:55.712 T:139781828340416  NOTICE: CVideoPlayer::CloseFile()

error recording live tv (coreelec 9.2.5 - Kodi 18 - French)

Hello,

First thank you for this awesome dev.

Sorry but I have this issue : recording of live tv is not possible.
I use : Beelink GT1 Ultimate with Coreelec 9.2.5.
Kodi plugins : IPTV Simple, IPTV recorder, Cathup-and-more.
ffmpeg is from coreelec ffmpeg tools package.

I tried to install/uninstall a few times.
I looked into the web for existing solution but unfortunately had no real solution.
Tried some of them with no chance...

This is part of kodi.log 👍
2021-01-21 13:13:08.808 T:3710931776 NOTICE: AddOnLog: PVR IPTV Simple Client: LoadPlayList PlayList Loaded - 13 (ms)
2021-01-21 13:13:08.808 T:3710931776 NOTICE: AddOnLog: PVR IPTV Simple Client: Loaded 111 channels.
2021-01-21 13:13:08.812 T:3710931776 NOTICE: PVR Manager: Starting
2021-01-21 13:13:08.854 T:3603657536 NOTICE: PVR Manager: Started
2021-01-21 13:13:08.948 T:3903898432 NOTICE: EPG thread started
2021-01-21 13:13:12.396 T:3595264832 NOTICE: AddOnLog: PVR IPTV Simple Client: LoadEPG EPG Loaded - 2442 (ms)
2021-01-21 13:13:30.670 T:3586872128 NOTICE: [xbmcswift2] Request for "/full_service" matches rule for function "full_service"
2021-01-21 13:13:32.330 T:3586872128 ERROR: {'confidence': 0.98999999999999999, 'language': '', 'encoding': 'utf-8'}
2021-01-21 13:13:38.740 T:3620279104 NOTICE: [xbmcswift2] Request for "/" matches rule for function "index"
2021-01-21 13:15:02.561 T:4087390224 NOTICE: Previous line repeats 1 times.
2021-01-21 13:15:02.561 T:4087390224 NOTICE: NFS is idle. Closing the remaining connections.
2021-01-21 13:24:54.158 T:3881911104 NOTICE: [xbmcswift2] Request for "/groups" matches rule for function "groups"
2021-01-21 13:24:58.443 T:3903898432 NOTICE: [xbmcswift2] Request for "/group/France+TNT" matches rule for function "group"
2021-01-21 13:25:06.651 T:3881911104 NOTICE: [xbmcswift2] Request for "/channel/C192.api.telerama.fr/TF1" matches rule for function "channel"
2021-01-21 13:25:06.730 T:4087390224 WARNING: CGUIMediaWindow::OnMessage - updating in progress
2021-01-21 13:25:12.839 T:3903898432 NOTICE: [xbmcswift2] Request for "/broadcast/10299/TF1" matches rule for function "broadcast"
2021-01-21 13:25:16.956 T:3620279104 NOTICE: [xbmcswift2] Request for "/record_once/10299/C192.api.telerama.fr/TF1" matches rule for function "record_once"
2021-01-21 13:25:16.958 T:3903898432 ERROR: GetDirectory - Error getting plugin://plugin.video.iptv.recorder/record_once/10299/C192.api.telerama.fr/TF1
2021-01-21 13:25:16.963 T:4087390224 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.iptv.recorder/record_once/10299/C192.api.telerama.fr/TF1) failed

This what is generated by plugin in userdata.../jobs :

-- coding: utf-8 --

from future import unicode_literals
import os, subprocess, time, io
from kodi_six import xbmc,xbmcvfs,xbmcgui
xbmcgui.Dialog().notification("Recording: TF1", "Journal", sound=True)
cmd = [u'/storage/.kodi/addons/tools.ffmpeg-tools/bin/ffmpeg', u'-i', u'plugin://plugin.video.catchuptvandmore/resources/lib/channels/fr/mytf1/get_live_url/?item_id=tf1', u'-y', u'-t', '1686', u'-fflags', u'+genpts', u'-vcodec', u'copy', u'-acodec', u'copy', u'-reconnect_at_eof', u'1', u'-reconnect_streamed', u'1', u'-reconnect_delay_max', u'300', u'/storage/.kodi/temp/TV/Other/Journal/Journal - TF1 - 2021-01-21 13-00.ts']
player = xbmc.Player()
player.play('plugin://plugin.video.catchuptvandmore/resources/lib/channels/fr/mytf1/get_live_url/?item_id=tf1')
new_url = ''
for _ in range(60):
time.sleep(1)
if player.isPlaying():
new_url = player.getPlayingFile()
break
time.sleep(1)
player.stop()
time.sleep(1)
if new_url:
cmd[2] = new_url
p = subprocess.Popen(cmd, shell=False)
f = xbmcvfs.File('special://profile/addon_data/plugin.video.iptv.recorder/jobs/fcc4c800-5be1-11eb-949c-96cad82c4604.py.pid', 'w')
f.write(bytearray(repr(p.pid).encode('utf-8')))
f.close()
p.wait()
xbmcgui.Dialog().notification("Recording finished: TF1", "Journal", sound=True)

Any idea ?
Do I have to provide additional logs ?
Thank's in advance !

Post command is never executed

Any simple post command set in the plugin settings page is never executed. I have tested a simple bash script on LibreElec and a simple batch script on windows each only creating a basic file. It seems that the ffmpeg process is never stopped thus the infinite loop in the created job py-file is never exited properly and the post command therefore never executed.

Systems tested:

Windows 10
  • Windows 10 (1809)
  • Kodi 18.1 (Git: 20190217-8cfdc895f3)
  • IPTV-Recorder Plugin: 0.0.122
LibreELEC
  • LibreELEC Offical 9.0.1 (Kernel 4.19.23)
  • Kodi (18.1 newclock5_18.1-LEIA) Compile Date: 21.02.19
  • IPTV-Recorder Plugin: 0.0.122

Error Plugin - Ubuntu18 Kodi18

Can you help with this error I can see in kodi.log
NOTICE: [xbmcswift2] Request for "/record_once/170635/blah/blah" matches rule for function "record_once"
08:59:21.017 T:140090508642048 ERROR: GetDirectory - Error getting plugin://plugin.video.iptv.recorder/record_once/170635/blah/blah

The detection of the encoding in XML TV file takes ages

I ran into an issue when using this add-on with a huge XML TV file: 207902 lines!

The regex at main.py@2927 didn't detect the encoding at the top of the file because the value was enclosed in single quotes instead of double quotes. Then it fell back to using chardet.detect() which basically never ended on my device (keep on displaying Copying xmltv file for several minutes on my Raspberry PI 3).

issue with spaces in m3u list without tvg-id

I have m3u list generated by some plugin with channel names only like this:

#EXTM3U
#EXTINF:-1,TVP 1 HD
plugin://plugin.video.pilot.wp?action=PLAY&channel=3
#EXTINF:-1,TVP 2 HD
plugin://plugin.video.pilot.wp?action=PLAY&channel=5
#EXTINF:-1,Polsat
plugin://plugin.video.pilot.wp?action=PLAY&channel=9

The names are correct and match the id and display name in xmltv file:

...<?xml version="1.0" encoding="UTF-8"?>
<tv generator-info-name="WebGrab+Plus/w MDB &amp; REX Postprocess -- version V2.1.5 -- Jan van Straaten" generator-info-url="http://www.webgrabplus.com">
  <channel id="TVP 1 HD">
    <display-name lang="pl">TVP 1 HD</display-name>
    <icon src="https://i.iplsc.com/-/0004NCS70UBYWOOF-C120.jpg" />
    <url>http://www.programtv.interia.pl</url>
  </channel>
  <channel id="TVP 2 HD">
    <display-name lang="pl">TVP 2 HD</display-name>
    <icon src="https://i.iplsc.com/-/0004NCS92YQSRH44-C120.jpg" />
    <url>http://www.programtv.interia.pl</url>
  </channel>
  <channel id="Polsat">
    <display-name lang="pl">Polsat</display-name>
    <icon src="https://i.iplsc.com/-/0001AEVS25LL77FJ-C120.jpg" />
    <url>http://www.programtv.interia.pl</url>
  </channel>

After the import only the channels without space show program and can record it. For other channels it shows error that channel was not found.

When I run sql command to show all the streams I see only tvg-id assigned in channels that have no space:

sqlite> SELECT * FROM streams LIMIT 3;
1|TVP+1+HD|TVP+1+HD||||plugin://plugin.video.pilot.wp?action=PLAY&channel=3
2|TVP+2+HD|TVP+2+HD||||plugin://plugin.video.pilot.wp?action=PLAY&channel=5
3|Polsat|Polsat|Polsat|||plugin://plugin.video.pilot.wp?action=PLAY&channel=9

I think the problem is when it tries to find missing streams and update them from channel names. It doesn't find any match as the stream tvg_name is escaped and channel names are not. I'm not sure what the best solution would be, maybe try search first with escaped name and if there is not match try to unescape the string and search again?

The cause of it is somewhere around the lines below, where it escapes the name and assigns it to tvg_name if that tag doesn't exist:

                name = channel[0].rsplit(',', 1)[-1].strip()                                 
                name = name.encode("utf8")                                                                                            
                name = urllib.quote_plus(name)                                                                                        
                                                                                                                                      
                tvg_name = re.search('tvg-name="(.*?)"', channel[0])                                                                  
                if tvg_name:                                                                                                          
                    tvg_name = tvg_name.group(1)                                                                                      
                else:                                                                                      
                    tvg_name = name

IPTV Recorder buttons missing

Hi @primaeval

Awesome job you are doing here! ^^

I am facing a issue with two exact, clean and equal Kodi installations with only two Addons installed additionally by me.

So, on one installation the record buttons appear on the EPG, on the other they don't. Check this image:
image
So, as you can see, these buttons appear on one Kodi on one PC, and on the other one they are missing. Same config AFAIK. The rest is working.

PS: Do you know a addon, or is it possible to add in the future something like instant recording where the program is always being recorder for a few minutes (120min e.g.) and you can pull the live transmission back and forward? Something like we already have on YouTube, but the recording is done locally.

Thanks and keep up with the good work.

Not recording - error: Attempt to use invalid handle -1

Hi,

LibreELEC version 9.2.7
Kodi version 18.9.0
IPTV Recorder version 0.0131
xbmcswift2 version 2.4.0
ffmpeg version 9.2.0.111
ffmpeg binary location: /storage/.kodi/addons/tools.ffmpeg-tools/bin/ffmpeg

I can play the stream without any issues:

2021-06-27 20:40:02.304 T:1229185792 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2021-06-27 20:40:17.728 T:1819116288 WARNING: Previous line repeats 120 times.
2021-06-27 20:40:17.728 T:1819116288  NOTICE: [xbmcswift2] Request for "/play_channel/Duna+World+%2F+M4+Sport%2B" matches rule for function "play_channel"
2021-06-27 20:40:17.732 T:1819116288 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2021-06-27 20:40:24.177 T:1936595456  NOTICE: VideoPlayer::OpenFile: https://c402-node61-cdn.connectmedia.hu/1103/dec354a754a87b99ca97aa65f40ade50/60d91a76/02.m3u8
2021-06-27 20:40:24.307 T:1819116288  NOTICE: Creating InputStream
2021-06-27 20:40:25.042 T:1819116288  NOTICE: Creating Demuxer
2021-06-27 20:40:28.686 T:1819116288  NOTICE: Opening stream: 0 source: 256
2021-06-27 20:40:28.686 T:1819116288  NOTICE: Creating video codec with codec id: 27
2021-06-27 20:40:28.700 T:1819116288  NOTICE: Creating video thread
2021-06-27 20:40:28.700 T:1200337664  NOTICE: running thread: video_thread
2021-06-27 20:40:28.794 T:1819116288  NOTICE: Opening stream: 1 source: 256
2021-06-27 20:40:28.794 T:1819116288  NOTICE: Finding audio codec for: 86018
2021-06-27 20:40:28.795 T:1819116288  NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac
2021-06-27 20:40:28.796 T:1819116288  NOTICE: Creating audio thread
2021-06-27 20:40:28.796 T:1175159552  NOTICE: running thread: CVideoPlayerAudio::Process()
2021-06-27 20:40:28.797 T:1175159552  NOTICE: Creating audio stream (codec id: 86018, channels: 2, sample rate: 48000, no pass-through)

However, RECORD AND PLAY fails with this:

2021-06-27 20:41:31.820 T:1743475456 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2021-06-27 20:41:31.957 T:1743475456  NOTICE: [xbmcswift2] Request for "/record_and_play/Duna+World+%2F+M4+Sport%2B" matches rule for function "record_and_play"
2021-06-27 20:42:02.505 T:1804804864 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2021-06-27 20:42:07.584 T:1743475456 WARNING: Previous line repeats 122 times.
2021-06-27 20:42:07.584 T:1743475456 WARNING: Attempt to use invalid handle -1
2021-06-27 20:42:07.586 T:1743475456 WARNING: Previous line repeats 2 times.
2021-06-27 20:42:07.586 T:1743475456 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value

FFMPEG runs fine from command line:

 ffmpeg -i https://c201-node61-cdn.connectmedia.hu/1103/fd2ecf53a45508a6da29121f2676d9e9/60d90fde/02.m3u8 -y -t 10 -fflags +genpts -vcodec copy -acodec copy -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 300
-f mpegts /tmp/test.ts
ffmpeg version 4.2.4 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8.3.0 (GCC)
  configuration: --enable-ffmpeg --disable-ffplay --enable-ffprobe --enable-static --disable-shared --enable-gpl --disable-doc --enable-omx-rpi --enable-mmal --enable-encoder=h264_omx --enable-hwaccel=h264_mmal --enable-hwaccel=mpeg2_mmal --enable-hwaccel=mpeg4_mmal --enable-hwaccel=vc1_mmal --enable-avresample --disable-lzma --disable-alsa --arch=arm --cpu=cortex-a7 --cross-prefix=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi- --enable-cross-compile --sysroot=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot --sysinclude=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include --target-os=linux --nm=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-nm --ar=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-ar --as=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc --cc=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc --ld=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc --pkg-config=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/pkg-config --host-cc=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/host-gcc --host-cflags='-march=native -O2 -Wall -pipe -I/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/include -Wno-format-security' --host-ldflags='-Wl,-rpath,/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/lib -L/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/lib' --host-extralibs=-lm --extra-cflags='-march=armv7ve -mtune=cortex-a7 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -I/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/gnutls-3.6.14/.INSTALL_PKG/usr/include -DRPI=1 -I/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/IL' --extra-ldflags='-march=armv7ve -mtune=cortex-a7 -Wl,--as-needed -L/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/gnutls-3.6.14/.INSTALL_PKG/usr/lib' --extra-libs='-lbcm_host -ldl -lmmal -lmmal_core -lmmal_util -lvchiq_arm -lvcos -lvcsm' --enable-pic --enable-gnutls --disable-openssl --disable-hardcoded-tables
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[hls @ 0x2ab63f0] Skip ('#EXT-X-VERSION:3')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:08:41Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:08:49Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:08:57Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:05Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:13Z')
[hls @ 0x2ab63f0] Opening 'https://c201-node61-cdn.connectmedia.hu/1103/fd2ecf53a45508a6da29121f2676d9e9/60d90fde/20210624T105545-02-22726977.ts' for reading
[hls @ 0x2ab63f0] Opening 'https://c201-node61-cdn.connectmedia.hu/1103/fd2ecf53a45508a6da29121f2676d9e9/60d90fde/20210624T105545-02-22726978.ts' for reading
[h264 @ 0x2ac4f30] Increasing reorder buffer to 2
Input #0, hls, from 'https://c201-node61-cdn.connectmedia.hu/1103/fd2ecf53a45508a6da29121f2676d9e9/60d90fde/02.m3u8':
  Duration: N/A, start: 5073.377800, bitrate: N/A
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
Output #0, mpegts, to '/tmp/test.ts':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hls @ 0x2ab63f0] Skip ('#EXT-X-VERSION:3')time=00:00:06.16 bitrate=3061.4kbits/s speed=0.41x
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:08:57Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:05Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:13Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:21Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:29Z')
[hls @ 0x2ab63f0] Opening 'https://c201-node61-cdn.connectmedia.hu/1103/fd2ecf53a45508a6da29121f2676d9e9/60d90fde/20210624T105545-02-22726979.ts' for reading
frame=  252 fps= 12 q=-1.0 Lsize=    3917kB time=00:00:09.98 bitrate=3213.8kbits/s speed=0.476x
video:3439kB audio:160kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.828273%

Any idea what could be wrong?

Thanks.

Stuck on Unzipping xmltv file

Pointed to the ffmpeg exe in settings. IPTV Simple enabled and working. Stuck on Unzipping xmltv file. When i go channel groups->all there is nothing there.

Weekly and daily recordings always set one hour ahead

Setting a recording for once and always record from the epg works every time but when I try to set a weekly or daily recording it sets it one hour ahead and of course doesn't record because the wrong time for the program gets set. Works from the context menu but not the epg.

Error parsing dates

Hi there

Each time I try to program a record with IPTV Recorder (Kodi Leila and PVR IPTV Simple Client), I've got this message : "Error parsing dates" or "Addon error**".

Is it a problem with the EPG ? or with IPTV Recorder ?
IPTV recorder suggest me to look at the log file and it says : (line 330)
kodi.old (Error parsing date Line 330).log

ERROR: "IPTV Recorder: Error parsing dates (time data 'Lundi 11 novembre 2019, 9:05' does not match format '%A %d %B %Y, %H:%M')". -> The "0" is missing in "%H". How to solve this problem ?

Thank you for your help !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.