# Path: resources/lib/modules/cache.py
# def get(function, timeout_hour, *args, **kargs):
# def clear_item(function, *args, **kargs):
# def __get_from_cache(dbcur, table, f, a, timeout_hour):
# def __execute_origin(dbcur, dbcon, function, table, f, a, response, *args, **kargs):
# def delete_file():
# def clear(table=None):
# 
# 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):


from auth import PLATFORM
from auth import get_request_data
from resources.lib.modules import cache
from resources.lib.modules import workers
import requests
import resources.lib.modules.control as control
import scraper_live
import player
import os
import urllib
                'category': category,
                'subcategory': item.get('title', '').encode('utf-8'),
                'label': item.get('title', '').encode('utf-8'),
                'art': {
                    'thumb': LOGO,
                    'fanart': FANART
                }
            }


def get_content(category, subcategory):

    response = _get_page(category)

    item = next((item for item in response.get('response', {}).get('categories', []) if item.get('title', '') == subcategory), {})

    if not item.get('contents', []):
        if item.get('type') == 'continue_watching':
            url = 'https://www.nowonline.com.br/AGL/1.0/R/ENG/{platform}/ALL/NET/USER/BOOKMARKS'.format(platform=PLATFORM)
            response = request_logged_in(url, False)
            contents = [result.get('content', {}) for result in response.get('resultObj', []) if result.get('content', {})]
        else:
            id = item.get('id', -1)
            url = 'https://www.nowonline.com.br/avsclient/categories/{id}/contents?offset=1&channel={platform}&limit=30'.format(platform=PLATFORM, id=id)
            response = request_logged_in(url)
            contents = response.get('response', {}).get('contents', [])
    else:
        contents = item.get('contents', [])

    threads = [{

# Path: resources/lib/modules/cache.py
# def get(function, timeout_hour, *args, **kargs):
# def clear_item(function, *args, **kargs):
# def __get_from_cache(dbcur, table, f, a, timeout_hour):
# def __execute_origin(dbcur, dbcon, function, table, f, a, response, *args, **kargs):
# def delete_file():
# def clear(table=None):
# 
# 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/netnow/scraper_vod.py
from auth import PLATFORM
from auth import get_request_data
from resources.lib.modules import cache
from resources.lib.modules import workers
import requests
import resources.lib.modules.control as control
import scraper_live
import player
import os
import urllib

                'category': category,
                'subcategory': item.get('title', '').encode('utf-8'),
                'label': item.get('title', '').encode('utf-8'),
                'art': {
                    'thumb': LOGO,
                    'fanart': FANART
                }
            }


def get_content(category, subcategory):

    response = _get_page(category)

    item = next((item for item in response.get('response', {}).get('categories', []) if item.get('title', '') == subcategory), {})

    if not item.get('contents', []):
        if item.get('type') == 'continue_watching':
            url = 'https://www.nowonline.com.br/AGL/1.0/R/ENG/{platform}/ALL/NET/USER/BOOKMARKS'.format(platform=PLATFORM)
            response = request_logged_in(url, False)
            contents = [result.get('content', {}) for result in response.get('resultObj', []) if result.get('content', {})]
        else:
            id = item.get('id', -1)
            url = 'https://www.nowonline.com.br/avsclient/categories/{id}/contents?offset=1&channel={platform}&limit=30'.format(platform=PLATFORM, id=id)
            response = request_logged_in(url)
            contents = response.get('response', {}).get('contents', [])
    else:
        contents = item.get('contents', [])

    threads = [{

                'thread': workers.Thread(_get_content, content.get('id', -1)),