コード例 #1
0
def init_openscrapers(folders):
    addon = Addon.from_path(SCRAPERS_REPO_DIR)

    # Monkey patch settings object to enable all providers
    class AllProviderDict(UserDict, object):
        def get(self, key, default=''):
            return "true" if key.startswith("provider.") else super(AllProviderDict, self).get(key, default)
    addon.settings = AllProviderDict()

    # Create kodi mock module
    cached = repo.LocalRepo([], [], addon)
    deps = cached.load_dependencies(addon)
    xbmc.session = tesseract.Tesseract(addon, deps, cached)

    # Initialize openscrapers with passed scraper folders
    from lib import openscrapers
    return openscrapers.sources(folders)
コード例 #2
0
            if unit_test is None:
                failed_providers.append(
                    (provider_name, 'Unit Test Returned None'))
                return

            runtime = time.time() - start_time

            passed_providers.append((provider_name, unit_test, runtime))

    except Exception as e:
        # Appending issue provider to failed providers
        failed_providers.append((provider_name, e))


provider_list = openscrapers.sources()
failed_providers = []
passed_providers = []
workers = []

if __name__ == '__main__':

    total_runtime = time.time()

    print('Running Unit Tests. Please Wait...')

    # Build and run threads
    if test_mode == 1:
        for provider in provider_list:
            workers.append(
                threading.Thread(target=worker_thread,
コード例 #3
0
            'show_tvdb': show['ids']['tvdb'],
            'tvshowtitle': show['title'],
            'localtvshowtitle': show['title'],
            'aliases': [],
            'year': show['year'],
            'imdb': episode['ids']['imdb'],
            'tvdb': episode['ids']['tvdb'],
            'title': episode['title'],
            'premiered': '',
            'season': episode['season'],
            'episode': episode['number']
        })

RUNNING_PROVIDERS = []
TOTAL_SOURCES = []
PROVIDER_LIST = openscrapers.sources(folders, True)
FAILED_PROVIDERS = []
PASSED_PROVIDERS = []
workers = []
TOTAL_RUNTIME = 0
TIMEOUT = 10

hosts = [
    u'4shared.com', u'openload.co', u'rapidgator.net', u'sky.fm',
    u'thevideo.me', u'filesmonster.com', u'youtube.com', u'icerbox.com',
    u'nitroflare.com', u'1fichier.com', u'docs.google.com', u'mediafire.com',
    u'hitfile.net', u'2shared.com', u'rapidvideo.com', u'filerio.com',
    u'extmatrix.com', u'datafile.com', u'solidfiles.com', u'dl.free.fr',
    u'inclouddrive.com', u'zippyshare.com', u'unibytes.com', u'flashx.tv',
    u'canalplus.fr', u'redbunker.net', u'nowvideo.club', u'dailymotion.com',
    u'load.to', u'uploaded.net', u'scribd.com', u'big4shared.com',