# Path: resources/lib/constants.py
# ADDON_ID = 'plugin.video.stream-cinema'
# 
# PY2 = python_version == 2
# 
# class SC:
#     ACTION = 'action'
#     ACTION_ADD2HP = 'add2hp'
#     ACTION_ADD_CUSTOM_FILTER = 'add_custom_filter'
#     ACTION_ADD_TO_LIBRARY = 'add_to_library'
#     ACTION_ADD_TO_LIBRARY_WITH_SUBSCRIPTION = 'add_to_library_sub'
#     ACTION_ANDROID = 'android'
#     ACTION_BUFFER = 'buffer'
#     ACTION_CMD = 'cmd'
#     ACTION_CSEARCH = 'csearch'
#     ACTION_DEBUG = 'debug'
#     ACTION_DEL2HP = 'del2hp'
#     ACTION_DEL_CUSTOM_FILTER = 'del_custom_filter'
#     ACTION_DEL_PREFERRED_LANGUAGE = 'sel_preferred_language'
#     ACTION_DOWNLOAD = 'down'
#     ACTION_LAST = 'last'
#     ACTION_PIN = 'pin'
#     ACTION_PLAY_URL = 'playUrl'
#     ACTION_REMOVE_FROM_LIST = 'remove_from_list'
#     ACTION_REMOVE_FROM_SUBSCRIPTION = 'remove_from_sub'
#     ACTION_SELECT_STREAM = 'selectStream'
#     ACTION_SET_PREFERRED_LANGUAGE = 'set_preferred_language'
#     ACTION_UPDATE_ADDON = 'update_addon'
#     CMD = 'cmd'
#     DEFAULT_LANG = 'cs'
#     ITEM_ACTION = 'action'
#     ITEM_ART = 'art'
#     ITEM_AUDIO_INFO = 'ainfo'
#     ITEM_BITRATE = 'bitrate'
#     ITEM_CMD = 'cmd'
#     ITEM_CUSTOM_FILTER = 'custom'
#     ITEM_DIR = 'dir'
#     ITEM_DOWNLOAD = 'down'
#     ITEM_FOCUS = 'focus'
#     ITEM_HPDIR = 'hpdir'
#     ITEM_I18N_ART = 'i18n_art'
#     ITEM_I18N_INFO = 'i18n_info'
#     ITEM_ID = 'id'
#     ITEM_IDENT = 'ident'
#     ITEM_INFO = 'info'
#     ITEM_LIBRARY = 'library'
#     ITEM_LIBRARY_SUB = 'library_sub'
#     ITEM_LANG = 'lang'
#     ITEM_MENU = 'menu'
#     ITEM_NEXT = 'next'
#     ITEM_PAGE = 'page'
#     ITEM_PREFERRED_LANG = 'pref_lang.{}'
#     ITEM_PROVIDER = 'provider'
#     ITEM_QUALITY = 'quality'
#     ITEM_SIZE = 'size'
#     ITEM_STRMS = 'strms'
#     ITEM_SUBS = 'subs'
#     ITEM_SYSTEM = 'system'
#     ITEM_TITLE = 'title'
#     ITEM_TYPE = 'type'
#     ITEM_URL = 'url'
#     ITEM_UIDS = 'unique_ids'
#     ITEM_VIDEO = 'video'
#     ITEM_VIDEO_INFO = 'vinfo'
#     ITEM_VISIBLE = 'visible'
#     ITEM_WIDGET = 'widget'
#     MEDIA_TYPE = 'mediatype'
#     MEDIA_TYPE_AUDIO = 'audio'
#     MEDIA_TYPE_EPISODE = 'episode'
#     MEDIA_TYPE_FILE = 'file'
#     MEDIA_TYPE_SEASON = 'season'
#     MEDIA_TYPE_TV_SHOW = 'tvshow'
#     MEDIA_TYPE_VIDEO = 'video'
#     NEXT = 'next'
#     PROVIDER = 'kraska'
#     RUN_PLUGIN = 'RunPlugin({})'
#     TXT_PINNED = 'p-{}'
#     TXT_CUSTOM_FORMAT = 'custom-{}'
#     TRAKT_CACHE_WATCHET_ACTIVITY = 'SC:watched:activity'
# 
# Path: resources/lib/common/logger.py
# def debug(text):
#     xbmc.log('[{}] {}'.format(APP, text), xbmc.LOGDEBUG)
# 
# def info(text):
#     xbmc.log('[{}] {}'.format(APP, text), xbmc.LOGINFO)


import json
import math
import os
import sys
import time
import traceback
import xbmc
import xbmcaddon
import xbmcvfs
        import winreg
            import subprocess
    import subprocess
        import traceback
    import subprocess
    import re
    import subprocess
    import plistlib
    import re
    import uuid
            import binascii
    from urllib.parse import urlparse, urlencode, parse_qs
    from urlparse import urlparse, parse_qs
    from urllib import urlencode
from base64 import b64encode
from resources.lib.constants import ADDON_ID, PY2, SC
from resources.lib.common.logger import debug, info
    from json import dumps, loads
        from resources.lib.system import SYSTEM_VERSION
    from resources.lib.system import SYSTEM_VERSION
    from resources.lib.system import SYSTEM_VERSION
    from resources.lib.common.storage import KodiAddonsDb
    from resources.lib.gui.dialog import dprogressgb
    from resources.lib.system import Http
    from resources.lib.services.Monitor import monitor
    from resources.lib.system import Http
    from resources.lib.api.sc import Sc
    from resources.lib.system import Http
        from resources.lib.common.storage import TexturesDb
        from resources.lib.gui.dialog import dok
        from resources.lib.language import Strings
    from resources.lib.gui.dialog import dnotify, dselect
    from resources.lib.system import user_agent, Http
            from sys import platform as sys_platform
    from sys import platform as sys_platform
            from subprocess import check_call
            from subprocess import check_call
            from subprocess import Popen, PIPE
from __future__ import print_function, unicode_literals


try:
except ImportError:



addon = xbmcaddon.Addon(id=ADDON_ID)


def encode(s, encoding='utf-8', errors='strict'):
    if PY2 and isinstance(s, unicode):
        s = s.encode(encoding, errors)
    return s


def decode(s, encoding='utf-8', errors='strict'):

# Path: resources/lib/constants.py
# ADDON_ID = 'plugin.video.stream-cinema'
# 
# PY2 = python_version == 2
# 
# class SC:
#     ACTION = 'action'
#     ACTION_ADD2HP = 'add2hp'
#     ACTION_ADD_CUSTOM_FILTER = 'add_custom_filter'
#     ACTION_ADD_TO_LIBRARY = 'add_to_library'
#     ACTION_ADD_TO_LIBRARY_WITH_SUBSCRIPTION = 'add_to_library_sub'
#     ACTION_ANDROID = 'android'
#     ACTION_BUFFER = 'buffer'
#     ACTION_CMD = 'cmd'
#     ACTION_CSEARCH = 'csearch'
#     ACTION_DEBUG = 'debug'
#     ACTION_DEL2HP = 'del2hp'
#     ACTION_DEL_CUSTOM_FILTER = 'del_custom_filter'
#     ACTION_DEL_PREFERRED_LANGUAGE = 'sel_preferred_language'
#     ACTION_DOWNLOAD = 'down'
#     ACTION_LAST = 'last'
#     ACTION_PIN = 'pin'
#     ACTION_PLAY_URL = 'playUrl'
#     ACTION_REMOVE_FROM_LIST = 'remove_from_list'
#     ACTION_REMOVE_FROM_SUBSCRIPTION = 'remove_from_sub'
#     ACTION_SELECT_STREAM = 'selectStream'
#     ACTION_SET_PREFERRED_LANGUAGE = 'set_preferred_language'
#     ACTION_UPDATE_ADDON = 'update_addon'
#     CMD = 'cmd'
#     DEFAULT_LANG = 'cs'
#     ITEM_ACTION = 'action'
#     ITEM_ART = 'art'
#     ITEM_AUDIO_INFO = 'ainfo'
#     ITEM_BITRATE = 'bitrate'
#     ITEM_CMD = 'cmd'
#     ITEM_CUSTOM_FILTER = 'custom'
#     ITEM_DIR = 'dir'
#     ITEM_DOWNLOAD = 'down'
#     ITEM_FOCUS = 'focus'
#     ITEM_HPDIR = 'hpdir'
#     ITEM_I18N_ART = 'i18n_art'
#     ITEM_I18N_INFO = 'i18n_info'
#     ITEM_ID = 'id'
#     ITEM_IDENT = 'ident'
#     ITEM_INFO = 'info'
#     ITEM_LIBRARY = 'library'
#     ITEM_LIBRARY_SUB = 'library_sub'
#     ITEM_LANG = 'lang'
#     ITEM_MENU = 'menu'
#     ITEM_NEXT = 'next'
#     ITEM_PAGE = 'page'
#     ITEM_PREFERRED_LANG = 'pref_lang.{}'
#     ITEM_PROVIDER = 'provider'
#     ITEM_QUALITY = 'quality'
#     ITEM_SIZE = 'size'
#     ITEM_STRMS = 'strms'
#     ITEM_SUBS = 'subs'
#     ITEM_SYSTEM = 'system'
#     ITEM_TITLE = 'title'
#     ITEM_TYPE = 'type'
#     ITEM_URL = 'url'
#     ITEM_UIDS = 'unique_ids'
#     ITEM_VIDEO = 'video'
#     ITEM_VIDEO_INFO = 'vinfo'
#     ITEM_VISIBLE = 'visible'
#     ITEM_WIDGET = 'widget'
#     MEDIA_TYPE = 'mediatype'
#     MEDIA_TYPE_AUDIO = 'audio'
#     MEDIA_TYPE_EPISODE = 'episode'
#     MEDIA_TYPE_FILE = 'file'
#     MEDIA_TYPE_SEASON = 'season'
#     MEDIA_TYPE_TV_SHOW = 'tvshow'
#     MEDIA_TYPE_VIDEO = 'video'
#     NEXT = 'next'
#     PROVIDER = 'kraska'
#     RUN_PLUGIN = 'RunPlugin({})'
#     TXT_PINNED = 'p-{}'
#     TXT_CUSTOM_FORMAT = 'custom-{}'
#     TRAKT_CACHE_WATCHET_ACTIVITY = 'SC:watched:activity'
# 
# Path: resources/lib/common/logger.py
# def debug(text):
#     xbmc.log('[{}] {}'.format(APP, text), xbmc.LOGDEBUG)
# 
# def info(text):
#     xbmc.log('[{}] {}'.format(APP, text), xbmc.LOGINFO)


# Path: resources/lib/kodiutils.py
import json
import math
import os
import sys
import time
import traceback
import xbmc
import xbmcaddon
import xbmcvfs
        import winreg
            import subprocess
    import subprocess
        import traceback
    import subprocess
    import re
    import subprocess
    import plistlib
    import re
    import uuid
            import binascii
    from urllib.parse import urlparse, urlencode, parse_qs
    from urlparse import urlparse, parse_qs
    from urllib import urlencode
from base64 import b64encode
from resources.lib.constants import ADDON_ID, PY2, SC
from resources.lib.common.logger import debug, info
    from json import dumps, loads
        from resources.lib.system import SYSTEM_VERSION
    from resources.lib.system import SYSTEM_VERSION
    from resources.lib.system import SYSTEM_VERSION
    from resources.lib.common.storage import KodiAddonsDb
    from resources.lib.gui.dialog import dprogressgb
    from resources.lib.system import Http
    from resources.lib.services.Monitor import monitor
    from resources.lib.system import Http
    from resources.lib.api.sc import Sc
    from resources.lib.system import Http
        from resources.lib.common.storage import TexturesDb
        from resources.lib.gui.dialog import dok
        from resources.lib.language import Strings
    from resources.lib.gui.dialog import dnotify, dselect
    from resources.lib.system import user_agent, Http
            from sys import platform as sys_platform
    from sys import platform as sys_platform
            from subprocess import check_call
            from subprocess import check_call
            from subprocess import Popen, PIPE

from __future__ import print_function, unicode_literals


try:
except ImportError:



addon = xbmcaddon.Addon(id=ADDON_ID)


def encode(s, encoding='utf-8', errors='strict'):
    if PY2 and isinstance(s, unicode):
        s = s.encode(encoding, errors)
    return s


def decode(s, encoding='utf-8', errors='strict'):

    if PY2 and isinstance(s, str):