Example #1
0
    def send_request(self, url, path, method="get", timeout=None, headers=None, data=None):
        request_method = getattr(requests, method.lower())
        url = "%s/%s" % (url, path)
        request_settings = {
            "timeout": timeout or self.default_timeout,
            "headers": headers or self.get_default_headers(),
            "data": data
        }

        if not settings('sslverify'):
            request_settings["verify"] = False

        LOG.info("Sending %s request to %s" % (method, path))
        LOG.debug(request_settings['timeout'])
        LOG.debug(request_settings['headers'])

        return request_method(url, **request_settings)
Example #2
0
__base__ = xbmc.translatePath(
    os.path.join(__addon__.getAddonInfo('path'),
                 'jellyfin_kodi')).decode('utf-8')

sys.path.insert(0, __base__)

#################################################################################################

from entrypoint import Service  # noqa: F402
from helper.utils import settings  # noqa: F402

#################################################################################################

LOG = logging.getLogger("JELLYFIN.service")
DELAY = int(
    settings('startupDelay') if settings('SyncInstallRunDone.bool') else 4 or 0
)

#################################################################################################


class ServiceManager(threading.Thread):
    ''' Service thread.
        To allow to restart and reload modules internally.
    '''
    exception = None

    def __init__(self):
        threading.Thread.__init__(self)

    def run(self):
Example #3
0
__addon__ = xbmcaddon.Addon(id='plugin.video.jellyfin')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'jellyfin_kodi'))

sys.path.insert(0, __base__)

#################################################################################################

from entrypoint import Service  # noqa: E402
from helper.utils import settings  # noqa: E402
from helper import LazyLogger  # noqa: E402

#################################################################################################

LOG = LazyLogger(__name__)
DELAY = int(settings('startupDelay') if settings('SyncInstallRunDone.bool') else 4)

#################################################################################################


class ServiceManager(threading.Thread):

    ''' Service thread.
        To allow to restart and reload modules internally.
    '''
    exception = None

    def __init__(self):
        threading.Thread.__init__(self)

    def run(self):