def update_all_scrapers(): try: last_check = int(kodi.get_setting('last_list_check')) except: last_check = 0 now = int(time.time()) list_url = kodi.get_setting('scraper_url') scraper_password = kodi.get_setting('scraper_password') list_path = os.path.join(kodi.translate_path(kodi.get_profile()), 'scraper_list.txt') exists = os.path.exists(list_path) if list_url and scraper_password and (not exists or last_check < (now - (24 * 60 * 60))): scraper_list = utils2.get_and_decrypt(list_url, scraper_password) if scraper_list: try: with open(list_path, 'w') as f: f.write(scraper_list) kodi.set_setting('last_list_check', str(now)) kodi.set_setting( 'scraper_last_update', time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(now))) for line in scraper_list.split('\n'): line = line.replace(' ', '') if line: scraper_url, filename = line.split(',') if scraper_url.startswith('http'): update_scraper(filename, scraper_url) except Exception as e: log_utils.log('Exception during scraper update: %s' % (e), log_utils.LOGWARNING)
def update_all_scrapers(): try: last_check = int(kodi.get_setting('last_list_check')) except: last_check = 0 now = int(time.time()) list_url = kodi.get_setting('scraper_url') scraper_password = kodi.get_setting('scraper_password') list_path = os.path.join(kodi.translate_path(kodi.get_profile()), 'scraper_list.txt') exists = os.path.exists(list_path) if list_url and scraper_password and (not exists or last_check < (now - (24 * 60 * 60))): scraper_list = utils2.get_and_decrypt(list_url, scraper_password) if scraper_list: try: with open(list_path, 'w') as f: f.write(scraper_list) kodi.set_setting('last_list_check', str(now)) kodi.set_setting('scraper_last_update', time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(now))) for line in scraper_list.split('\n'): line = line.replace(' ', '') if line: scraper_url, filename = line.split(',') if scraper_url.startswith('http'): update_scraper(filename, scraper_url) except Exception as e: log_utils.log('Exception during scraper update: %s' % (e), log_utils.LOGWARNING)
import xbmcgui from salts_lib import cloudflare from salts_lib import kodi from salts_lib import log_utils from salts_lib import scraper_utils from salts_lib.constants import FORCE_NO_MATCH from salts_lib.constants import Q_ORDER from salts_lib.constants import SHORT_MONS from salts_lib.constants import VIDEO_TYPES from salts_lib.db_utils import DB_Connection from salts_lib.kodi import i18n BASE_URL = '' CAPTCHA_BASE_URL = 'http://www.google.com/recaptcha/api' COOKIEPATH = kodi.translate_path(kodi.get_profile()) MONTHS = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ] # Q_LIST = [item[0] for item in sorted(Q_ORDER.items(), key=lambda x:x[1])] MAX_RESPONSE = 1024 * 1024 * 2 class NoRedirection(urllib2.HTTPErrorProcessor): def http_response(self, request, response): log_utils.log('Stopping Redirect', log_utils.LOGDEBUG) return response https_response = http_response
from salts_lib.constants import FORCE_NO_MATCH from salts_lib.constants import QUALITIES from salts_lib.constants import VIDEO_TYPES from salts_lib import gui_utils import scraper XHR = {'X-Requested-With': 'XMLHttpRequest'} BASE_URL = 'http://torba.se' BASE_URL2 = 'http://streamtorrent.tv' SEARCH_URL = '/search?title=%s&order=recent&_pjax=#films-pjax-container' TOR_URL = BASE_URL2 + '/api/torrent/%s.json' PL_URL = BASE_URL2 + '/api/torrent/%s/%s.m3u8' INTERVALS = 5 EXPIRE_DURATION = 5 * 60 KODI_UA = 'Lavf/56.40.101' M3U8_PATH = os.path.join(kodi.translate_path(kodi.get_profile()), 'torbase.m3u8') M3U8_TEMPLATE = [ '#EXTM3U', '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="{audio_group}",DEFAULT=YES,AUTOSELECT=YES,NAME="Stream 1",URI="{audio_stream}"', '', '#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH={bandwidth},NAME="{stream_name}",AUDIO="{audio_group}"', '{video_stream}' ] class TorbaSe_Scraper(scraper.Scraper): base_url = BASE_URL def __init__(self, timeout=scraper.DEFAULT_TIMEOUT): self.timeout = timeout
from salts_lib.constants import FORCE_NO_MATCH from salts_lib.constants import QUALITIES from salts_lib.constants import VIDEO_TYPES import scraper XHR = {'X-Requested-With': 'XMLHttpRequest'} BASE_URL = 'http://torba.se' BASE_URL2 = 'http://streamtorrent.tv' SEARCH_URL = '/search?title=%s&order=recent&_pjax=#films-pjax-container' TOR_URL = BASE_URL2 + '/api/torrent/%s.json' PL_URL = BASE_URL2 + '/api/torrent/%s/%s.m3u8' INTERVALS = 5 EXPIRE_DURATION = 5 * 60 KODI_UA = 'Lavf/56.40.101' M3U8_PATH = os.path.join(kodi.translate_path(kodi.get_profile()), 'torbase.m3u8') M3U8_TEMPLATE = [ '#EXTM3U', '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="{audio_group}",DEFAULT=YES,AUTOSELECT=YES,NAME="Stream 1",URI="{audio_stream}"', '', '#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH={bandwidth},NAME="{stream_name}",AUDIO="{audio_group}"', '{video_stream}'] class TorbaSe_Scraper(scraper.Scraper): base_url = BASE_URL def __init__(self, timeout=scraper.DEFAULT_TIMEOUT): self.timeout = timeout self.base_url = kodi.get_setting('%s-base_url' % (self.get_name())) @classmethod
from salts_lib import log_utils from salts_lib.trans_utils import i18n from salts_lib import cloudflare from salts_lib import pyaes from salts_lib.db_utils import DB_Connection from salts_lib.constants import VIDEO_TYPES from salts_lib.constants import USER_AGENT from salts_lib.constants import QUALITIES from salts_lib.constants import HOST_Q from salts_lib.constants import Q_ORDER from salts_lib.constants import BLOG_Q_MAP import threading BASE_URL = '' CAPTCHA_BASE_URL = 'http://www.google.com/recaptcha/api' COOKIEPATH = xbmc.translatePath(kodi.get_profile()) MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] SHORT_MONS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] Q_LIST = [item[0] for item in sorted(Q_ORDER.items(), key=lambda x:x[1])] MAX_RESPONSE = 1024 * 1024 class NoRedirection(urllib2.HTTPErrorProcessor): def http_response(self, request, response): log_utils.log('Stopping Redirect', log_utils.LOGDEBUG) return response https_response = http_response abstractstaticmethod = abc.abstractmethod class abstractclassmethod(classmethod):
from salts_lib import kodi from salts_lib import log_utils from salts_lib import scraper_utils from salts_lib.constants import FORCE_NO_MATCH from salts_lib.constants import QUALITIES from salts_lib.constants import VIDEO_TYPES import scraper XHR = {'X-Requested-With': 'XMLHttpRequest'} BASE_URL = 'http://torba.se' BASE_URL2 = 'http://streamtorrent.tv' SEARCH_URL = '/search?title=%s&order=recent&_pjax=#films-pjax-container' TOR_URL = BASE_URL2 + '/api/torrent/%s.json' PL_URL = BASE_URL2 + '/api/torrent/%s/%s.m3u8' M3U8_PATH = os.path.join(kodi.translate_path(kodi.get_profile()), 'torbase.m3u8') M3U8_TEMPLATE = [ '#EXTM3U', '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="{audio_group}",DEFAULT=YES,AUTOSELECT=YES,NAME="Stream 1",URI="{audio_stream}"', '', '#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH={bandwidth},NAME="{stream_name}",AUDIO="{audio_group}"', '{video_stream}'] class TorbaSe_Scraper(scraper.Scraper): base_url = BASE_URL def __init__(self, timeout=scraper.DEFAULT_TIMEOUT): self.timeout = timeout self.base_url = kodi.get_setting('%s-base_url' % (self.get_name())) @classmethod
from salts_lib.constants import VIDEO_TYPES from salts_lib.constants import FORCE_NO_MATCH from salts_lib.constants import BR_VERS from salts_lib.constants import WIN_VERS from salts_lib.constants import FEATURES from salts_lib.constants import RAND_UAS from salts_lib.constants import QUALITIES from salts_lib.constants import HOST_Q from salts_lib.constants import Q_ORDER from salts_lib.constants import BLOG_Q_MAP from salts_lib.constants import SHORT_MONS import threading BASE_URL = '' CAPTCHA_BASE_URL = 'http://www.google.com/recaptcha/api' COOKIEPATH = xbmc.translatePath(kodi.get_profile()) MONTHS = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ] Q_LIST = [item[0] for item in sorted(Q_ORDER.items(), key=lambda x: x[1])] MAX_RESPONSE = 1024 * 1024 * 2 class NoRedirection(urllib2.HTTPErrorProcessor): def http_response(self, request, response): log_utils.log('Stopping Redirect', log_utils.LOGDEBUG) return response https_response = http_response
import xbmcgui from salts_lib import cloudflare from salts_lib import kodi from salts_lib import log_utils from salts_lib import scraper_utils from salts_lib.constants import FORCE_NO_MATCH from salts_lib.constants import Q_ORDER from salts_lib.constants import SHORT_MONS from salts_lib.constants import VIDEO_TYPES from salts_lib.db_utils import DB_Connection from salts_lib.kodi import i18n BASE_URL = '' CAPTCHA_BASE_URL = 'http://www.google.com/recaptcha/api' COOKIEPATH = kodi.translate_path(kodi.get_profile()) MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] # Q_LIST = [item[0] for item in sorted(Q_ORDER.items(), key=lambda x:x[1])] MAX_RESPONSE = 1024 * 1024 * 2 class NoRedirection(urllib2.HTTPErrorProcessor): def http_response(self, request, response): log_utils.log('Stopping Redirect', log_utils.LOGDEBUG) return response https_response = http_response abstractstaticmethod = abc.abstractmethod class abstractclassmethod(classmethod): __isabstractmethod__ = True
import re import json import xbmcvfs import xbmc import os from salts_lib import log_utils from salts_lib import kodi from salts_lib.constants import VIDEO_TYPES from salts_lib.constants import FORCE_NO_MATCH from salts_lib.constants import XHR from salts_lib.constants import QUALITIES BASE_URL = 'http://torba.se' SEARCH_URL = '/api/movies/list.json?genres=All+genres&limit=40&order=recent&q=%s&year=All+years' PLAYER_URL = '/api/movies/player.json?slug=%s' M3U8_PATH = os.path.join(xbmc.translatePath(kodi.get_profile()), 'torbase.m3u8') M3U8_TEMPLATE = [ '#EXTM3U', '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="{audio_group}",DEFAULT=YES,AUTOSELECT=YES,NAME="Stream 1",URI="{audio_stream}"', '', '#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH={bandwidth},NAME="{stream_name}",AUDIO="{audio_group}"', '{video_stream}' ] class TorbaSe_Scraper(scraper.Scraper): base_url = BASE_URL def __init__(self, timeout=scraper.DEFAULT_TIMEOUT): self.timeout = timeout