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)
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
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)
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)
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
def library_new_episodes(): """ :rtype : NewEpisodes """ return plugin.get_storage().setdefault('new_episodes', NewEpisodes())
def library_items(): return plugin.get_storage().setdefault('library_items', [])
def series_cache(): return plugin.get_storage('series.db', 24 * 60 * 7, cached=False)
def shows_ids(): return plugin.get_storage('shows_ids.db', 24 * 60 * 7, cached=False)