Req Broken Script after update to Kodi 20 - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +---- Forum: Python 3 migration (https://forum.kodi.tv/forumdisplay.php?fid=281) +---- Thread: Req Broken Script after update to Kodi 20 (/showthread.php?tid=374958) |
Broken Script after update to Kodi 20 - joa23 - 2023-11-05 Hello, After an update to Kodi 20 from Kodi 18, my autoexec script no longer works properly. Here is the script: import os import xbmc import random import math class XBMCPlayer(xbmc.Player): def __init__(self): xbmc.Player.__init__(self) def onAVStarted(self): if xbmc.Player().isPlayingVideo(): total_time = int(math.fabs(xbmc.Player().getTotalTime())) xbmc.Player().seekTime(random.randint(0, total_time)) Player = XBMCPlayer() videoList = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) videoList.clear() videoList.load("http://192.168.178.88/playlist.m3u") # Enable playlist shuffle if needed # videoList.shuffle() xbmc.executebuiltin("xbmc.PlayerControl(RepeatAll)") xbmc.Player().play(videoList) while (not xbmc.abortRequested): xbmc.sleep(100) When starting the playlist is loaded and the video is played, however in version Kodi 18 the video jumped to a random time in the video. Unfortunately, I can't really get the auotexec addon to work under Python 3. I would appreciate some help. |