Ejemplo n.º 1
0
def Category(url):
    categories = {'Straight': '', 'Gay': 'gay/', 'Trans': 'shemale/'}
    oldcat = get_setting('category')
    cat = utils.selector('Select category', categories.keys())
    if cat and cat != oldcat:
        utils.addon.setSetting('xvideoscategory', cat)
        cat = 'straight' if cat == 'Straight' else categories[cat][:-1]
        utils._getHtml(site.url + 'switch-sexual-orientation/' + cat)
        utils.refresh()
Ejemplo n.º 2
0
def ContextCategory():
    categories = {'straight': 1, 'gay': 2, 'shemale': 3}
    cat = utils.selector('Select category', categories.keys(), sort_by=lambda x: categories[x])
    if cat:
        utils.addon.setSetting('xhamstercat', cat)
        if cat == 'straight':
            utils._getHtml('https://xhamster.com/?straight=', site.url)
        else:
            utils._getHtml('https://xhamster.com/' + cat, site.url)
        utils.refresh()
Ejemplo n.º 3
0
def PTLogin(logged=True):
    ptlogged = utils.addon.getSetting('ptlogged')
    if not logged:
        ptlogged = False
        utils.addon.setSetting('ptlogged', 'false')

    if not ptlogged or 'false' in ptlogged:
        ptuser = utils.addon.getSetting('ptuser') if utils.addon.getSetting(
            'ptuser') else ''
        ptpass = utils.addon.getSetting('ptpass') if utils.addon.getSetting(
            'ptpass') else ''
        if ptuser == '':
            ptuser = getinput(default=ptuser,
                              heading='Input your Porntrex username')
            ptpass = getinput(default=ptpass,
                              heading='Input your Porntrex password',
                              hidden=True)

        loginurl = '{0}ajax-login/'.format(site.url)
        postRequest = {
            'action': 'login',
            'email_link': '{0}email/'.format(site.url),
            'format': 'json',
            'mode': 'async',
            'pass': ptpass,
            'remember_me': '1',
            'username': ptuser
        }
        response = utils._postHtml(loginurl, form_data=postRequest)
        if 'success' in response.lower():
            utils.addon.setSetting('ptlogged', 'true')
            utils.addon.setSetting('ptuser', ptuser)
            utils.addon.setSetting('ptpass', ptpass)
            success = True
        else:
            utils.notify('Failure logging in',
                         'Failure, please check your username or password')
            utils.addon.setSetting('ptuser', '')
            utils.addon.setSetting('ptpass', '')
            success = False
    elif ptlogged:
        clear = utils.selector('Clear stored user & password?', ['Yes', 'No'],
                               reverse=True)
        if clear:
            if clear == 'Yes':
                utils.addon.setSetting('ptuser', '')
                utils.addon.setSetting('ptpass', '')
            utils.addon.setSetting('ptlogged', 'false')
            utils._getHtml(site.url + 'logout/')
            contexturl = (utils.addon_sys + "?mode=" + str('porntrex.PTMain'))
            xbmc.executebuiltin('Container.Update(' + contexturl + ')')
    if logged:
        xbmc.executebuiltin('Container.Refresh')
    else:
        return success
Ejemplo n.º 4
0
def JBLogin(logged=True):
    jblogged = utils.addon.getSetting('jblogged')
    if not logged:
        jblogged = False
        utils.addon.setSetting('jblogged', 'false')

    if not jblogged or 'false' in jblogged:
        jbuser = utils.addon.getSetting('jbuser') if utils.addon.getSetting(
            'jbuser') else ''
        jbpass = utils.addon.getSetting('jbpass') if utils.addon.getSetting(
            'jbpass') else ''
        if jbuser == '':
            jbuser = getinput(default=jbuser,
                              heading='Input your Javbangers username')
            jbpass = getinput(default=jbpass,
                              heading='Input your Javbangers password',
                              hidden=True)

        loginurl = '{0}ajax-login/'.format(site.url)
        postRequest = {
            'action': 'login',
            'email_link': '{0}email/'.format(site.url),
            'format': 'json',
            'mode': 'async',
            'pass': jbpass,
            'remember_me': '1',
            'username': jbuser
        }
        response = utils._postHtml(loginurl, form_data=postRequest)
        if 'success' in response.lower():
            utils.addon.setSetting('jblogged', 'true')
            utils.addon.setSetting('jbuser', jbuser)
            utils.addon.setSetting('jbpass', jbpass)
            success = True
        else:
            utils.notify('Failure logging in',
                         'Failure, please check your username or password')
            utils.addon.setSetting('jbuser', '')
            utils.addon.setSetting('jbpass', '')
            success = False
    elif jblogged:
        clear = utils.selector('Clear stored user & password?', ['Yes', 'No'],
                               reverse=True)
        if clear:
            if clear == 'Yes':
                utils.addon.setSetting('jbuser', '')
                utils.addon.setSetting('jbpass', '')
            utils.addon.setSetting('jblogged', 'false')
            utils._getHtml(site.url + 'logout/')
    if logged:
        xbmc.executebuiltin('Container.Refresh')
    else:
        return success
Ejemplo n.º 5
0
def Playvid(url, name):
    url, performerID = url.split('$$')
    response = utils._getHtml("https://streamate.com/ajax/config/?name=" + url + "&sakey=&sk=streamate.com&userid=0&version=2.2.0&ajax=1")
    data = json.loads(response)

    host = data['liveservices']['host'] + "/socket.io/?puserid=" + performerID + "&EIO=3&transport=websocket"
    ws = websocket.WebSocket()
    ws = websocket.create_connection(host)

    ws.send('40/live')

    quitting = 0
    i = 0
    while quitting == 0:
        i += 1
        message = ws.recv()
        match = re.compile('performer offline', re.DOTALL | re.IGNORECASE).findall(message)
        if match:
            quitting = 1
            ws.close()
            utils.notify('Model is offline')
            return None

        match = re.compile('isPaid":true', re.DOTALL | re.IGNORECASE).findall(message)
        if match:
            quitting = 1
            ws.close()
            utils.notify('Model not in freechat')
            return None

        if message == '40/live':
            ws.close()
            quitting = 1
            playmode = int(utils.addon.getSetting('chatplay'))
            videourl = ''
            response = utils._getHtml("https://manifest-server.naiadsystems.com/live/s:{0}.json?last=load&format=mp4-hls".format(url))
            data = json.loads(response).get('formats')

            if playmode == 0:
                videourl = data.get('mp4-hls').get('manifest')

            elif playmode == 1:
                sources = {'{0}p'.format(item['videoHeight']): item['location'] for item in data.get('mp4-rtmp').get('encodings')}
                videourl = utils.prefquality(sources, sort_by=lambda x: int(''.join([y for y in x if y.isdigit()])), reverse=True)

    if videourl:
        vp = utils.VideoPlayer(name)
        vp.play_from_direct_link(videourl)
    else:
        utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
        return
Ejemplo n.º 6
0
def Playvid(url, name):
    playmode = int(utils.addon.getSetting('chatplay'))
    url = "{0}&t={1}".format(url, int(time.time() * 1000))
    params = urllib_parse.parse_qs(url.split('?')[1])
    murl = '{0}webservices/chat-room-interface.php?a=login_room&model_id={1}&t={2}'.format(
        site.url, params['model_id'][0], params['t'][0])
    mdata = utils._getHtml(murl, site.url)
    if mdata:
        mdata = json.loads(mdata).get('config', {}).get('room')
        if mdata:
            if mdata.get('status') != 'O':
                utils.notify('Model not in freechat')
                return None
        else:
            utils.notify('Model Offline')
            return None
    else:
        utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
        return None

    vdata = utils._getHtml(url, site.url)
    if vdata:
        vdata = json.loads(vdata).get('data')
    else:
        utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
        return

    if playmode == 0:
        sdata = vdata.get('hls')[0]
        if sdata:
            videourl = 'is://https:{0}'.format(sdata.get('url'))
        else:
            utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
            return

    elif playmode == 1:
        sdata = vdata.get('flash')[0]
        if sdata:
            swfurl = site.url + "chat/flash/live-video-player-nw2.swf"
            videourl = "rtmp://{0} app=liveEdge/{3} swfUrl={1} pageUrl={2} playpath=mp4:{3}".format(
                sdata.get('stream_host'), swfurl, site.url,
                sdata.get('stream_name'))
        else:
            utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
            return

    vp = utils.VideoPlayer(name)
    vp.play_from_direct_link(videourl)
Ejemplo n.º 7
0
def List(url):
    if utils.addon.getSetting("chaturbate") == "true":
        clean_database(False)

    data = utils._getHtml(url)
    model_list = json.loads(data)
    for model in model_list:
        img = 'https:' + model['profile_images']['thumbnail_image_big_live']
        username = model['username']
        name = model['display_name']
        age = model['display_age']
        name += ' [COLOR hotpink][{}][/COLOR]'.format(age)
        if model['hd_cam']:
            name += ' [COLOR gold]HD[/COLOR]'
        subject = ''
        if model.get('hometown'):
            subject += u'Location: {}'.format(model.get('hometown'))
        if model.get('homecountry'):
            subject += u', {}\n'.format(model.get(
                'homecountry')) if subject else u'Location: {}\n'.format(
                    model.get('homecountry'))
        if model['ethnicity']:
            subject += u'\n- {}\n'.format(model['ethnicity'])
        if model['primary_language']:
            subject += u'- Speaks {}\n'.format(model['primary_language'])
        if model['secondary_language']:
            subject = subject[:-1] + u', {}\n'.format(
                model['secondary_language'])
        if model['eye_color']:
            subject += u'- {} Eyed\n'.format(model['eye_color'])
        if model['hair_color']:
            subject = subject[:-1] + u' {}\n'.format(model['hair_color'])
        if model['height']:
            subject += u'- {} tall\n'.format(model['height'])
        if model['weight']:
            subject += u'- {} weight\n'.format(model['weight'])
        if model['bust_penis_size']:
            subject += u'- {} Boobs\n'.format(
                model['bust_penis_size']
            ) if 'Female' in model['gender'] else u'- {} C**k\n'.format(
                model['bust_penis_size'])
        if model['pubic_hair']:
            subject = subject[:-1] + u' and {} Pubes\n'.format(
                model['pubic_hair'])
        if model['vibratoy']:
            subject += u'- Lovense Toy\n\n'
        if model['turns_on']:
            subject += u'- Likes: {}\n'.format(model['turns_on'])
        if model['turns_off']:
            subject += u'- Dislikes: {}\n\n'.format(model['turns_off'])
        if model.get('tags'):
            subject += u', '.join(model.get('tags'))
        site.add_download_link(
            name,
            username,
            'Playvid',
            img,
            subject.encode('utf-8') if utils.PY2 else subject,
            noDownload=True)
    utils.eod()
Ejemplo n.º 8
0
def Playvid(url, name):
    url = url + "?username=guest_" + str(random.randrange(100, 55555))
    response = utils._getHtml(url)
    data = json.loads(response)
    if "camhouse" in data['stream_name']:
        videourl = "https://camhouse.camsoda.com/" + data[
            'app'] + "/mp4:" + data[
                'stream_name'] + "_h264_aac_480p/playlist.m3u8?token=" + data[
                    'token']
    elif "enc" in data['stream_name']:
        if len(data['edge_servers']) > 0:
            videourl = "https://" + random.choice(
                data['edge_servers']
            ) + "/" + data['app'] + "/mp4:" + data[
                'stream_name'] + "_h264_aac_480p/playlist.m3u8?token=" + data[
                    'token']
        else:
            videourl = ""
            utils.notify('Finished', 'Model gone Offline')
    else:
        if len(data['edge_servers']) > 0:
            videourl = "https://" + random.choice(
                data['edge_servers']) + "/" + data[
                    'stream_name'] + "_v1/index.m3u8?token=" + data['token']
        else:
            videourl = ""
            utils.notify('Finished', 'Model gone Offline or Private')
    if videourl:
        videourl += '|User-Agent=iPad&verifypeer=false'
        vp = utils.VideoPlayer(name)
        vp.play_from_direct_link(videourl)
Ejemplo n.º 9
0
def List(url):
    if utils.addon.getSetting("chaturbate") == "true":
        clean_database(False)

    data = utils._getHtml(url, site.url)
    data = re.compile(r"models':\s*(.*?),\s*'", re.DOTALL | re.IGNORECASE).findall(data)[0]
    data = re.sub(r'\s\s+', '', data)
    data = data[:-2] + ']'
    models = json.loads(data)
    for model in models:
        name = model.get('model_seo_name').replace('-', ' ').title()
        age = model.get('age')
        subject = utils.cleantext(model.get('tagline') if utils.PY3 else model.get('tagline').encode('utf8'))
        if model.get('location'):
            subject += "[CR][CR][COLOR deeppink]Location: [/COLOR]{0}[CR][CR]".format(
                model.get('location') if utils.PY3 else model.get('location').encode('utf8'))
        if model.get('topic'):
            subject += utils.cleantext(model.get('topic') if utils.PY3 else model.get('topic').encode('utf8'))
        status = model.get('room_status')
        name = name + " [COLOR deeppink][" + age + "][/COLOR] " + status
        mid = model.get('model_id')
        img = 'https://live-screencaps.vscdns.com/{0}-desktop.jpg'.format(mid)
        videourl = 'https://ws.vs3.com/chat/get-stream-urls.php?model_id={0}&video_host={1}'.format(
            mid, model.get('video_host'))
        site.add_download_link(name, videourl, 'Playvid', img, subject, noDownload=True)
    utils.eod()
Ejemplo n.º 10
0
def List(url, page=1):
    if addon.getSetting("chaturbate") == "true":
        clean_database(False)

    listhtml = utils._getHtml(url)
    match = re.compile(
        r'room_list_room".+?href="([^"]+).+?src="([^"]+).+?<div[^>]+>([^<]+)</div>.+?href[^>]+>([^<]+)<.+?age[^>]+>([^<]+).+?title="([^"]+).+?location.+?>([^<]+).+?cams">([^<]+)',
        re.DOTALL | re.IGNORECASE).findall(listhtml)
    for videopage, img, status, name, age, subject, location, duration in match:
        name = utils.cleantext(name.strip())
        age = utils.cleantext(age.strip())
        subject = utils.cleantext(subject.strip(
        )) + "[CR][COLOR deeppink]Location: [/COLOR]" + utils.cleantext(
            location.strip()) + "[CR]" + utils.cleantext(duration.strip())
        status = utils.cleantext(status.replace("[CR]", "").strip())
        name = name + " [COLOR deeppink][" + age + "][/COLOR] " + status
        videopage = bu[:-1] + videopage
        site.add_download_link(name,
                               videopage,
                               'Playvid',
                               img,
                               subject,
                               noDownload=True)

    nextp = re.compile(r'<a\s*href="([^"]+)"\s*class="next',
                       re.DOTALL | re.IGNORECASE).search(listhtml)
    if nextp:
        page = page + 1 if page else 2
        next = bu[:-1] + nextp.group(1)
        site.add_dir('Next Page (' + str(page) + ')', next, 'List',
                     site.img_next, page)

    utils.eod()
Ejemplo n.º 11
0
def ContextMenu(url, fav):
    id = url.split("/")[4]
    fav_addurl = url + '?mode=async&format=json&action=add_to_favourites&video_id=' + id + '&album_id=&fav_type=0&playlist_id=0'
    fav_delurl = url + '?mode=async&format=json&action=delete_from_favourites&video_id=' + id + '&album_id=&fav_type=0&playlist_id=0'
    fav_url = fav_addurl if fav == 'add' else fav_delurl

    hdr = dict(utils.base_hdrs)
    hdr['Cookie'] = get_cookies()
    resp = utils._getHtml(fav_url, site.url, headers=hdr)

    if fav == 'add':
        if ('success') in resp:
            utils.notify('Favorites', 'Added to PT Favorites')
        else:
            msg = re.findall('message":"([^"]+)"', resp)[0]
            utils.notify('Favorites', msg)
        return
    if fav == 'del':
        if ('success') in resp:
            utils.notify('Deleted from PT Favorites')
            xbmc.executebuiltin('Container.Refresh')
        else:
            msg = re.findall('message":"([^"]+)"', resp)[0]
            utils.notify(msg)
        return
Ejemplo n.º 12
0
def PTSubscriptions(url, page=1):
    suburl = url
    hdr = dict(utils.base_hdrs)
    hdr['Cookie'] = get_cookies()
    listhtml = utils._getHtml(url, site.url, headers=hdr)

    results = re.findall(
        '(?si)href="([^"]+)".*?data-original="([^"]+)" alt="([^"]+)', listhtml)
    for url, img, name in results:
        if img.startswith('//'):
            img = 'https:' + img
            img = img.replace(' ', '%20')
        id = img.split('/')[5]
        if ptlogged:
            contexturl = (utils.addon_sys + "?mode=" +
                          str('porntrex.PTSubscribe_pornstar') + "&url=" +
                          urllib_parse.quote_plus(url) + "&id=" + str(id) +
                          "&what=" + str('unsubscribe'))
            contextmenu = ('[COLOR deeppink]Unsubscribe[/COLOR]',
                           'RunPlugin(' + contexturl + ')')
        url = url + '?mode=async&function=get_block&block_id=list_videos_common_videos_list_norm&sort_by=post_date&from4=1'
        site.add_dir(name, url, 'PTList', img, 1, contextm=contextmenu)
    if len(results) == 11:
        if not page:
            page = 1
        npage = page + 1
        suburl = suburl.replace('from_my_subscriptions=' + str(page),
                                'from_my_subscriptions=' + str(npage))
        site.add_dir('Next Page', suburl, 'PTSubscriptions', site.img_next,
                     npage)
    utils.eod()
Ejemplo n.º 13
0
def List(url):
    if utils.addon.getSetting("chaturbate") == "true":
        clean_database(False)
    response = utils._getHtml(url)
    camgirls = json.loads(response)['results']
    for camgirl in camgirls:
        if 'tpl' in list(camgirl.keys()):
            camgirl = camgirl.get('tpl')
            if type(camgirl) is dict:
                name = camgirl.get('2')
                name = name if utils.PY3 else name.encode('utf8')
                subject = camgirl.get('6')
                subject += u'[CR][CR][COLOR deeppink] Viewers: [/COLOR]{}[CR]'.format(camgirl.get('4'))
                if camgirl.get('3'):
                    subject += u'[COLOR deeppink] Status: [/COLOR]{}[CR]'.format(camgirl.get('3'))
                subject = subject if utils.PY3 else subject.encode('utf8')
                id = camgirl.get('1')
                img = 'http:' + camgirl.get('10')
            elif type(camgirl) is list:
                name = camgirl[2]
                name = name if utils.PY3 else name.encode('utf8')
                subject = camgirl[6]
                subject = subject if utils.PY3 else subject.encode('utf8')
                id = camgirl[1]
                img = 'http:' + camgirl[10]
        else:
            name = camgirl['display_name'] if utils.PY3 else camgirl['display_name'].encode('utf8')
            subject = camgirl['subject_html'] if utils.PY3 else camgirl['subject_html'].encode('utf8')
            id = camgirl['username']
            img = 'https://md.camsoda.com/thumbs/%s.jpg?cb=%s' % (id, int(time.time()))
        videourl = '{0}/api/v1/video/vtoken/{1}'.format(site.url, id)
        site.add_download_link(name, videourl, 'Playvid', img, subject, noDownload=True)
    utils.eod()
Ejemplo n.º 14
0
def List(url, page=1):
    if utils.addon.getSetting("chaturbate") == "true":
        clean_database(False)
    try:
        headers = {"platform": "SCP",
                   "smtid": "ffffffff-ffff-ffff-ffff-ffffffffffffG0000000000000",
                   "smeid": "ffffffff-ffff-ffff-ffff-ffffffffffffG0000000000000",
                   "smvid": "ffffffff-ffff-ffff-ffff-ffffffffffffG0000000000000",
                   "User-Agent": utils.USER_AGENT}
        data = utils._getHtml(url, headers=headers)
    except:
        return None
    model_list = json.loads(data)
    total_models = model_list.get('totalResultCount')
    for camgirl in model_list['performers']:
        img = "http://m1.nsimg.net/media/snap/{0}.jpg".format(camgirl['id'])
        status = 'HD' if camgirl['highDefinition'] else ''
        name = "{0} [COLOR deeppink][{1}][/COLOR] {2}".format(camgirl['nickname'], camgirl['age'], status)
        subject = '{0}[CR][COLOR deeppink]Location: [/COLOR]{1}'.format(utils.cleantext(camgirl['headlineMessage']), camgirl['country'])
        site.add_download_link(name, '{0}$${1}'.format(camgirl['nickname'], camgirl['id']), 'Playvid', img, subject, noDownload=True)
    if total_models > page * 100:
        url = re.sub(r"&from=\d+", "&from={0}".format(page * 100), url)
        lastpg = math.ceil(total_models / 100)
        site.add_dir('Next Page... (Currently in Page {0} of {1})'.format(page, lastpg), url, 'List', site.img_next, page + 1)
    utils.eod()
Ejemplo n.º 15
0
def TagsList(url):
    page = utils._getHtml(url)
    res = re.compile(r"avatar_border\s*src=([^\s]+).+?:19px;'>([^<]+)", re.IGNORECASE | re.DOTALL).findall(page)
    for img, name in res:
        img = img.replace('\\/', '/').replace('100x100', '300x300')
        site.add_download_link(name, name, 'Playvid', img, name, noDownload=True)
    utils.eod()
Ejemplo n.º 16
0
def Playvid(url, name):
    playmode = int(utils.addon.getSetting('chatplay'))
    camhtml = utils._getHtml(url, headers=IOS_UA)

    if playmode == 0:
        m3u8stream = re.search(r"hlsUrl:\s*'([^']+)", camhtml)
        if m3u8stream:
            videourl = '{0}|User-Agent={1}'.format(m3u8stream.group(1),
                                                   IOS_UA['User-Agent'])
        else:
            utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
            return

    elif playmode == 1:
        data = re.search(r"flashData:\s*(.*?}),", camhtml)
        if data:
            data = json.loads(data.group(1))
            swfurl = data.get('playerUrl')
            data = data.get('flashVars')
            streamserver = data.get('videoAppUrl')
            modelname = data.get('videoPlayUrl')
            videourl = "{0} swfUrl={1} pageUrl={2} conn=S:null conn=S: conn=S:{3} playpath={3}".format(
                streamserver, swfurl, url, modelname)
        else:
            utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
            return

    vp = utils.VideoPlayer(name)
    vp.play_from_direct_link(videourl)
Ejemplo n.º 17
0
def List(url, page=1):
    if utils.addon.getSetting("chaturbate") == "true":
        clean_database(False)
    url = '{0}/directoryCams?directoryJson=true&online=true&url=true&orderBy=VIDEO_QUALITY&resultsPerPage=1500{1}'.format(
        site.url, url)
    listhtml = utils._getHtml(url, headers=IOS_UA)
    cams = json.loads(listhtml).get('users', {})
    for cam in cams:
        name = cam.get('username')
        age = cam.get('age')
        if age:
            name = '{0} [COLOR deeppink][{1}][/COLOR]'.format(name, age)
        hd = ''
        if cam.get('hdStream'):
            # name = '{0} [COLOR limegreen][HD][/COLOR]'.format(name)
            hd = 'HD'
        img = cam.get('snapshotImageLink')
        if not img:
            img = cam.get('defaultImageLink')

        subject = ''

        if cam.get('viewers'):
            subject += '[COLOR deeppink]Viewers:[/COLOR] {}[CR]'.format(
                cam.get('viewers'))
        if cam.get('countryCode'):
            subject += '[CR][COLOR deeppink]Country:[/COLOR] {}[CR]'.format(
                utils.get_country(cam.get('countryCode')))
            name = '{0} [COLOR blue][{1}][/COLOR]'.format(
                name, utils.get_country(cam.get('countryCode')))
        if cam.get('languages'):
            langs = [utils.get_language(lang) for lang in cam.get('languages')]
            subject += '[COLOR deeppink]Languages:[/COLOR] {}[CR]'.format(
                ', '.join(langs))
        if cam.get('resolution'):
            subject += '[COLOR deeppink]Resolution:[/COLOR] {}[CR]'.format(
                cam.get('resolution'))
        if cam.get('sexPreference'):
            subject += '[CR][COLOR deeppink]Sexual Preference:[/COLOR] {}[CR]'.format(
                cam.get('sexPreference'))
        if cam.get('statusMessage'):
            subject += '[CR]{}[CR][CR]'.format(
                cam.get('statusMessage').encode('utf8') if utils.PY2 else cam.
                get('statusMessage'))
        if cam.get('showTags'):
            subject += ', '.join(cam.get('showTags')).encode(
                'utf8') if utils.PY2 else ', '.join(cam.get('showTags'))

        site.add_download_link(name,
                               cam.get('hlsPreviewUrl'),
                               'Playvid',
                               img,
                               subject,
                               noDownload=True,
                               quality=hd)

    utils.eod()
Ejemplo n.º 18
0
def topCams(url):
    response = utils._getHtml(url)
    jsonTop = json.loads(response)['top']
    for iTop in jsonTop:
        subject = 'Name: ' + iTop['room_user'] + '\n'
        subject = subject + 'Points: ' + str(iTop['points']) + '\n'
        subject = subject + 'Watching: ' + str(iTop['viewers'])
        site.add_download_link(iTop['room_user'], bu + iTop['room_user'] + '/', 'Playvid',
                               iTop['image_url'], subject, noDownload=True)
    utils.eod()
Ejemplo n.º 19
0
def Tags(url):
    url = site.url + 'php/model_tags.php?get_tags=1&tag_sort=&word_source=tags&display_style=list&member_mode=0'

    page = utils._getHtml(url)
    res = re.compile(r"g_oTags.SelectTag\('selected_field','(.+?)'.+?10px.+?>(.+?)<", re.IGNORECASE | re.MULTILINE | re.DOTALL).findall(page)

    for item, models in res:
        url = site.url + 'php/model_tags.php?get_users=1&selected_field={0}&display_style=list'.format(urllib_parse.quote_plus(item)) \
            + '&word_source=tags&member_mode=0&page=1&stand_alone=true'
        site.add_dir('{0} [COLOR hotpink]{1}[/COLOR]'.format(item, models), url, 'TagsList', '', '')
    utils.eod()
Ejemplo n.º 20
0
def List(url, page=1):
    listhtml = utils._getHtml(url)
    res = re.compile(r"avatar_border\s*src=([^\s]+).+?:19px;'>([^<]+).+?<X>(.+?)<X>", re.IGNORECASE | re.DOTALL).findall(listhtml)

    for img, name, plot in res:
        img = img.replace('100x100', '300x300')
        site.add_download_link(name, name, 'Playvid', img, utils.cleantext(plot), noDownload=True)

    if len(res) >= 50:
        page += 1
        site.add_dir('Next Page... [COLOR hotpink]({0})[/COLOR]'.format(page), url[:-1] + str(page), 'List', site.img_next, page)
    utils.eod()
Ejemplo n.º 21
0
def Categories(url):
    cathtml = utils._getHtml(site.url + 'filter/videos', url)
    cats = cathtml.split('citem__link')
    cats.pop(0)
    cats.pop(0)
    for cat in cats:
        match = re.compile('href="([^"]+).+?src="([^"]+).+?title">([^<]+)',
                           re.DOTALL | re.IGNORECASE).findall(cat)
        if match:
            catpage, catimg, name = match[0]
            catpage = 'https:' + catpage if catpage.startswith(
                '//') else catpage
            catimg = 'https:' + catimg if catimg.startswith('//') else catimg
            site.add_dir(name, catpage, 'List', catimg)
    utils.eod()
Ejemplo n.º 22
0
def List(url, page=1):
    if utils.addon.getSetting("chaturbate") == "true":
        clean_database(False)
    try:
        data = utils._getHtml(url + "&page_number=" + str(page))
    except:
        return None
    model_list = json.loads(data)
    for camgirl in model_list['Results']:
        img = "http://m1.nsimg.net/media/snap/{0}.jpg".format(camgirl['PerformerId'])
        status = 'HD' if camgirl['HD'] else ''
        name = "{0} [COLOR deeppink][{1}][/COLOR] {2}".format(camgirl['Nickname'], camgirl['Age'], status)
        subject = '{0}[CR][COLOR deeppink]Location: [/COLOR]{1}'.format(utils.cleantext(camgirl['Headline']), camgirl['Country'])
        site.add_download_link(name, '{0}$${1}'.format(camgirl['Nickname'], camgirl['PerformerId']), 'Playvid', img, subject, noDownload=True)
    npage = page + 1
    site.add_dir('Next Page (' + str(npage) + ')', url, 'List', site.img_next, npage)
    utils.eod()
Ejemplo n.º 23
0
def List(url, page=1):
    if utils.addon.getSetting("chaturbate") == "true":
        clean_database(False)
    url = '{0}/directoryCams?directoryJson=true&online=true&url=true&orderBy=VIDEO_QUALITY&resultsPerPage=1500{1}'.format(
        site.url, url)
    listhtml = utils._getHtml(url, headers=IOS_UA)
    cams = json.loads(listhtml).get('users', {})
    for cam in cams:
        name = cam.get('username')
        videourl = "{0}/{1}".format(site.url, name)

        age = cam.get('age')
        if age:
            name = '{0} [COLOR deeppink][{1}][/COLOR]'.format(name, age)
        if cam.get('hdStream'):
            name = '{0} [COLOR limegreen][HD][/COLOR]'.format(name)
        img = cam.get('snapshotImageLink')
        if not img:
            img = cam.get('defaultImageLink')

        subject = ''
        if cam.get('viewers'):
            subject += 'Viewers: {}[CR]'.format(cam.get('viewers'))
        if cam.get('resolution'):
            subject += 'Resolution: {}[CR]'.format(cam.get('resolution'))
        if cam.get('sexPreference'):
            subject += '[CR]Sexual Preference: {}[CR]'.format(
                cam.get('sexPreference'))
        if cam.get('statusMessage'):
            subject += '[CR]{}[CR][CR]'.format(
                cam.get('statusMessage').encode('utf8') if utils.PY2 else cam.
                get('statusMessage'))
        if cam.get('showTags'):
            for tag in cam.get('showTags'):
                subject += '{}, '.format(tag)
            subject = subject[:-2]

        site.add_download_link(name,
                               videourl,
                               'Playvid',
                               img,
                               subject,
                               noDownload=True)

    utils.eod()
Ejemplo n.º 24
0
def Playvid(url, name):
    playmode = int(addon.getSetting('chatplay'))
    listhtml = utils._getHtml(url, headers=HTTP_HEADERS_IPAD)

    r = re.search(r'initialRoomDossier\s*=\s*"([^"]+)', listhtml)
    if r:
        data = six.b(r.group(1)).decode('unicode-escape')
        data = data if six.PY3 else data.encode('utf8')
        data = json.loads(data)
    else:
        data = False

    if data:
        m3u8stream = data['hls_source']
    else:
        m3u8stream = False

    if playmode == 0:
        if m3u8stream:
            videourl = "{0}|{1}".format(
                m3u8stream, urllib_parse.urlencode(HTTP_HEADERS_IPAD))
        else:
            utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
            return

    elif playmode == 1:
        if data:
            streamserver = "rtmp://{}/live-edge".format(data['flash_host'])
            modelname = data['broadcaster_username']
            username_full = data['viewer_username']
            username = '******'
            room_pass = data['room_pass']
            swfurl = 'https://ssl-ccstatic.highwebmedia.com/theatermodeassets/CBV_TS_v1.0.swf'
            edge_auth = data['edge_auth']
            videourl = "%s app=live-edge swfUrl=%s pageUrl=%s conn=S:%s conn=S:%s conn=S:3.22 conn=S:%s conn=S:%s conn=S:%s playpath=mp4" % (
                streamserver, swfurl, url, username_full, modelname, username,
                room_pass, edge_auth)
        else:
            utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
            return

    vp = utils.VideoPlayer(name)
    vp.play_from_direct_link(videourl)
Ejemplo n.º 25
0
def List2(url):
    site.add_download_link('[COLOR red][B]Refresh[/B][/COLOR]',
                           url,
                           'utils.refresh',
                           '',
                           '',
                           noDownload=True)
    if utils.addon.getSetting("online_only") == "true":
        url = url + '?online_only=1'
        site.add_download_link('[COLOR red][B]Show all models[/B][/COLOR]',
                               url,
                               'online',
                               '',
                               '',
                               noDownload=True)
    else:
        site.add_download_link(
            '[COLOR red][B]Show only models online[/B][/COLOR]',
            url,
            'online',
            '',
            '',
            noDownload=True)

    if utils.addon.getSetting("chaturbate") == "true":
        clean_database(False)
    headers = {'X-Requested-With': 'XMLHttpRequest'}
    data = utils._getHtml(url, site.url, headers=headers)
    match = re.compile('class="top_ranks(.+?)class="title_h3',
                       re.I | re.M | re.S).findall(data)
    if not match:
        match = re.compile('class="top_others(.+?)class="title_h3',
                           re.I | re.M | re.S).findall(data)
    match = re.compile(
        'class="top_thumb".+?href="([^"]+)".+?src="([^"]+)".+?class="mn_lc">(.+?)</span>',
        re.I | re.M | re.S).findall(match[0])
    for url, img, name in match:
        if 'profile' in url:
            name = '[COLOR hotpink][Offline][/COLOR] ' + name
            url = "  "
        site.add_download_link(name, url[1:], 'Playvid', 'https:' + img, '')
    utils.eod()
Ejemplo n.º 26
0
def onlineFav(url):
    wmArray = [
        "C9m5N", "tfZSl", "jQrKO", "5XO2a", "WXomN", "zM6MR", "Lb2aB", "cIbs3",
        "zM6MR", "mnzQo", "N6TZA"
    ]
    chaturbate_url = 'https://chaturbate.com/affiliates/api/onlinerooms/?format=json&wm=' + random.choice(
        wmArray)
    data_chat = utils._getHtml(chaturbate_url, '')
    model_list = json.loads(data_chat)
    conn = sqlite3.connect(utils.favoritesdb)
    conn.text_factory = str
    c = conn.cursor()
    c.execute(
        "SELECT DISTINCT name, url, image FROM favorites WHERE mode='chaturbate.Playvid'"
    )
    result = c.fetchall()
    c.close()
    for (name, url, image) in result:
        model = [
            item for item in model_list
            if item["username"] in name.split('[COLOR')[0]
        ]
        if model:
            image = model[0]["image_url"]
            current_show = ''
            if "current_show" in model[0]:
                if model[0]["current_show"] != "public":
                    current_show = '[COLOR blue] {}[/COLOR]'.format(
                        model[0]["current_show"])
            room_subject = model[0]["room_subject"] if utils.PY3 else model[0][
                "room_subject"].encode('utf8')
            site.add_download_link(name + current_show,
                                   url,
                                   'Playvid',
                                   image,
                                   utils.cleantext(room_subject),
                                   noDownload=True)
    utils.eod()
Ejemplo n.º 27
0
def PTSubscribe_pornstar(url, id, what='subscribe'):
    url = url + '/' if not url.endswith('/') else url
    suburl = '%s?mode=async&format=json&action=subscribe&subscribe_model_id=%s' % (
        url, id)
    if what == 'unsubscribe':
        suburl = suburl.replace('subscribe', 'unsubscribe')
    response = utils._getHtml(suburl, url)
    if 'success' in response.lower():
        success = True
    else:
        if what == 'unsubscribe':
            utils.notify(
                'Failure',
                'Failure removing the pornstar from your subscriptions')
        else:
            utils.notify('Failure',
                         'Failure adding the pornstar to your subscriptions')
        success = False
    if what == 'unsubscribe':
        utils.notify('Success',
                     'Pornstar removed successfull from your subscriptions')
        xbmc.executebuiltin('Container.Refresh')
    return success
Ejemplo n.º 28
0
def PTSubscribe_pornstar(url, id=None, what='subscribe'):
    if not id:
        url2 = url.split('?')[0]
        try:
            modelhtml = utils.getHtml(url2)
        except:
            return None
        id = re.findall(r'(?si)data-subscribe-to="model" data-id="(\d+)"',
                        modelhtml)[0]

    url = url2 if '?' in url else url
    url = url + '/' if not url.endswith('/') else url

    suburl = '%s?mode=async&format=json&action=subscribe&subscribe_model_id=%s' % (
        url, id)
    if what == 'unsubscribe':
        suburl = suburl.replace('subscribe', 'unsubscribe')
    response = utils._getHtml(suburl, url)
    if 'success' in response.lower():
        success = True
        utils.notify('Success',
                     'Pornstar added successfull to your subscriptions')
    else:
        if what == 'unsubscribe':
            utils.notify(
                'Failure',
                'Failure removing the pornstar from your subscriptions')
        else:
            utils.notify('Failure',
                         'Failure adding the pornstar to your subscriptions')
        success = False
    if what == 'unsubscribe':
        utils.notify('Success',
                     'Pornstar removed successfull from your subscriptions')
        xbmc.executebuiltin('Container.Refresh')
    return success
Ejemplo n.º 29
0
def Country(url):
    countries = {
        'Afghanistan': 'af',
        'Argentina': 'ar',
        'Australia': 'au',
        'Austria': 'at',
        'Azerbaijan': 'az',
        'Bangladesh': 'bd',
        'Belgium': 'be',
        'Bolivia': 'bo',
        'Brazil': 'br',
        'Bulgaria': 'bg',
        'Cambodia': 'kh',
        'Cameroon': 'cm',
        'Canada': 'ca',
        'Chile': 'cl',
        'China': 'cn',
        'Colombia': 'co',
        'Cyprus': 'cy',
        'Czech Republic': 'cz',
        'Denmark': 'dk',
        'Dominican Republic': 'do',
        'Ecuador': 'ec',
        'Egypt': 'eg',
        'Finland': 'fi',
        'France': 'fr',
        'Georgia': 'ge',
        'Germany': 'de',
        'Greece': 'gr',
        'Guatemala': 'gt',
        'Hong Kong': 'hk',
        'Hungary': 'hu',
        'Iceland': 'is',
        'India': 'in',
        'Indonesia': 'id',
        'Iraq': 'iq',
        'Ireland': 'ie',
        'Israel': 'il',
        'Italy': 'it',
        'Japan': 'jp',
        'Jordan': 'jo',
        'Kenya': 'ke',
        'Korea': 'kr',
        'Lao People\'s Democratic Republic': 'la',
        'Latvia': 'lv',
        'Lebanon': 'lb',
        'Malaysia': 'my',
        'Malta': 'mt',
        'Mexico': 'mx',
        'Moldova, Republic of': 'md',
        'Morocco': 'ma',
        'Myanmar': 'mm',
        'Netherlands': 'nl',
        'New Zealand': 'nz',
        'Nigeria': 'ng',
        'Norway': 'no',
        'Pakistan': 'pk',
        'Peru': 'pe',
        'Philippines': 'ph',
        'Poland': 'pl',
        'Portugal': 'pt',
        'Qatar': 'qa',
        'Romania': 'ro',
        'Russia': 'ru',
        'Senegal': 'sn',
        'Serbia': 'rs',
        'Singapore': 'sg',
        'Slovakia': 'sk',
        'South Africa': 'za',
        'Spain': 'es',
        'Sri Lanka': 'lk',
        'Sweden': 'se',
        'Switzerland': 'ch',
        'Taiwan': 'tw',
        'Tanzania, United Republic of': 'tz',
        'Thailand': 'th',
        'Tunisia': 'tn',
        'USA': 'us',
        'Ukraine': 'ua',
        'United Kingdom': 'gb',
        'Venezuela': 've',
        'Vietnam': 'vn'
    }
    country = utils.selector('Select country', countries.keys())
    if country:
        utils.addon.setSetting('xvideoscountry', country)
        curl = '{}change-country/{}'.format(site.url, countries[country])
        utils._getHtml(curl, site.url)
        utils.clear_cache()
        xbmc.executebuiltin('Container.Refresh')