0

我最近开始学习如何制作 xbmc/kodi 插件。我正在尝试创建多个目录,但是当我单击视频部分的插件图标时,不断收到“错误:脚本失败:”。

谁能帮我修复这个错误并创建多个目录,以便我以后可以用数据填充它们?我进行了很多搜索以找到有关如何制作目录的初学者教程,但找不到。提前致谢。

    import urllib, urllib2, sys, re, os, unicodedata
    import xbmc, xbmcgui, xbmcplugin, xbmcaddon, base64

    plugin_handle = int(sys.argv[1])



    def CATEGORIES():
          add_dir("search",url,1,"")
          add_dir( "AnimalS",url,1,"")
          add_dir( "cars",url,1,"")
          add_dir("Fruits",url,1,"")


    url = None
    name = None
    mode = None
    iconimage = None

    if mode==None or url==None or len(url)<1:
            print ""
            CATEGORIES()

xbmcplugin.endOfDirectory(plugin_handle)

xbmc.log 上的错误:

ERROR: EXCEPTION Thrown (PythonToCppException) : 
-->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.IndentationError'>
Error Contents: ('unindent does not match any outer indentation level', ('C:\\.....addons\\plugin.video.populateDirectory\\addon.py', 12, 32, '     add_dir("Fruits",url,1,"")\n'))
IndentationError: ('unindent does not match any outer indentation level', ('C:\\....\\addons\\plugin.video.populateDirectory\\addon.py', 12, 32, '     add_dir("Fruits",url,1,"")\n'))
-->End of Python script error report<--
ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.test/
ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.test/) failed
NOTICE: Thread BackgroundLoader start, auto delete: false
4

0 回答 0