Hi,
I want to use this module, but I'm having a problem.
Code:
# -*- coding: utf-8 -*-
#
from __future__ import unicode_literals
import xbmcgui, xbmcplugin
import socket, pickle, struct
from simpleplugin import Plugin, debug_exception
plugin = Plugin()
# Free video sample is provided by www.vidsplay.com
@plugin.action()
def root():
"""
Root virtual folder
This action is mandatory.
"""
plugin.log_debug("Got till here...")
my_dict = {"path" : xbmc.getInfoLabel('ListItem.Path').decode("utf-8"), "filename" : xbmc.getInfoLabel('ListItem.FileName').decode("utf-8")}
plugin.log_debug("my_dict = %s" % my_dict)
if my_dict["path"] != "":
s = socket.socket()
host = 'localhost' # needs to be in quote
port = 1247
s.connect((host, port))
data = pickle.dumps(my_dict)
datasize = len(data)
s.send(struct.pack("<i", datasize))
s.send(data)
s.close()
else:
# We didn't get Listitem infolabels, abort
error_dialog = xbmcgui.Dialog()
error_dialog.notification('Bluray Iso Utils', 'Failed to get ListItems info!', xbmcgui.NOTIFICATION_ERROR, 5000)
plugin.log_debug("And got till here...")
if __name__ == '__main__':
with debug_exception(plugin.log_debug):
plugin.run()
Above is the code I'm using. I get the following in the kodi.log:
Code:
03:05:50.185 T:6724 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: <Plugin ['plugin://script.service.bluray_iso_utils/', '1', '?hello world']>
03:05:50.185 T:6724 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: Actions: ['root']
03:05:50.185 T:6724 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: Called action "root" with params "<Params {}>"
03:05:50.185 T:6724 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: Got till here...
03:05:50.185 T:6724 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: my_dict = {u'path': u'F:\\Over_te_copieren\\_test_strm\\', u'filename': u'test1.strm'}
03:05:50.192 T:6724 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: And got till here...
03:05:50.192 T:6724 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: Action return value: None
03:05:50.192 T:6724 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: The action "root" has not returned any valid data to process.
03:05:50.193 T:6724 INFO: CPythonInvoker(4, C:\Users\Max Renn\AppData\Roaming\Kodi\addons\script.service.bluray_iso_utils\mytestscript.py): script successfully run
03:05:50.202 T:6724 INFO: Python script stopped
03:05:50.202 T:6724 DEBUG: Thread LanguageInvoker 6724 terminating
03:05:50.222 T:2196 DEBUG: ------ Window Init (DialogBusy.xml) ------
03:05:50.222 T:6660 DEBUG: Thread scriptobs 6660 terminating
03:05:50.222 T:2196 ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://script.service.bluray_iso_utils/?hello world]
03:05:50.222 T:2196 DEBUG: Keyboard: scancode: 0x1c, sym: 0x000d, unicode: 0x0000, modifier: 0x0
03:05:50.222 T:5328 DEBUG: Thread BackgroundLoader start, auto delete: false
03:05:50.225 T:2196 DEBUG: ------ Window Deinit (DialogBusy.xml) ------
03:05:50.226 T:2196 DEBUG: ------ Window Init (DialogNotification.xml) ------
03:05:50.229 T:5328 DEBUG: Thread BackgroundLoader 5328 terminating
03:05:51.093 T:2196 DEBUG: ------ Window Init (Pointer.xml) ------
03:05:51.744 T:7544 DEBUG: Version Check: Already notified one time for upgrading.
03:05:51.744 T:7544 INFO: CPythonInvoker(0, C:\Users\Max Renn\AppData\Roaming\Kodi\addons\service.xbmc.versioncheck\service.py): script successfully run
my_dict gets send to the server, so that works.
But I want to suppress the : ''Playlist" ' Can't find a next item to play' notification dialog.
How do I do this? I read the documentation (at:
http://romanvm.github.io/script.module.s.../misc.html ), but I'm a bit slow today because I can't get it to work...
Code:
# -*- coding: utf-8 -*-
#
from __future__ import unicode_literals
import xbmcgui, xbmcplugin
import socket, pickle, struct
from simpleplugin import Plugin, debug_exception
plugin = Plugin()
# Free video sample is provided by www.vidsplay.com
@plugin.action()
def root():
"""
Root virtual folder
This action is mandatory.
"""
plugin.log_debug("Got till here...")
return [{'is_folder': False, 'url': plugin.get_url(action='my_play')}]
@plugin.action()
def my_play():
my_dict = {"path" : xbmc.getInfoLabel('ListItem.Path').decode("utf-8"), "filename" : xbmc.getInfoLabel('ListItem.FileName').decode("utf-8")}
plugin.log_debug("my_dict = %s" % my_dict)
if my_dict["path"] != "":
s = socket.socket()
host = 'localhost' # needs to be in quote
port = 1247
s.connect((host, port))
data = pickle.dumps(my_dict)
datasize = len(data)
s.send(struct.pack("<i", datasize))
s.send(data)
s.close()
else:
# We didn't get Listitem infolabels, abort
error_dialog = xbmcgui.Dialog()
error_dialog.notification('Bluray Iso Utils', 'Failed to get ListItems info!', xbmcgui.NOTIFICATION_ERROR, 5000)
plugin.log_debug("And got till here...")
if __name__ == '__main__':
with debug_exception(plugin.log_debug):
plugin.run()
Here, I even never enter the my_play function. I'm getting this in kodi.log:
Code:
03:25:50.596 T:4212 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: <Plugin ['plugin://script.service.bluray_iso_utils/', '1', '?hello world']>
03:25:50.597 T:4212 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: Actions: ['my_play', 'root']
03:25:50.597 T:4212 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: Called action "root" with params "<Params {}>"
03:25:50.597 T:4212 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: Got till here...
03:25:50.598 T:4212 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: Action return value: [{u'url': 'plugin://script.service.bluray_iso_utils/?action=my_play', u'is_folder': False}]
03:25:50.598 T:4212 DEBUG: script.service.bluray_iso_utils [v.0.5.0]: Creating listing from ListContext(listing=[{u'url': 'plugin://script.service.bluray_iso_utils/?action=my_play', u'is_folder': False}], succeeded=True, update_listing=False, cache_to_disk=False, sort_methods=None, view_mode=None, content=None, category=None)
03:25:50.649 T:6860 DEBUG: ------ Window Init (DialogBusy.xml) ------
03:25:50.650 T:4212 INFO: CPythonInvoker(4, C:\Users\Max Renn\AppData\Roaming\Kodi\addons\script.service.bluray_iso_utils\mytestscript.py): script successfully run
03:25:50.665 T:4212 INFO: Python script stopped
03:25:50.665 T:4212 DEBUG: Thread LanguageInvoker 4212 terminating
03:25:50.666 T:6860 DEBUG: Loading settings for
03:25:50.666 T:6860 DEBUG: CPlayerCoreFactory::GetPlayers()
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: mms/udp
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
03:25:50.667 T:7332 DEBUG: Thread scriptobs 7332 terminating
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdimage
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
03:25:50.667 T:6860 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: radio
03:25:50.667 T:6860 DEBUG: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
03:25:50.667 T:6860 DEBUG: CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (VideoPlayer)
03:25:50.667 T:6860 DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=0
03:25:50.667 T:6860 DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
03:25:50.667 T:6860 DEBUG: CPlayerCoreFactory::GetPlayers: added 1 players
03:25:50.669 T:6860 DEBUG: Radio UECP (RDS) Processor - new CDVDRadioRDSData::CDVDRadioRDSData
03:25:50.669 T:6860 NOTICE: VideoPlayer: Opening:
03:25:50.669 T:6860 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
03:25:50.669 T:6860 ERROR: DXVA::CProcessorHD::IsFormatSupported: Unsupported format 104 for 1.
03:25:50.669 T:6860 ERROR: DXVA::CProcessorHD::IsFormatSupported: Unsupported format 105 for 1.
03:25:50.669 T:2160 DEBUG: Thread VideoPlayer start, auto delete: false
03:25:50.669 T:2160 NOTICE: Creating InputStream
03:25:50.669 T:2160 ERROR: CVideoPlayer::OpenInputStream - error opening []
03:25:50.669 T:2160 NOTICE: CVideoPlayer::OnExit()
03:25:50.669 T:2160 DEBUG: CApplication::OnPlayBackStopped: play state was 1, starting 1
03:25:50.669 T:2160 DEBUG: Thread VideoPlayer 2160 terminating
03:25:50.670 T:6860 DEBUG: CApplication::OnPlayBackStopped: play state was 3, starting 0
03:25:50.670 T:6860 ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://script.service.bluray_iso_utils/?hello world]
I'm probably missing some basic python thing, but what?
Help...