Exemplo n.º 1
0
def search_edit(term):
	if term == ' ' or term == None or term == '':
		term = plugin.keyboard(heading='Enter search string')
	else:
		term = plugin.keyboard(default=term, heading='Enter search string')
	if term != None and term != '':
		return search(term)
	else:
		return
Exemplo n.º 2
0
def update_players_remote(url):
    parsed = urlparse.urlparse(url)
    username = parsed.username
    password = parsed.password
    if username is not None:
        if not password:
            password = plugin.keyboard(heading='Enter password', hidden=True)
        if not password:
            return False
        url = remove_auth(url)
    response = None
    try:
        response = urllib2.urlopen(url)
    except urllib2.HTTPError as e:
        if not username:
            return False
        url = e.geturl()
    if response is None:
        userandpass = base64.b64encode('%s:%s' % (username, password))
        auth = 'Basic %s' % userandpass.decode('ascii')
        request = urllib2.Request(url)
        request.add_header('Authorization', auth)
        try:
            response = urllib2.urlopen(request)
        except:
            return False
    extract_to = xbmc.translatePath(
        'special://profile/addon_data/plugin.video.chappaai/Players')
    buffer = io.BytesIO(response.read())
    with contextlib.closing(zipfile.ZipFile(buffer)) as z:
        members = [x for x in z.namelist() if x.endswith('.json')]
        flat_extract(z, extract_to, members)
    return True
Exemplo n.º 3
0
def search_term():
	term = plugin.keyboard(heading='Enter search string')
	if term != None and term != '':
		return search(term)
	else:
		return
Exemplo n.º 4
0
def lists_trakt_search_for_lists():
    term = plugin.keyboard(heading='Enter search string')
    if term != None and term != '':
        return lists_search_for_lists_term(term, 1)
    else:
        return