Пример #1
0
def Playvid(url, name, download=0):
    info = ''
    listhtml = utils.getHtml('https://www.cam4.com/' + name)
    listhtml = listhtml.replace('><', '> <')
    match = re.compile(
        r'<span class="desc">(.+?)</span>.*?(class="field.+?>(.+?)</|</li>)',
        re.DOTALL | re.IGNORECASE).findall(listhtml)
    for desc, dummy, field in match:
        info = info + "[B]" + desc + "[/B] " + field + "\n"
    videourl = url
    iconimage = xbmc.getInfoImage("ListItem.Thumb")
    listitem = xbmcgui.ListItem(name,
                                iconImage="DefaultVideo.png",
                                thumbnailImage=iconimage)
    listitem.setInfo('video', {'Title': name, 'Genre': 'Cam4', 'Plot': info})
    listitem.setProperty("IsPlayable", "true")
    if int(sys.argv[1]) == -1:
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(videourl, listitem)
        xbmc.Player().play(pl)
    else:
        listitem.setPath(str(videourl))
        xbmcplugin.setResolvedUrl(utils.addon_handle, True, listitem)
    if utils.addon.getSetting("dwnld_stream") == "true" or download == 1:
        utils.dwnld_stream(videourl, name)
Пример #2
0
def Playvid(url, name, download=0):
    global MFC_SERVERS
    MFC_SERVERS = {}

    serverlist = utils.getHtml2('https://new.myfreecams.com/server')
    jsonlist = simplejson.loads(serverlist)

    MFC_SERVERS['WZOBSSERVERS'] = jsonlist["wzobs_servers"]
    MFC_SERVERS['H5SERVERS'] = jsonlist["h5video_servers"]
    MFC_SERVERS['NGSERVERS'] = jsonlist["ngvideo_servers"]
    MFC_SERVERS['CHATSERVERS'] = jsonlist["chat_servers"]

    videourl = myfreecam_start(url)

    if videourl:
        iconimage = xbmc.getInfoImage("ListItem.Thumb")
        listitem = xbmcgui.ListItem(name,
                                    iconImage="DefaultVideo.png",
                                    thumbnailImage=iconimage)
        listitem.setInfo('video', {'Title': name, 'Genre': 'P**n'})
        listitem.setProperty("IsPlayable", "true")
        if int(sys.argv[1]) == -1:
            pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
            pl.clear()
            pl.add(videourl, listitem)
            xbmc.Player().play(pl)
        else:
            listitem.setPath(str(videourl))
            xbmcplugin.setResolvedUrl(utils.addon_handle, True, listitem)
        if utils.addon.getSetting("dwnld_stream") == "true" or download == 1:
            utils.dwnld_stream(videourl, name)
    else:
        utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
Пример #3
0
def Playvid(url, name, download=0):
    try:
        listhtml = utils.getHtml(url, '')
    except:
        return None
    media = re.compile('mediaDefinition: (.+?),\n',
                       re.DOTALL | re.IGNORECASE).findall(listhtml)[0]
    movieJson = json.loads(media)
    movieJson = sorted([
        item for item in json.loads(media)
        if ('hls' in item['format'] and item['defaultQuality'] == False)
    ],
                       key=lambda x: int(x['quality']),
                       reverse=True)
    choice = xbmcgui.Dialog().select(
        'Select resolution', [str(item['quality']) for item in movieJson])
    if choice == -1: return
    videourl = movieJson[choice]['videoUrl']
    iconimage = xbmc.getInfoImage("ListItem.Thumb")
    listitem = xbmcgui.ListItem(name,
                                iconImage="DefaultVideo.png",
                                thumbnailImage=iconimage)
    listitem.setInfo('video', {'Title': name, 'Genre': 'RedTube'})
    xbmc.Player().play(videourl, listitem)
    if utils.addon.getSetting("dwnld_stream") == "true" or download == 1:
        utils.dwnld_stream(videourl, name)
Пример #4
0
def Playvid(username, name, download=0):
    try:
        postRequest = {
            'method': 'getRoomData',
            'args[]': 'false',
            'args[]': str(username)
        }
        response = utils.postHtml(
            'http://bongacams.com/tools/amf.php',
            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_' + username + '.m3u8'
    else:
        videourl = 'https:' + amf_json['localData'][
            'videoServerUrl'] + '/hls/stream_' + username + '/playlist.m3u8'

    iconimage = xbmc.getInfoImage("ListItem.Thumb")
    listitem = xbmcgui.ListItem(name,
                                iconImage="DefaultVideo.png",
                                thumbnailImage=iconimage)
    listitem.setInfo('video', {'Title': name, 'Genre': 'P**n'})
    listitem.setProperty("IsPlayable", "true")
    if int(sys.argv[1]) == -1:
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(videourl, listitem)
        xbmc.Player().play(pl)
    else:
        listitem.setPath(str(videourl))
        xbmcplugin.setResolvedUrl(utils.addon_handle, True, listitem)
    if utils.addon.getSetting("dwnld_stream") == "true" or download == 1:
        utils.dwnld_stream(videourl, username)
Пример #5
0
def Playvid(url, name, download=0):
    url = url + "?username=guest_" + str(random.randrange(100, 55555))
    response = utils.getHtml(url)
    data = json.loads(response)
    print(json.dumps(data, indent=4, sort_keys=True))
    if len(data["edge_servers"]) == 0:
        utils.notify('Model is Offline or Private')
        return None
    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 "edge" in data["edge_servers"][0]:
        videourl = "https://" + data["edge_servers"][0] + "/" + data[
            "stream_name"] + "_h264_aac_720p/index.m3u8?token=" + data["token"]
    else:
        videourl = "https://" + data["edge_servers"][0] + "/" + data[
            "app"] + "/mp4:" + data[
                "stream_name"] + "_aac/mono.m3u8?token=" + data["token"]
    print "VideoURL: " + videourl
    iconimage = xbmc.getInfoImage("ListItem.Thumb")
    listitem = xbmcgui.ListItem(name,
                                iconImage="DefaultVideo.png",
                                thumbnailImage=iconimage)
    listitem.setInfo('video', {'Title': name, 'Genre': 'P**n'})
    listitem.setProperty("IsPlayable", "true")
    if int(sys.argv[1]) == -1:
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(videourl, listitem)
        xbmc.Player().play(pl)
    else:
        iconimage = xbmc.getInfoImage("ListItem.Thumb")
        listitem = xbmcgui.ListItem(name,
                                    iconImage="DefaultVideo.png",
                                    thumbnailImage=iconimage)
        listitem.setInfo('video', {'Title': name, 'Genre': 'CamSoda'})
        xbmc.Player().play(videourl, listitem)
    if utils.addon.getSetting("dwnld_stream") == "true" or download == 1:
        utils.dwnld_stream(videourl, name)
Пример #6
0
def Playvid(url, name, download=0):
    playmode = int(addon.getSetting('chatplay'))
    chatslow = int(addon.getSetting('chatslow'))
    listhtml = utils.getHtml(url, hdr=cbheaders)
    iconimage = xbmc.getInfoImage("ListItem.Thumb")
    info = ""

    listhtml = listhtml.replace('\\u0022', '"')
    m3u8url = re.compile(r'"hls_source":\s*"([^"]+m3u8)"',
                         re.DOTALL | re.IGNORECASE).findall(listhtml)
    listhtml2 = listhtml.replace('<div class="data"></div>',
                                 '<div class="data"> </div>')
    match = re.compile(
        r'<div class="label">(.+?)</div>.+?<div class="data">(.+?)</div>',
        re.DOTALL | re.IGNORECASE).findall(listhtml2)
    for label, data in match:
        if label != "About Me:" and label != "Wish List:" and data != "None":
            info = info + "[B]" + label + "[/B] " + data + "\n"
        info = info.replace("&amp;", "&").replace("&lt;", "<").replace(
            "&gt;", ">").replace("&#39;", "'").replace("&quot;", '"')

    if m3u8url:
        m3u8stream = m3u8url[0].replace('\\u002D', '-')
        if chatslow == 1:
            m3u8stream = m3u8stream.replace('_fast', '')
    else:
        m3u8stream = False

    if playmode == 0:
        if m3u8stream:
            videourl = m3u8stream
        else:
            utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
            return

    elif playmode == 1:
        if m3u8stream:
            from F4mProxy import f4mProxyHelper
            f4mp = f4mProxyHelper()
            f4mp.playF4mLink(m3u8stream,
                             name,
                             proxy=None,
                             use_proxy_for_chunks=False,
                             maxbitrate=0,
                             simpleDownloader=False,
                             auth=None,
                             streamtype='HLS',
                             setResolved=False,
                             swf=None,
                             callbackpath="",
                             callbackparam="",
                             iconImage=iconimage)
            return
        else:
            utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
            return

    elif playmode == 2:
        flv_info = []
        embed = re.compile(r"EmbedViewerSwf\(*(.+?)\);",
                           re.DOTALL).findall(listhtml)[0]
        for line in embed.split("\n"):
            data = re.search("""\s+["']([^"']+)["'],""", line)
            if data:
                flv_info.append(data.group(1))

        streamserver = "rtmp://%s/live-edge" % (flv_info[2])
        modelname = flv_info[1]
        username = flv_info[8]
        password = urllib.unquote(flv_info[12])
        unknown = flv_info[13]
        swfurl = "https://chaturbate.com/static/flash/CBV_2p650.swf"

        videourl = "%s app=live-edge swfUrl=%s tcUrl=%s pageUrl=http://chaturbate.com/%s/ conn=S:%s conn=S:%s conn=S:2.650 conn=S:%s conn=S:%s playpath=mp4" % (
            streamserver, swfurl, streamserver, modelname, username, modelname,
            password, unknown)

    listitem = xbmcgui.ListItem(name,
                                iconImage="DefaultVideo.png",
                                thumbnailImage=iconimage)
    listitem.setInfo('video', {'Title': name, 'Genre': 'P**n', 'Plot': info})
    listitem.setProperty("IsPlayable", "true")
    xbmc.Player().play(videourl, listitem)

    username = name.split('[')[0].strip()
    if addon.getSetting("dwnld_stream") == "true" or download == 1:
        utils.dwnld_stream(videourl, username)
Пример #7
0
def Playvid(performerID, name, download=0):
    response = utils.getHtml(
        "https://streamate.com/ajax/config/?name=" + name +
        "&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"  #24824942
    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
            link = 'https://sea1b-ls.naiadsystems.com/sea1b-edge-ls/80/live/s:' + data[
                'performer']['nickname'] + '.json'
            ref = 'https://www.streamate.com/cam/' + data['performer'][
                'nickname']
            j = utils.getHtml(link, ref)
            match = re.compile('location":"([^"]+)"',
                               re.DOTALL | re.IGNORECASE).findall(j)
            videourl = match[0]

        # match = re.compile('roomInfoUpdate', re.DOTALL | re.IGNORECASE).findall(message)
        # if match:
        # ws.send('42/live,["GetVideoPath",{"nginx":1,"protocol":2,"attempt":1}]')
        # while quitting == 0:
        # message = ws.recv()
        # match = re.compile('(http[^"]+m3u8)', re.DOTALL | re.IGNORECASE).findall(message)
        # if match:
        # videourl = match[0]
        # quitting=1
        # ws.close()

    iconimage = xbmc.getInfoImage("ListItem.Thumb")
    listitem = xbmcgui.ListItem(name,
                                iconImage="DefaultVideo.png",
                                thumbnailImage=iconimage)
    listitem.setInfo('video', {'Title': name, 'Genre': 'Streamate'})
    listitem.setProperty("IsPlayable", "true")
    if int(sys.argv[1]) == -1:
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(videourl, listitem)
        xbmc.Player().play(pl)
    else:
        #iconimage = xbmc.getInfoImage("ListItem.Thumb")
        #listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
        #listitem.setInfo('video', {'Title': name, 'Genre': 'P**n'})
        xbmc.Player().play(videourl, listitem)
    if utils.addon.getSetting("dwnld_stream") == "true" or download == 1:
        utils.dwnld_stream(videourl, name)
Пример #8
0
def PlayCam(url, name, check=False, download=0):
    global CAMGIRLPLOT
    global NAME
    CAMGIRLPLOT = ''
    payload = {
        "name": "%s" % name,
        "sabasic": "",
        "sakey": "",
        "sk": "www.redtube.com",
        "userid": 0,
        "version": "9.48.1",
        "platform": "blacklabel",
        "shownFeatures": [],
        "useDebugPerformerData": "false"
    }
    r = requests.post(
        'https://hybridclient.naiadsystems.com/api/v3/setupplayer/',
        data=payload).text
    pJson = json.loads(r)
    if 'error' in pJson:
        utils.notify(name, pJson['msg'])
        return
    performerId = pJson['config']['performer']['id']
    stream = pJson['config']['stream']
    attribJson = pJson['performer']['About']['Attributes']
    NAME = attribJson['Name']

    wssUrl = stream['nodeHost'] + '/socket.io/?performerid=' + str(
        performerId
    ) + '&sserver=' + stream['serverId'] + '&streamid=' + stream[
        'streamId'] + '&sakey=&sessiontype=preview&perfdiscountid=0&minduration=0&goldshowid=0&version=7&referrer=blacklabel/hybrid.client.9.48.1/avchat.swf&usertype=false&lang=en&EIO=3&transport=websocket'
    #utils.kodilog('REDTUBE LIVE wss: ' + wssUrl)
    roomid = get_roomid(wssUrl)
    if not roomid:
        return
    server = pJson['config']['liveservices']['host'].replace(
        'wss:', 'https:') + '/videourl?payload={"puserid":' + str(
            performerId) + ',"roomid":"' + roomid + '","showtype":1,"nginx":1}'
    with requests.get(server) as req:
        r = json.loads(req.text)[0]['url']
    with requests.get(r) as req1:
        try:
            encodings = json.loads(
                req1.text)['formats']['mp4-hls']['encodings']
        except:
            utils.notify(name, 'I\'m currently performing live...')
            return

    sort = sorted(encodings, key=lambda x: int(x['videoWidth']), reverse=True)
    choice = xbmcgui.Dialog().select(
        'Select resolution', [str(item['videoWidth']) for item in sort])
    if choice == -1: return
    videourl = sort[choice]['location']

    CAMGIRLPLOT = CAMGIRLPLOT + '\n[B]Name:[/B] ' + attribJson['Name']
    CAMGIRLPLOT = CAMGIRLPLOT + '\n[B]Country:[/B] ' + attribJson['Country']
    CAMGIRLPLOT = CAMGIRLPLOT + '\n[B]Age:[/B] ' + str(attribJson['Age'])
    CAMGIRLPLOT = CAMGIRLPLOT + '\n[B]Height:[/B] ' + attribJson['Height']
    CAMGIRLPLOT = CAMGIRLPLOT + '\n[B]Weight:[/B] ' + attribJson['Weight']
    CAMGIRLPLOT = CAMGIRLPLOT + '\n[B]About my show:[/B] ' + pJson[
        'performer']['About']['AboutMyShow']
    CAMGIRLPLOT = CAMGIRLPLOT + '\n[B]Last performance:[/B] ' + pJson[
        'performer']['About']['LastPerformance']

    iconimage = xbmc.getInfoImage("ListItem.Thumb")
    listitem = xbmcgui.ListItem(name,
                                iconImage="DefaultVideo.png",
                                thumbnailImage=iconimage)
    listitem.setInfo('video', {
        'Title': name,
        'Genre': 'RedTube Live',
        'Plot': CAMGIRLPLOT
    })
    listitem.setProperty("IsPlayable", "true")

    xbmc.Player().play(videourl, listitem)
    if utils.addon.getSetting("dwnld_stream") == "true" or download == 1:
        utils.dwnld_stream(videourl, name)