コード例 #1
0
ファイル: chaturbate.py プロジェクト: moedje/naughty
def List(url, page=1):
    if addon.getSetting("chaturbate") == "true":
        clean_database(False)
    try:
        listhtml = utils.getHtml2(url)
    except:
        utils.notify('Oh oh', 'It looks like this website is down.')
        return None
    match = re.compile(
        r'<li>\s+<a href="([^"]+)".*?src="([^"]+)".*?<div[^>]+>([^<]+)</div>.*?href[^>]+>([^<]+)<.*?age[^>]+>([^<]+)<',
        re.DOTALL | re.IGNORECASE).findall(listhtml)
    for videopage, img, status, name, age in match:
        name = utils.cleantext(name.strip())
        status = status.replace("\n", "").strip()
        name = name + " [COLOR deeppink][" + age + "][/COLOR] " + status
        videopage = "https://chaturbate.com" + videopage
        utils.addDownLink(name, videopage, 222, img, '', noDownload=True)
    try:
        page = page + 1
        nextp = re.compile('<a href="([^"]+)" class="next',
                           re.DOTALL | re.IGNORECASE).findall(listhtml)
        next = "https://chaturbate.com" + nextp[0]
        utils.addDir('Next Page (' + str(page) + ')', next, 221, '', page)
    except:
        pass
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #2
0
def BGPpl(url):
    bgversion = addon.getSetting('bgversion')
    caturl = utils.getHtml2(url)
    cats = json.loads(caturl)['people']
    for cat in cats:
        videolist = '{0}{1}/index/people/0/pc?search_mode=code&people={2}'.format(
            site.url, bgversion, urllib_parse.quote(cat['code']))
        title = cat['name'] if utils.PY3 else cat['name'].encode('utf8')
        name = title + ' [COLOR yellow]({0} videos)[/COLOR]'.format(
            cat['videos'])
        if cat['image']:
            image = 'https://thumbs.beeg.com/img/cast/{0}.png'.format(
                cat['id'])
        else:
            image = 'https://beeg.com/img/user-placeholder.39f16436.jpg'
        site.add_dir(name, videolist, 'BGList', image)

    if len(cats) == 100:
        if '?' in url:
            url, offset = url.split('?')
            offset = int(offset.split('=')[-1])
        else:
            offset = 0
        url = url.split('?')[0] + '?offset={0}'.format(offset + 100)
        site.add_dir('Next Page...', url, 'BGPpl', site.img_next)

    utils.eod()
コード例 #3
0
def List(url, page=1):
    if addon.getSetting("chaturbate") == "true":
        clean_database(False)
    try:
        listhtml = utils.getHtml2(url)
    except:

        return None
    match = re.compile(
        r'<li.+?data-slug="(.+?)".+?<a href="(\/.+?)".+?<img\s+src="(.+?)".+?_label.+?>(.+?)<.+?age.+?>(.+?)<',
        re.DOTALL | re.IGNORECASE).findall(listhtml)
    for name, videopage, img, status, age in match:

        age = utils.cleantext(age.strip())
        name = utils.cleantext(name.strip())
        status = status.replace("\n", "").strip()
        name = name + " [COLOR deeppink][" + age + "][/COLOR] " + status
        videopage = "https://chaturbate.com" + videopage
        utils.addDownLink(name, videopage, 222, img, '', noDownload=True)
    try:
        page = page + 1
        nextp = re.compile('<a href="([^"]+)" class="next',
                           re.DOTALL | re.IGNORECASE).findall(listhtml)
        next = "https://chaturbate.com" + nextp[0]
        utils.addDir('Next Page (' + str(page) + ')', next, 221, '', page)
    except:
        pass
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #4
0
def List(url, page=1):
    if addon.getSetting("chaturbate") == "true":
        clean_database(False)
    try:
        listhtml = utils.getHtml2(url)
    except:

        return None
    listhtml = listhtml.replace('title=""', 'title=" "')
    match = re.compile(
        r'<li.+?data-slug="(.+?)".+?<a href="(\/.+?)".+?<img\s+src="(.+?)".+?_label.+?>(.+?)<.+?age.+?gender(.+?).+?>(.+?)<.+?<li title="(.+?)".+?class="location".+?>(.+?)<.+?class="cams">(.+?)<',
        re.DOTALL | re.IGNORECASE).findall(listhtml)
    for name, videopage, img, status, gender, age, roomtopic, location, activity in match:

        age = utils.cleantext(age.strip())
        name = utils.cleantext(name.strip())
        status = status.replace("\n", "").strip()
        name = name + " [COLOR deeppink][" + age + "][/COLOR] " + status
        videopage = "https://chaturbate.com" + videopage
        info = "\n\n[B]Status:[/B] " + status + "\n\n[B]Gender:[/B] " + genders[
            gender] + "\n\n[B]Age:[/B] " + age + "\n\n[B]Location:[/B] " + location + "\n\n[B]Activity:[/B] " + activity + "\n\n[B]Room topic:[/B] " + roomtopic
        info = info.replace("&amp;", "&").replace("&lt;", "<").replace(
            "&gt;", ">").replace("&#39;", "'").replace("&quot;", '"')
        utils.addDownLink(name, videopage, 222, img, info)
    try:
        page = page + 1
        nextp = re.compile('<a href="([^"]+)" class="next',
                           re.DOTALL | re.IGNORECASE).findall(listhtml)
        next = "https://chaturbate.com" + nextp[0]
        utils.addDir('Next Page (' + str(page) + ')', next, 221, '', page)
    except:
        pass
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #5
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')
コード例 #6
0
def BGCat(url):
    bgversion = addon.getSetting('bgversion')
    caturl = utils.getHtml2(url)
    cats = json.loads(caturl)['tags']
    for cat in cats:
        videolist = '{0}{1}/index/tag/0/pc?tag={2}'.format(site.url, bgversion, urllib_parse.quote(cat['tag']))
        title = cat['tag'].title() if utils.PY3 else cat['tag'].title().encode('utf8')
        name = title + ' [COLOR hotpink](%s videos)[/COLOR]' % cat['videos']
        site.add_dir(name, videolist, 'BGList', '')
    utils.eod()
コード例 #7
0
def BGCat(url):
    bgversion = addon.getSetting('bgversion')
    caturl = utils.getHtml2(url)
    tags = re.compile(r'"nonpopular":\[(.*?)\]', re.DOTALL | re.IGNORECASE).findall(caturl)[0]
    tags = re.compile('"([^"]+)"', re.DOTALL | re.IGNORECASE).findall(tags)
    for tag in tags:
        videolist = "http://api2.beeg.com/api/v6/"+bgversion+"/index/tag/0/mobile?tag=" + tag.encode("utf8")
        name = tag.encode("utf8")
        name = name[:1].upper() + name[1:]
        utils.addDir(name, videolist, 81, '')
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #8
0
ファイル: beeg.py プロジェクト: anton40/WhiteCream-V0.0.1
def BGCat(url):
    bgversion = addon.getSetting('bgversion')
    caturl = utils.getHtml2(url)
    tags = re.compile(r'"nonpopular":\[(.*?)\]', re.DOTALL | re.IGNORECASE).findall(caturl)[0]
    tags = re.compile('"([^"]+)"', re.DOTALL | re.IGNORECASE).findall(tags)
    for tag in tags:
        videolist = "http://api2.beeg.com/api/v6/"+bgversion+"/index/tag/0/mobile?tag=" + tag.encode("utf8")
        name = tag.encode("utf8")
        name = name[:1].upper() + name[1:]
        utils.addDir(name, videolist, 81, '')
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #9
0
def List(url):
    try:
        llist = utils.getHtml2(url)
        res = re.compile("avatar_border src=(.+?) .+?:19px;'>(.+?)<.+?<X>(.+?)<X>", re.IGNORECASE | re.MULTILINE | re.DOTALL).findall(llist)
    except:
        return None

    for img, name, plot in res:
        img = img.replace('100x100','300x300')
        utils.addDownLink(name, name, 272, img, plot)
    utils.addDir('[COLOR hotpink]Next page[/COLOR]', url[:-1] + str(int(url[-1]) + 1), 271, os.path.join(utils.imgDir, 'uwc-next.png'), '')
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #10
0
def tagsListDir(url):
    page = utils.getHtml2(url)
    res = re.compile("avatar_border src=(.+?) .+?:19px;'>(.+?)<",
                     re.IGNORECASE | re.MULTILINE | re.DOTALL).findall(page)
    if not res:
        return
    for img, name in res:
        img = img.replace('\\/', '/').replace('100x100','300x300')
        utils.addDownLink(name, name, 272, img, '', noDownload=True)
    # utils.addDir('[COLOR hotpink]Next page[/COLOR]', url[:-1] + str(int(url[-1]) + 1), 271, os.path.join(utils.imgDir, 'uwc-next.png'), '')
    xbmcplugin.endOfDirectory(utils.addon_handle)

    pass
コード例 #11
0
def List(url):
    try:
        listhtml = utils.getHtml2(url)
        serverlist = utils.getHtml2('https://new.myfreecams.com/server')
    except:
        
        return None

    match = re.compile('<div class=slm_c>.+?<a href="([^"]+)".+?src="([^"]+)".+?style=".+?>(.+?)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
    for urk,img,name in match:
        url = name
        name = utils.cleantext(name)
        #img = img + 'jpg'
        #url = img[32:-17]
        img = img.replace('90x90','300x300')
        #if len(url) == 7:
        #    url = '10' + url
        #else:
        #    url = '1' + url

        utils.addDownLink(name, url, 272, img, '', noDownload=True)
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #12
0
def tagsList(url):
    url = 'https://www.myfreecams.com/php/model_tags.php?get_tags=1&tag_sort=&word_source=tags&display_style=list&member_mode=0&style_override=&night_mode=0&0.057073103870574515'

    page = utils.getHtml2(url)
    res = re.compile("g_oTags.SelectTag\(\'selected_field\',\'(.+?)\'.+?10px.+?>(.+?)<", re.IGNORECASE | re.MULTILINE | re.DOTALL).findall(page)
    # xbmcgui.Dialog().textviewer('TAGS', str(res))
    for item, models in res:
        url = 'https://www.myfreecams.com/php/model_tags.php?get_users=1&selected_field={field}&display_style=list&word_source=tags&member_mode=0&style_override=&sort=&page=1&stand_alone=true&night_mode=0&0.39258079289014247'.format(field = urllib.quote_plus(item))
        utils.addDir(item + ' - ' + models, url, 274, '', '')
    xbmcplugin.endOfDirectory(utils.addon_handle)
    # uurl =  'https://www.myfreecams.com/php/model_tags.php?get_users=1&selected_field=sexy&display_style=list&word_source=tags&member_mode=0&style_override=&sort=&page=1&stand_alone=true&night_mode=0&0.8154651658335239'
    # res = re.compile("javascript:g_oTags.SelectTag\('selected_field','(.+?)'", re.IGNORECASE | re.MULTILINE | re.DOTALL).findall(page)
    # 'https://www.myfreecams.com/php/model_tags.php?get_users=1&selected_field=cook&display_style=list&word_source=tags&member_mode=0&style_override=&sort=&page=1&stand_alone=true&night_mode=0&0.39258079289014247'
    pass
コード例 #13
0
def List(url):
    listhtml = utils.getHtml2(url)
    match = re.compile("model_detail=(.*?)&.*?img src=(.*?)jpg.*?</div>",
                       re.DOTALL | re.IGNORECASE).findall(listhtml)
    for name, img in match:
        name = utils.cleantext(name)
        img = img + 'jpg'
        url = img[32:-17]
        if len(url) == 7:
            url = '10' + url
        else:
            url = '1' + url
        utils.addDownLink(name, url, 272, img, '', noDownload=True)
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #14
0
def Playvid(url, name):
    global MFC_SERVERS
    serverlist = utils.getHtml2('https://app.myfreecams.com/server')
    jsonlist = json.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:
        vp = utils.VideoPlayer(name)
        vp.play_from_direct_link(videourl)
    else:
        utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
コード例 #15
0
def List(url):
    try:
        listhtml = utils.getHtml2(url)
    except:
        utils.notify('Oh oh','It looks like this website is down.')
        return None
    match = re.compile("model_detail=(.*?)&.*?img src=(.*?)jpg.*?</div>", re.DOTALL | re.IGNORECASE).findall(listhtml)
    for name, img in match:
        name = utils.cleantext(name)
        img = img + 'jpg'
        url = img[32:-17]
        if len(url) == 7:
            url = '10' + url
        else:
            url = '1' + url
        utils.addDownLink(name, url, 272, img, '', noDownload=True)
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #16
0
def List(url):
    try:
        listhtml = utils.getHtml2(url)
    except:
        utils.notify('Oh oh', 'It looks like this website is down.')
        return None
    match = re.compile("model_detail=(.*?)&.*?img src=(.*?)jpg.*?</div>",
                       re.DOTALL | re.IGNORECASE).findall(listhtml)
    for name, img in match:
        name = utils.cleantext(name)
        img = img + 'jpg'
        url = img[32:-17]
        img = img.replace('90x90', '300x300')
        if len(url) == 7:
            url = '10' + url
        else:
            url = '1' + url
        utils.addDownLink(name, url, 272, img, '', noDownload=True)
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #17
0
def List(url):
	try:
		listhtml = utils.getHtml2(url)
	except:
		
		return None

	match = re.compile('<div class=slm_c>.+?<a href="([^"]+)".+?src="([^"]+)".+?style=".+?>(.+?)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
	for urk,img,name in match:
		url = name
		name = utils.cleantext(name)
		#img = img + 'jpg'
		#url = img[32:-17]
		img = img.replace('90x90','300x300')
		#if len(url) == 7:
		#    url = '10' + url
		#else:
		#    url = '1' + url
		utils.addDownLink(name, url, 272, img, '', noDownload=True)
	xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #18
0
def Playvid(url, name):
    listhtml = utils.getHtml2(url)
    match = re.compile("<video.*?src='([^']+)'",
                       re.DOTALL | re.IGNORECASE).findall(listhtml)
    if match:
        videourl = match[0]
        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)
    else:
        utils.notify('Oh oh', 'Couldn\'t find a playable webcam link')
コード例 #19
0
def List(url, page=None):
    if utils.addon.getSetting("chaturbate") == "true":
        clean_database()
    listhtml = utils.getHtml2(url)
    match = re.compile(
        r'<li>\s+<a href="([^"]+)".*?src="([^"]+)".*?<div[^>]+>([^<]+)</div>.*?href[^>]+>([^<]+)<.*?age[^>]+>([^<]+)<',
        re.DOTALL | re.IGNORECASE).findall(listhtml)
    for videopage, img, status, name, age in match:
        name = utils.cleantext(name)
        status = status.replace("\n", "").strip()
        name = name + " [" + status + "] Age: [COLOR deeppink]" + age + "[/COLOR]"
        videopage = "https://chaturbate.com" + videopage
        utils.addDownLink(name, videopage, 222, img, '', noDownload=True)
    if len(match) == 90:
        try:
            page = page + 1
            nextp = re.compile('<a href="([^"]+)" class="next',
                               re.DOTALL | re.IGNORECASE).findall(listhtml)
            next = "https://chaturbate.com" + nextp[0]
            utils.addDir('Next Page (' + str(page) + ')', next, 221, '', page)
        except:
            pass
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #20
0
def List(url, page=1):
    if addon.getSetting("chaturbate") == "true":
        clean_database(False)
    try:
        listhtml = utils.getHtml2(url)
    except:
        
        return None		
    match = re.compile(r'<li.+?data-sl="(.+?)".+?<a href="(\/.+?)".+?<img\s+src="(.+?)".+?_label.+?>(.+?)<.+?age.+?>(.+?)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
    for name,videopage, img, status, age in match:	

        name = utils.cleantext(name.strip())
        status = status.replace("\n","").strip()
        name = name + " [COLOR deeppink][" + age + "][/COLOR] " + status
        videopage = "https://chaturbate.com" + videopage
        utils.addDownLink(name, videopage, 222, img, '', noDownload=True)
    try:
        page = page + 1
        nextp=re.compile('<a href="([^"]+)" class="next', re.DOTALL | re.IGNORECASE).findall(listhtml)
        next = "https://chaturbate.com" + nextp[0]
        utils.addDir('Next Page ('+str(page)+')', next, 221,'', page)
    except: pass
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #21
0
def List(url, page=1):
    if addon.getSetting("chaturbate") == "true":
        clean_database(False)
    try:
        listhtml = utils.getHtml2(url)
    except:
        utils.notify('Oh oh','It looks like this website is down.')
        return None
    match = re.compile(r'<li>\s+<a href="([^"]+)".*?src="([^"]+)".*?<div[^>]+>([^<]+)</div>.*?href[^>]+>([^<]+)<.*?age[^>]+>([^<]+)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
    for videopage, img, status, name, age in match:
        name = utils.cleantext(name)
        status = status.replace("\n","").strip()
        name = name + " [COLOR deeppink][" + age + "][/COLOR] " + status
        videopage = "https://chaturbate.com" + videopage
        utils.addDownLink(name, videopage, 222, img, '', noDownload=True)
    if len(match) == 90:
        try:
            page = page + 1
            nextp=re.compile('<a href="([^"]+)" class="next', re.DOTALL | re.IGNORECASE).findall(listhtml)
            next = "https://chaturbate.com" + nextp[0]
            utils.addDir('Next Page ('+str(page)+')', next, 221,'', page)
        except: pass
    xbmcplugin.endOfDirectory(utils.addon_handle)
コード例 #22
0
def BGChnl(url):
    bgversion = addon.getSetting('bgversion')
    caturl = utils.getHtml2(url)
    cats = json.loads(caturl)['channels']
    for cat in cats:
        videolist = '{0}{1}/index/channel/0/pc?channel={2}'.format(site.url, bgversion, urllib_parse.quote(cat['channel']))
        title = cat['channel'].title() if utils.PY3 else cat['channel'].title().encode('utf8')
        name = title + ' [COLOR hotpink]({0} videos)[/COLOR]'.format(cat['videos'])
        if cat['image']:
            image = 'https://thumbs.beeg.com/channels/{0}.png'.format(cat['id'])
        else:
            image = 'https://beeg.com/img/channel-placeholder.bab27720.png'
        site.add_dir(name, videolist, 'BGList', image)

    if len(cats) == 100:
        if '?' in url:
            url, offset = url.split('?')
            offset = int(offset.split('=')[-1])
        else:
            offset = 0
        url = url.split('?')[0] + '?offset={0}'.format(offset + 100)
        site.add_dir('Next Page...', url, 'BGChnl', site.img_next)

    utils.eod()
コード例 #23
0
    import simplejson
except:
    import json as simplejson   

import xbmc
import xbmcplugin
import xbmcgui
from resources.lib import utils
from resources.lib import websocket

global WZOBSSERVERS
global H5SERVERS
global NGSERVERS
global CHATSERVERS

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

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



@utils.url_dispatcher.register('270')
def Main():
    List('https://www.myfreecams.com/')


@utils.url_dispatcher.register('271', ['url'])