Пример #1
0
def edit_list(rowid):
    name = utils._get_keyboard(heading="Input the new name for the list")
    if not name:
        return
    conn = sqlite3.connect(favoritesdb)
    c = conn.cursor()
    c.execute("UPDATE custom_lists set name = ? WHERE rowid = ?", (name, int(rowid),))
    conn.commit()
    conn.close()
    xbmc.executebuiltin('Container.Refresh')
Пример #2
0
def create_custom_list():
    name = utils._get_keyboard(heading="Input the name for the list")
    if not name:
        return
    conn = sqlite3.connect(favoritesdb)
    conn.text_factory = str
    c = conn.cursor()
    c.execute("INSERT INTO custom_lists VALUES (?)", (name,))
    conn.commit()
    conn.close()
    xbmc.executebuiltin('Container.Refresh')
Пример #3
0
def LiveSearch(url):
    keyword = {}
    if not (utils.addon.getSetting('rName')=="true" or \
       utils.addon.getSetting('rAge')=="true" or \
       utils.addon.getSetting('rCountry')=="true" or \
       utils.addon.getSetting('rGender')=="true"):
        utils.addon.openSettings()
    if utils.addon.getSetting('rName') == "true":
        word = utils._get_keyboard(heading="Searching for..." + "\nName")
        if word:
            keyword['name'] = word
    if utils.addon.getSetting('rAge') == "true":
        word = utils._get_keyboard(heading="Searching for..." + "\nAge")
        if word:
            keyword['age'] = word
    if utils.addon.getSetting('rCountry') == "true":
        data = utils.getHtml(url)  # + "&page_number=" + str(page))
        model_list = json.loads(data)
        allCountries = sorted(
            list(
                set([
                    x['Country'] for x in model_list['Results'] if x['Country']
                ])))
        choice = xbmcgui.Dialog().select('Select country',
                                         [item for item in allCountries])
        keyword['country'] = allCountries[choice]
    if utils.addon.getSetting('rGender') == "true":
        if 'data' not in locals():
            data = utils.getHtml(url)  # + "&page_number=" + str(page))
            model_list = json.loads(data)
        allGender = sorted(
            list(
                set([
                    x['Gender'] for x in model_list['Results'] if x['Gender']
                ])))
        choice = xbmcgui.Dialog().select('Select Gender',
                                         [item for item in allGender])
        keyword['gender'] = allGender[choice]

    if (not keyword): return False, 0
    ListLive(url, searchStr=keyword)
Пример #4
0
def Search(url):
    keyword = utils._get_keyboard(heading="Searching for...")
    if (not keyword): return False, 0
    try:
        response = utils.getHtml(url + keyword)
    except:
        utils.notify('Model not found - try again')
        return None
    match = re.compile("p_signupargs: 'smid%3D([^']+)'", re.DOTALL | re.IGNORECASE).findall(response)
    if match:
        utils.notify('Found ' + keyword + ' adding to favorites now')
        img = "http://m1.nsimg.net/media/snap/" + match[0] + ".jpg"
        performerID = match[0]
        name = keyword
        favorites.Favorites('add', 518, name, performerID, img)
Пример #5
0
def Search(url):
    keyword = utils._get_keyboard(heading="Searching for...")
    if (not keyword):
        return False, 0
    try:
        response = utils.getHtml(url + keyword)
    except:
        utils.notify('Model not found - try again')
        return None
    match = re.compile("p_signupargs: 'smid%3D([^']+)'", re.DOTALL | re.IGNORECASE).findall(response)
    if match:
        utils.notify('Found ' + keyword + ' adding to favorites now')
        img = "http://m1.nsimg.net/media/snap/" + match[0] + ".jpg"
        performerID = match[0]
        name = keyword
        favorites.Favorites('add', 'Playvid', name, performerID, img)