Пример #1
0
def proxy_list():
    from support.hideme import HideMeProxyList, Proxy, SortBy, Anonymity

    storage = plugin.get_storage()
    proxies = HideMeProxyList(types=[Proxy.HTTP], except_countries=['RU'], sort_by=SortBy.PING,
                              anonymity=[Anonymity.LOW, Anonymity.AVG, Anonymity.HIGH])
    return storage.setdefault('proxies', proxies, ttl=24 * 60 * 3)
Пример #2
0
def antizapret():
    from support.antizapret import AntiZapret
    storage = plugin.get_storage()
    if 'antizapret' not in storage:
        az = AntiZapret()
        storage.set('antizapret', az, 24 * 60)
    else:
        az = storage['antizapret']
    return az
Пример #3
0
def proxy_list():
    from support.hideme import HideMeProxyList, Proxy, SortBy, Anonymity

    storage = plugin.get_storage()
    proxies = HideMeProxyList(
        types=[Proxy.HTTP],
        except_countries=['RU'],
        sort_by=SortBy.PING,
        anonymity=[Anonymity.LOW, Anonymity.AVG, Anonymity.HIGH])
    return storage.setdefault('proxies', proxies, ttl=24 * 60 * 3)
Пример #4
0
def get_scraper():
    from support.services import xrequests_session
    anonymized_urls = plugin.get_storage().setdefault('anonymized_urls', [], ttl=24 * 60 * 7)
    return LostFilmScraper(login=plugin.get_setting('login', unicode),
                           password=plugin.get_setting('password', unicode),
                           cookie_jar=plugin.addon_data_path('cookies'),
                           xrequests_session=xrequests_session(),
                           max_workers=BATCH_SERIES_COUNT,
                           series_cache=series_cache(),
                           anonymized_urls=anonymized_urls)
Пример #5
0
def get_scraper():
    from support.services import xrequests_session
    anonymized_urls = plugin.get_storage().setdefault('anonymized_urls', [], ttl=24 * 60 * 7)
    return LostFilmScraper(login=plugin.get_setting('login', unicode),
                           password=plugin.get_setting('password', unicode),
                           cookie_jar=plugin.addon_data_path('cookies'),
                           xrequests_session=xrequests_session(),
                           max_workers=BATCH_SERIES_COUNT,
                           series_cache=series_cache(),
                           anonymized_urls=anonymized_urls)
Пример #6
0
def check_last_episode(e):
    storage = plugin.get_storage()
    if 'last_episode' in storage and storage['last_episode'] != e:
        plugin.log.info("Last episode changed, updating library...")
        plugin.set_setting('update-library', True)
    storage['last_episode'] = e
Пример #7
0
def library_new_episodes():
    """
    :rtype : NewEpisodes
    """
    return plugin.get_storage().setdefault('new_episodes', NewEpisodes())
Пример #8
0
def library_items():
    return plugin.get_storage().setdefault('library_items', [])
Пример #9
0
def series_cache():
    return plugin.get_storage('series.db', 24 * 60 * 7, cached=False)
Пример #10
0
def check_last_episode(e):
    storage = plugin.get_storage()
    if 'last_episode' in storage and storage['last_episode'] != e:
        plugin.log.info("Last episode changed, updating library...")
        plugin.set_setting('update-library', True)
    storage['last_episode'] = e
Пример #11
0
def library_new_episodes():
    """
    :rtype : NewEpisodes
    """
    return plugin.get_storage().setdefault('new_episodes', NewEpisodes())
Пример #12
0
def library_items():
    return plugin.get_storage().setdefault('library_items', [])
Пример #13
0
def series_cache():
    return plugin.get_storage('series.db', 24 * 60 * 7, cached=False)
Пример #14
0
def shows_ids():
    return plugin.get_storage('shows_ids.db', 24 * 60 * 7, cached=False)