Kodi plugin to to play various online streams (mostly Latvian)

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. import os,os.path,sys, urllib, traceback
  3. from kodiswift import Plugin, ListItem, storage
  4. from kodiswift import xbmc, xbmcgui, xbmcplugin, xbmcvfs, CLI_MODE
  5. #from resources.lib import ContentSources, util
  6. #sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)),"resources","lib","sources"))
  7. from resources.lib.content import playstreamproxy
  8. #monitor = xbmc.Monitor()
  9. plugin = Plugin()
  10. plugin.load_addon_settings()
  11. port = plugin.get_setting("general_port",int)
  12. start_proxy = plugin.get_setting("general_proxy",bool)
  13. host = "localhost"
  14. if start_proxy:
  15. plugin.notify("Starting playstreamproxy","Info",10000, xbmcgui.NOTIFICATION_INFO)
  16. try:
  17. playstreamproxy.start(host, port)
  18. except Exception as e:
  19. xbmcgui.Dialog().ok("Error starting playstreamproxyserver",unicode(e))
  20. #plugin.notify(unicode(e), "Error", 10000, xbmcgui.NOTIFICATION_ERROR)
  21. traceback.print_exc()