Exemplo n.º 1
0
 def __init__(self):
     self.priority = 1
     self.language = ['de']
     self.domains = ['serienstream.to']
     self.base_link = 'https://serienstream.to'
     self.search_link = '/ajax/search'
     self.login = control.setting('serienstream.user')
     self.password = control.setting('serienstream.pass')
     self.cookie = ''
     self.user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'
Exemplo n.º 2
0
    def __init__(self):
        self.priority = 1
        self.language = ['de']
        self.domains = ['seriesever.net']
        self.base_link = 'http://seriesever.net'
        self.search_link = 'service/search?q=%s'
        self.part_link = 'service/get_video_part'

        self.login_link = 'service/login'
        self.user = control.setting('seriesever.user')
        self.password = control.setting('seriesever.pass')
Exemplo n.º 3
0
 def __init__(self):
     self.priority = 0
     self.language = ['en']
     self.domain = 'furk.net/'
     self.base_link = 'https://www.furk.net'
     self.meta_search_link = "/api/plugins/metasearch?api_key=%s&q=%s&cached=yes" \
                             "&match=%s&moderated=%s%s&sort=relevance&type=video&offset=0&limit=%s"
     self.tfile_link = "/api/file/get?api_key=%s&t_files=1&id=%s"
     self.login_link = "/api/login/login?login=%s&pwd=%s"
     self.user_name = control.setting('furk.user_name')
     self.user_pass = control.setting('furk.user_pass')
     self.api_key = control.setting('furk.api')
     self.search_limit = control.setting('furk.limit')
Exemplo n.º 4
0
 def __init__(self):
     self.priority = 0
     self.language = ['de']
     self.domains = ['pron.ee']
     self.base_link = 'https://www.pron.ee'
     self.search_link = '/api/search/%s/?apikey=%s&getmeta=0&query=%s&count=%d&from=%d'
     self.types = ['stream']
     self.streamLimit = control.setting('pron.limit')
     if self.streamLimit == '': self.streamLimit = 100
     self.streamLimit = int(self.streamLimit)
     self.streamIncrease = 100
     self.api = control.setting('pron.api')
     self.debrid = control.setting('pron.download')
     if self.debrid == 'true': self.types = ['stream', 'download']
     self.extensions = ['mp4', 'mpg', 'mpeg', 'mp2', 'm4v', 'm2v', 'mkv', 'avi', 'flv', 'asf', '3gp', '3g2', 'wmv', 'mov', 'qt', 'webm', 'vob', '']
Exemplo n.º 5
0
    def __init__(self):
        self.priority = 1
        self.language = ['en']
        self.domains = ['ororo.tv']
        self.base_link = 'https://ororo.tv'
        self.moviesearch_link = '/api/v2/movies'
        self.tvsearch_link = '/api/v2/shows'
        self.movie_link = '/api/v2/movies/%s'
        self.show_link = '/api/v2/shows/%s'
        self.episode_link = '/api/v2/episodes/%s'

        self.user = control.setting('ororo.user')
        self.password = control.setting('ororo.pass')
        self.headers = {
        'Authorization': 'Basic %s' % base64.b64encode('%s:%s' % (self.user, self.password)),
        'User-Agent': 'Placenta for Kodi'
        }
Exemplo n.º 6
0
def __getTrakt(url, post=None):
    try:
        url = urlparse.urljoin(BASE_URL, url)
        post = json.dumps(post) if post else None
        headers = {'Content-Type': 'application/json', 'trakt-api-key': V2_API_KEY, 'trakt-api-version': 2}

        if getTraktCredentialsInfo():
            headers.update({'Authorization': 'Bearer %s' % control.setting('trakt.token')})

        result = client.request(url, post=post, headers=headers, output='extended', error=True)

        resp_code = result[1]
        resp_header = result[2]
        result = result[0]

        if resp_code in ['500', '502', '503', '504', '520', '521', '522', '524']:
            log_utils.log('Temporary Trakt Error: %s' % resp_code, log_utils.LOGWARNING)
            return
        elif resp_code in ['404']:
            log_utils.log('Object Not Found : %s' % resp_code, log_utils.LOGWARNING)
            return
#        elif resp_code in ['429']:
#            log_utils.log('Trakt Rate Limit Reached: %s' % resp_code, log_utils.LOGWARNING)
#            return

        if resp_code not in ['401', '405']:
            return result, resp_header

        oauth = urlparse.urljoin(BASE_URL, '/oauth/token')
        opost = {'client_id': V2_API_KEY, 'client_secret': CLIENT_SECRET, 'redirect_uri': REDIRECT_URI, 'grant_type': 'refresh_token', 'refresh_token': control.setting('trakt.refresh')}

        result = client.request(oauth, post=json.dumps(opost), headers=headers)
        result = utils.json_loads_as_str(result)

        token, refresh = result['access_token'], result['refresh_token']

        control.setSetting(id='trakt.token', value=token)
        control.setSetting(id='trakt.refresh', value=refresh)

        headers['Authorization'] = 'Bearer %s' % token

        result = client.request(url, post=post, headers=headers, output='extended', error=True)
        return result[0], result[2]
    except Exception as e:
        log_utils.log('Unknown Trakt Error: %s' % e, log_utils.LOGWARNING)
        pass
Exemplo n.º 7
0
def timeoutsyncTVShows():
    timeout = cache.timeout(syncTVShows, control.setting('trakt.user').strip())
    return timeout
Exemplo n.º 8
0
def cachesyncTVShows(timeout=0):
    indicators = cache.get(syncTVShows, timeout, control.setting('trakt.user').strip())
    return indicators
Exemplo n.º 9
0
def getTraktIndicatorsInfo():
    indicators = control.setting('indicators') if getTraktCredentialsInfo() == False else control.setting('indicators.alt')
    indicators = True if indicators == '1' else False
    return indicators
Exemplo n.º 10
0
def getTraktCredentialsInfo():
    user = control.setting('trakt.user').strip()
    token = control.setting('trakt.token')
    refresh = control.setting('trakt.refresh')
    if (user == '' or token == '' or refresh == ''): return False
    return True