def Playvid(url, name): vp = utils.VideoPlayer(name) vp.progress.update(25, "[CR]Loading video page[CR]") try: postRequest = {'method': 'getRoomData', 'args[]': str(url)} response = utils._postHtml( '{0}/tools/amf.php'.format(site.url), form_data=postRequest, headers={'X-Requested-With': 'XMLHttpRequest'}, compression=False) except: utils.notify('Oh oh', 'Couldn\'t find a playable webcam link') return None amf_json = json.loads(response) if amf_json['localData']['videoServerUrl'].startswith("//mobile"): videourl = 'https:' + amf_json['localData'][ 'videoServerUrl'] + '/hls/stream_' + url + '.m3u8' else: videourl = 'https:' + amf_json['localData'][ 'videoServerUrl'] + '/hls/stream_' + url + '/playlist.m3u8' videourl += '|User-Agent={0}'.format(utils.USER_AGENT) vp.progress.update(75, "[CR]Found Stream[CR]") vp = utils.VideoPlayer(name) vp.play_from_direct_link(videourl)
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
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
def Playvid(url, name): vp = utils.VideoPlayer(name) vp.progress.update(25, "[CR]Loading video page[CR]") try: postRequest = [('method', 'getRoomData'), ('args[]', str(url)), ('args[]', ''), ('args[]', '')] hdr = utils.base_hdrs hdr.update({ 'Cookie': 'bonga20120608=4dc36bf33c316636a744faef8379be54', 'X-ab-Split-Group': 'f2085b5fd8de2b4f7c9542009568798a157a99eeeb710d9679acca6621f17672793720ada24e7a68', 'X-Requested-With': 'XMLHttpRequest' }) response = utils._postHtml('{0}tools/amf.php'.format(site.url), form_data=postRequest, headers=hdr, compression=False) except: utils.notify('Oh oh', 'Couldn\'t find a playable webcam link', icon='thumb') return None amf_json = json.loads(response) if amf_json['status'] == 'error': utils.notify('Oh oh', 'Couldn\'t find a playable webcam link', icon='thumb') return if amf_json.get('performerData', {}).get('showType') == 'private': utils.notify(name, 'Model in private chat', icon='thumb') vp.progress.close() return amf = amf_json.get('localData', {}).get('videoServerUrl') if amf is None: utils.notify(name, 'Model Offline', icon='thumb') vp.progress.close() return elif amf.startswith("//mobile"): videourl = 'https:' + amf + '/hls/stream_' + url + '.m3u8' else: videourl = 'https:' + amf + '/hls/stream_' + url + '/playlist.m3u8' videourl += '|User-Agent={0}'.format(utils.USER_AGENT) vp.progress.update(75, "[CR]Found Stream[CR]") vp.play_from_direct_link(videourl)