# Path: resources/lib/modules/util.py
# class struct(object):
#     def __init__(self, kdict=None):
#     def __repr__(self):
#     def __getattr__(self, name):
#     def __len__(self):
#     def get(self, key):
# def getMPAAFromCI(ci):
# def getBestBitrateUrl(plugin, streams):
# def merge_dicts(x, *argv):
# def slugify(string):
# def unescape(text):
#     def fixup(m):
# def time_format(time_str=None, input_format=None):
# def get_signed_hashes(a):
# def J(a):
# def K(a):
# def L():
# def M(a):
# def N():
# def O(a):
# def P(a):
# def get_utc_delta():
# def strptime(date_string, format):
# def strptime_workaround(date_string, format='%Y-%m-%dT%H:%M:%S'):
# def get_total_seconds(timedelta):
# def get_total_seconds_float(timedelta):
# def get_total_hours(timedelta):
# def add_url_parameters(url, params):
# def is_number(s):
# G = 3600
# H = "=0xAC10FD"
# 
# Path: resources/lib/modules/workers.py
# class Thread(threading.Thread):
# class Workers:
#     def __init__(self, target, *args):
#     def run(self):
#     def get_result(self):
#     def globaltrace(self, frame, event, arg):
#     def localtrace(self, frame, event, arg):
#     def kill(self):
#     def __init__(self, concurrent=30, queue_size=None, target=None, expect_result=True):
#         def _queue_worker():
#     def put(self, item):
#     def join(self):
#     def terminate(self):


import datetime
import requests
from resources.lib.modules import util
from resources.lib.modules import workers
                "id": result['id_midia_live_play'],
                "program_id": None,
                "live_poster": None,
                "thumbnail": result['channel']['url_snapshot'],
                "thumbnail_hd": result['channel']['url_snapshot'],
                "fanart": result['thumb_cms'],
                "color": result['channel']['color']
            })

        return schedule

    def _get_combate_schedule(self, schedule):
        globosat_schedule_url = "http://api.simulcast.globosat.tv/combate/?page=%s"
        headers = {
            "User-Agent": "GlobosatPlay/142 CFNetwork/811.4.18 Darwin/16.5.0",
            "Authorization": "Token 59150c4cc6a00f467bf225cf3bf8f44617e27037",
            "Accept-Encoding": "gzip, deflate"
        }

        page = 1
        response = requests.get(globosat_schedule_url % page, headers=headers).json()

        results = response['results']

        while response['next'] is not None:
            page += 1
            response = requests.get(globosat_schedule_url % page, headers=headers).json()
            results += response['results']

        for result in results:

# Path: resources/lib/modules/util.py
# class struct(object):
#     def __init__(self, kdict=None):
#     def __repr__(self):
#     def __getattr__(self, name):
#     def __len__(self):
#     def get(self, key):
# def getMPAAFromCI(ci):
# def getBestBitrateUrl(plugin, streams):
# def merge_dicts(x, *argv):
# def slugify(string):
# def unescape(text):
#     def fixup(m):
# def time_format(time_str=None, input_format=None):
# def get_signed_hashes(a):
# def J(a):
# def K(a):
# def L():
# def M(a):
# def N():
# def O(a):
# def P(a):
# def get_utc_delta():
# def strptime(date_string, format):
# def strptime_workaround(date_string, format='%Y-%m-%dT%H:%M:%S'):
# def get_total_seconds(timedelta):
# def get_total_seconds_float(timedelta):
# def get_total_hours(timedelta):
# def add_url_parameters(url, params):
# def is_number(s):
# G = 3600
# H = "=0xAC10FD"
# 
# Path: resources/lib/modules/workers.py
# class Thread(threading.Thread):
# class Workers:
#     def __init__(self, target, *args):
#     def run(self):
#     def get_result(self):
#     def globaltrace(self, frame, event, arg):
#     def localtrace(self, frame, event, arg):
#     def kill(self):
#     def __init__(self, concurrent=30, queue_size=None, target=None, expect_result=True):
#         def _queue_worker():
#     def put(self, item):
#     def join(self):
#     def terminate(self):


# Path: resources/lib/modules/globosat/schedule.py
import datetime
import requests
from resources.lib.modules import util
from resources.lib.modules import workers

                "id": result['id_midia_live_play'],
                "program_id": None,
                "live_poster": None,
                "thumbnail": result['channel']['url_snapshot'],
                "thumbnail_hd": result['channel']['url_snapshot'],
                "fanart": result['thumb_cms'],
                "color": result['channel']['color']
            })

        return schedule

    def _get_combate_schedule(self, schedule):
        globosat_schedule_url = "http://api.simulcast.globosat.tv/combate/?page=%s"
        headers = {
            "User-Agent": "GlobosatPlay/142 CFNetwork/811.4.18 Darwin/16.5.0",
            "Authorization": "Token 59150c4cc6a00f467bf225cf3bf8f44617e27037",
            "Accept-Encoding": "gzip, deflate"
        }

        page = 1
        response = requests.get(globosat_schedule_url % page, headers=headers).json()

        results = response['results']

        while response['next'] is not None:
            page += 1
            response = requests.get(globosat_schedule_url % page, headers=headers).json()
            results += response['results']

        for result in results:

            beginsAt = util.strptime_workaround(result['day'], '%d/%m/%Y %H:%M') + util.get_utc_delta()