Пример #1
0
def ResolveURL(url):
    #print url
    #url = 'http://www.watchcartoononline.com/axis-powers-hetalia-episode-46-english-subbed' #vweed
    #url = 'http://www.watchcartoononline.com/halo-legends-episode-8-english-dubbed' #veoh
    #url = 'http://www.watchcartoononline.com/american-dad-season-1-episode-20-roger-n-me'#cizgifilmlerizle
    #url = 'http://www.watchcartoononline.com/adventures-of-sonic-the-hedgehog-episode-66-sonic-christmas-blast' #Youtube
    #url = 'http://www.watchcartoononline.com/tmnt-season-7-episode-13-wedding-bells-and-bytes' #Youtube 2 PARTS
    #url = 'http://www.watchcartoononline.com/thundercats-2011-premiere' #movieweb
    #url = 'http://www.watchcartoononline.com/hacklegend-of-the-twilight-episode-12-english-dubbed'
    #url = 'http://www.watchcartoononline.com/mr-bean-the-animated-series-episode-49-in-the-pink' #YouTube GEOLOCKED embeded

    ImportModules()

    html = utils.getHTML(url)
    html = html.replace('"Click Here!!"</a></div>', '')

    url = None
    msg = None

    resolved = []

    match = re.compile('<div class=\'postTabs_divs(.+?)</div>').findall(html)

    try:
        for item in match:
            for module in MODULES:
                links = MODULES[module].Resolve(item)
                for link in links:
                    if link[0] != None:
                        resolved.append(
                            [module.replace('_', ''), link[0], link[1]])
    except Exception, e:
        pass
Пример #2
0
def Resolve(html):
    if not 'movieweb' in html:
        return []

    ret = None
    text = ''
    try:
        id = re.compile('http://www.movieweb.com/v/(.+?)"').search(html).group(
            1)
        url = 'http://www.movieweb.com/v/%s/play?s=1&idx=0&e=1' % id
        html = utils.getHTML(url, useCache=False)

        jsn = json.loads(html)

        url = str(jsn['url_img']).split('.img', 1)[0]
        url += '/'
        url += jsn['videoId']
        url += '_'
        url += str(jsn['ii'])  #might be i
        url += jsn['iii']
        url += '?'
        url += jsn['iiii']
        ret = url
    except Exception, e:
        text = 'Error Resolving Movieweb URL'
Пример #3
0
def DoSection(url):
    mode = SERIES
    if url == 'http://www.watchcartoononline.com/movie-list':
        mode = EPISODE
    if url == 'http://www.watchcartoononline.com/ova-list':
        mode = EPISODE

    html = utils.getHTML(url)

    html = html.split('<div id="ddmcc_container">', 1)[-1]

    html = html.replace('<li><a href=""></a></li>', '')

    names = []

    match = re.compile('<li><a href="(.+?)" title="(.+?)">(.+?)</a></li>',
                       re.DOTALL).findall(html)

    sorted = []

    for url, title, name in match:
        if '#' not in url:
            if name not in names:
                names.append(name)
                if mode == SERIES:
                    newName = name
                    if newName.startswith('The '):
                        newName = newName.split('The ', 1)[-1]
                    sorted.append([newName, name, url])
                elif mode == EPISODE:
                    AddEpisode(name, url)

    sorted.sort()
    for item in sorted:
        AddSeries(item[1], item[2])
Пример #4
0
def DoSection(url):
    mode = SERIES
    if url == 'http://www.watchcartoononline.com/movie-list':
        mode = EPISODE
    if url == 'http://www.watchcartoononline.com/ova-list':
        mode = EPISODE

    html = utils.getHTML(url)

    html = html.split('<div id="ddmcc_container">', 1)[-1]

    html = html.replace('<li><a href=""></a></li>', '')
  
    names = []

    match = re.compile('<li><a href="(.+?)">(.+?)</a></li>').findall(html)

    sorted = []

    for url, name in match:
        if ('#' not in url) and ('title="' not in url):
            if name not in names:
                names.append(name)
                if mode == SERIES:
                    newName = name
                    if newName.startswith('The '):
                        newName = newName.split('The ', 1)[-1]
                    sorted.append([newName, name, url])
                elif mode == EPISODE:
                    AddEpisode(name, url)

    sorted.sort()
    for item in sorted:
        AddSeries(item[1], item[2])
Пример #5
0
def ResolveURL(url):
    #print url
    #url = 'http://www.watchcartoononline.com/axis-powers-hetalia-episode-46-english-subbed' #vweed
    #url = 'http://www.watchcartoononline.com/halo-legends-episode-8-english-dubbed' #veoh
    #url = 'http://www.watchcartoononline.com/american-dad-season-1-episode-20-roger-n-me'#cizgifilmlerizle
    #url = 'http://www.watchcartoononline.com/adventures-of-sonic-the-hedgehog-episode-66-sonic-christmas-blast' #Youtube
    #url = 'http://www.watchcartoononline.com/tmnt-season-7-episode-13-wedding-bells-and-bytes' #Youtube 2 PARTS
    #url = 'http://www.watchcartoononline.com/thundercats-2011-premiere' #movieweb
    #url = 'http://www.watchcartoononline.com/hacklegend-of-the-twilight-episode-12-english-dubbed'
    #url = 'http://www.watchcartoononline.com/mr-bean-the-animated-series-episode-49-in-the-pink' #YouTube GEOLOCKED embeded

    ImportModules()


    html = utils.getHTML(url)
    html = html.replace('"Click Here!!"</a></div>', '')

    url = None
    msg = None

    resolved = []

    match = re.compile('<div class=\'postTabs_divs(.+?)</div>').findall(html)  

    try:
        for item in match:   
            for module in MODULES:                        
                links = MODULES[module].Resolve(item)
                for link in links:                                   
                    if link[0] != None:                       
                        resolved.append([module.replace('_', ''), link[0], link[1]])
    except Exception, e:
        pass
Пример #6
0
def DoResolve(url):

    ret  = None
    text = ''
    try:        
        theNet = net.Net()

        data = {'fuck_you' : '', 'confirm' : 'Close%20Ad%20and%20Watch%20as%20Free%20User'}
        url  = url.replace(' ', '%20')

        theNet.set_user_agent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')

        html  = theNet.http_POST(url, data).content

        try:
            url  = re.compile('iframe src=\"(.+)\" frameborder').search(html).group(1)
            html = utils.getHTML(url)
            url  = re.compile('file: \"(.+)\",\\r  height').search(html).group(1)
            
        except:
            url  = re.compile('410px\\\' src=\\\'(.+)\\\' scrolling').search(html).group(1)
            html = utils.getHTML(url)

            url  = re.compile('advURL=\"(.+)\";flashvars.cid3').search(html).group(1)
            html = utils.getHTML(url)

            flashfile = re.compile('flashvars.file=\"(.+)\";').search(html).group(1).split('"')[0]           
            flashkey  = re.compile('flashvars.filekey=\"(.+)\";').search(html).group(1).split('"')[0]
            
            url  = 'http://www.videoweed.es/api/player.api.php?file='+flashfile+'&key='+flashkey.replace(".","%2E").replace("-","%2D")
            html = theNet.http_GET(url,headers = { 'Referer' : 'http://www.videoweed.es/player/cloudplayer.swf' , 'Host' : 'www.videoweed.es'}).content
            url  = re.compile('url=(.+\.flv)&title=').search(html).group(1)
            
            domain  = re.compile('http://(.+)/.+').search(url).group(1).split('/')[0]
            url    += '?client=FLASH|Host='+domain+'&User-Agent=Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0&Accept=application/octet-stream,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&Referer=http://www.videoweed.es/player/cloudplayer.swf&Connection=keep-alive'
               
        url = url.replace(' ', '%20')
        ret = url       
    except:
        text = 'Error Resolving URL'

    return [[ret, text]]
Пример #7
0
def Main():
    CheckVersion()

    html = utils.getHTML(URL)

    match = re.compile('<li><a href="(.+?)">(.+?)</a></li>').findall(html)
    for url, name in match:
        if name == 'Contact':
            break
        if name != 'Home':
            AddSection(name, '', url)
Пример #8
0
def Main():
    CheckVersion()

    html = utils.getHTML(URL)

    match = re.compile('<li><a href="(.+?)">(.+?)</a></li>').findall(html)
    for url, name in match:
        if name == 'Contact':
            break
        if name != 'Home':
            AddSection(name, '', url)
Пример #9
0
def DoSection(url):
    mode = SERIES
    print url
    print mode
    if url == 'https://www.watchcartoononline.io/movie-list':
        mode = EPISODE
    if url == 'https://www.watchcartoononline.io/ova-list':
        mode = EPISODE
    
    html = utils.getHTML(url)

    html = html.split('<div id="ddmcc_container">', 1)[-1]
    html = html.replace('<li><a href=""></a></li>', '')
    html = html.split('<div class="menu">', 1)[0]

    names = []

    match = re.compile('<li><a href="(.+?)">(.+?)</a></li>').findall(html)
    
    series   = []
    episodes = [] 
    
    for url, name in match:
        url = url.split('"', 1)[0]
        if True:
            if name not in names:
                names.append(name)

                newName = name
                if newName.startswith('The '):
                    newName = newName.split('The ', 1)[-1]
                elif newName.startswith('A '):
                    newName = newName.split('A ', 1)[-1]

                if mode == SERIES:                   
                    series.append([newName, name, url])
                elif mode == EPISODE:
                    episodes.append([newName, name, url])

    series   = sorted(series,   key=lambda x: x[0].lower())
    episodes = sorted(episodes, key=lambda x: x[0].lower())

    for item in series :
        AddSeries(item[1], item[2])

    for item in episodes :
        AddEpisode('', item[1], item[2])
Пример #10
0
def DoSection(url):
    mode = SERIES
    print url
    print mode
    if url == 'https://www.watchcartoononline.io/movie-list':
        mode = EPISODE
    if url == 'https://www.watchcartoononline.io/ova-list':
        mode = EPISODE

    html = utils.getHTML(url)

    html = html.split('<div id="ddmcc_container">', 1)[-1]
    html = html.replace('<li><a href=""></a></li>', '')
    html = html.split('<div class="menu">', 1)[0]

    names = []

    match = re.compile('<li><a href="(.+?)">(.+?)</a></li>').findall(html)

    series = []
    episodes = []

    for url, name in match:
        url = url.split('"', 1)[0]
        if True:
            if name not in names:
                names.append(name)

                newName = name
                if newName.startswith('The '):
                    newName = newName.split('The ', 1)[-1]
                elif newName.startswith('A '):
                    newName = newName.split('A ', 1)[-1]

                if mode == SERIES:
                    series.append([newName, name, url])
                elif mode == EPISODE:
                    episodes.append([newName, name, url])

    series = sorted(series, key=lambda x: x[0].lower())
    episodes = sorted(episodes, key=lambda x: x[0].lower())

    for item in series:
        AddSeries(item[1], item[2])

    for item in episodes:
        AddEpisode('', item[1], item[2])
Пример #11
0
def Resolve(html):
    if not 'veoh' in html:
        return [[None, 'Error Resolving URL']]

    ret  = None
    text = ''

    try:
        id   = re.compile('veoh.php\?v=(.+?)&').search(html).group(1)
        url  = 'http://www.veoh.com/rest/video/%s/details' % id
        html = utils.getHTML(url, useCache=False)
        if ' items="0"' in html:
            text = 'Video has been removed from Veoh'
        else:
            ret  = re.compile('fullPreviewHashPath="(.+?)"').search(html).group(1)
    except Exception, e:
        text = 'Error Resolving Veoh URL'
def Resolve(html):
    if not 'veoh' in html:
        return [[None, 'Error Resolving URL']]

    ret  = None
    text = ''

    try:
        id   = re.compile('veoh.php\?v=(.+?)&').search(html).group(1)
        url  = 'http://www.veoh.com/rest/video/%s/details' % id
        html = utils.getHTML(url, useCache=False)
        if ' items="0"' in html:
            text = 'Video has been removed from Veoh'
        else:
            ret  = re.compile('fullPreviewHashPath="(.+?)"').search(html).group(1)
    except Exception, e:
        text = 'Error Resolving Veoh URL'
Пример #13
0
def Resolve(html):
    if not 'movieweb' in html:
        return []

    ret  = None
    text = ''
    try:
        id   = re.compile('http://www.movieweb.com/v/(.+?)"').search(html).group(1)
        url  = 'http://www.movieweb.com/v/%s/play?s=1&idx=0&e=1' % id
        html = utils.getHTML(url, useCache=False)
        
        jsn = json.loads(html)

        url = str(jsn['url_img']).split('.img', 1)[0]
        url += '/'
        url += jsn['videoId']
        url += '_'
        url += str(jsn['ii']) #might be i
        url += jsn['iii']
        url += '?'
        url += jsn['iiii']
        ret  = url
    except Exception, e:        
        text = 'Error Resolving Movieweb URL'
Пример #14
0
def PlayVideo(_url, select):
    resolved = resolve.ResolveURL(_url)

    if len(resolved) == 0:
        url = None
        msg = 'Unidentified Video Host'
    else:
        index = GetLinkIndex(resolved, select)

        if index == None:
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, xbmcgui.ListItem(''))
            return

        resolver = resolved[index][0]
        url      = resolved[index][1]
        msg      = resolved[index][2]

    if url:
        url = url.split('"')[0]
        url = url.replace(' ', '%20')

    if not url:
        d   = xbmcgui.Dialog()
        d.ok(TITLE + ' - ' + VERSION, '', msg, '')

        print 'WATCHCARTOONSONLINE - (%s) Failed to locate video for %s' % (msg, _url)
        return

    html  = utils.getHTML(_url)
    image = re.compile('"image_src" href="(.+?)"').search(html).group(1)

    #following sometimes doesn't contain episode information :(
    #title = re.compile('<title>(.+?)</title>').search(html).group(1).split(' |', 1)[0]

    html = html.replace('title="RSD"', '')
    html = html.replace('title="Watch cartoons online', '')

    title = re.compile('title="(.+?)">').search(html).group(1)
    if title.startswith('Watch '):
        title = title.split('Watch ', 1)[-1]

    title = utils.clean(title)

    liz = xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image)

    metaData = {'title':title}
    meta.GetMetaData(title, metaData)
    liz.setInfo( type='Video', infoLabels=metaData)

    liz.setProperty('IsPlayable','true')

    if int(sys.argv[1]) == -1:
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(url, liz)
        #xbmc.Player().play(pl)

        player = XBMCPlayer(xbmc.PLAYER_CORE_DVDPLAYER)
        player.SetMetaData(metaData)
        player.play(pl)
        while player.is_active:
           xbmc.sleep(100)
    else:
        liz.setPath(url)
        xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
Пример #15
0
try:    mode = int(urllib.unquote_plus(params['mode']))
except: pass

try:    url = urllib.unquote_plus(params['url'])
except: pass

try:    title = urllib.unquote_plus(params['title'])
except: pass


if mode == SECTION:
    DoSection(url)


elif mode == SERIES:    
    html = utils.getHTML(url)

    while('Previous Entries' in html):
        DoSeries(html)
        url  = re.compile('<div class="alignleft"><a href="(.+?)".+?Previous Entries</a>').search(html).group(1)
        html = utils.getHTML(url)

    DoSeries(html)
    try:    xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE)
    except: pass


elif mode == EPISODE:
    try:
        PlayVideo(url, (not AUTOPLAY))
    except Exception, e:
Пример #16
0
def PlayVideo(_url, select):
    resolved = resolve.ResolveURL(_url)

    if len(resolved) == 0:
        url = None
        msg = 'Unidentified Video Host'
    else:
        index = GetLinkIndex(resolved, select)

        if index == None:
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), False,
                                      xbmcgui.ListItem(''))
            return

        resolver = resolved[index][0]
        url = resolved[index][1]
        msg = resolved[index][2]

    if url:
        url = url.split('"')[0]
        url = url.replace(' ', '%20')

    if not url:
        d = xbmcgui.Dialog()
        d.ok(TITLE + ' - ' + VERSION, '', msg, '')

        print 'WATCHCARTOONSONLINE - (%s) Failed to locate video for %s' % (
            msg, _url)
        return

    html = utils.getHTML(_url)
    image = re.compile('<meta property="og:image" content="(.+?)" />').search(
        html).group(1)

    #following sometimes doesn't contain episode information :(
    #title = re.compile('<title>(.+?)</title>').search(html).group(1).split(' |', 1)[0]

    html = html.replace('title="RSD"', '')
    html = html.replace('title="Watch cartoons online', '')

    title = re.compile('title="(.+?)">').search(html).group(1)
    if title.startswith('Watch '):
        title = title.split('Watch ', 1)[-1]

    title = utils.clean(title)

    liz = xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image)

    metaData = {'title': title}
    meta.GetMetaData(title, metaData)
    liz.setInfo(type='Video', infoLabels=metaData)

    liz.setProperty('IsPlayable', 'true')

    if int(sys.argv[1]) == -1:
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(url, liz)
        #xbmc.Player().play(pl)

        player = XBMCPlayer()
        player.SetMetaData(metaData)
        player.play(pl)
        while player.isActive:
            player.update()
            xbmc.sleep(500)
    else:
        liz.setPath(url)
        xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
Пример #17
0
def PlayVideo(_url, select):
    resolved = resolve.ResolveURL(_url)

    if len(resolved) == 0:
        url = None
        msg = 'Unidentified Video Host'
    else:
        index = GetLinkIndex(resolved, select)

        if index == None:
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), False,
                                      xbmcgui.ListItem(''))
            return

        resolver = resolved[index][0]
        url = resolved[index][1]
        msg = resolved[index][2]

    if url:
        url = url.split('"')[0]
        url = url.replace(' ', '%20')

    if not url:
        d = xbmcgui.Dialog()
        d.ok(TITLE + ' - ' + VERSION, '', msg, '')

        print 'WATCHCARTOONSONLINE - (%s) Failed to locate video for %s' % (
            msg, _url)
        return

    html = utils.getHTML(_url)
    image = common.parseDOM(
        [x for x in re.compile('(<img.+?>)').findall(html) if "/thumb" in x],
        "img",
        ret="src")
    if image:
        image = image[0]
    else:
        image = ''
    title = common.parseDOM([
        x.decode('utf-8')
        for x in re.compile('(<a.+?</a>)').findall(html) if _url in x
    ], "a")[0]
    title = utils.clean(title.encode('utf-8'))

    liz = xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image)

    metaData = {'title': title}
    meta.GetMetaData(title, metaData)
    liz.setInfo(type='Video', infoLabels=metaData)

    liz.setProperty('IsPlayable', 'true')

    if int(sys.argv[1]) == -1:
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(url, liz)
        #         player = xbmc.Player()
        player = XBMCPlayer()
        #         player = XBMCPlayer(xbmc.PLAYER_CORE_DVDPLAYER)
        player.SetMetaData(metaData)
        player.play(pl)
        while player.is_active:
            xbmc.sleep(100)
    else:
        liz.setPath(url)
        xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
Пример #18
0
try:
    url = urllib.unquote_plus(params['url'])
except:
    pass

try:
    title = urllib.unquote_plus(params['title'])
except:
    pass

if mode == SECTION:
    DoSection(url)

elif mode == SERIES:
    html = utils.getHTML(url)

    while ('Previous Entries' in html):
        DoSeries(html)
        url = re.compile(
            '<div class="alignleft"><a href="(.+?)".+?Previous Entries</a>'
        ).search(html).group(1)
        html = utils.getHTML(url)

    DoSeries(html)
    try:
        xbmcplugin.addSortMethod(
            int(sys.argv[1]),
            xbmcplugin.SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE)
    except:
        pass
def DoResolve(url):

    ret = None
    text = ''
    try:
        theNet = net.Net()

        data = {
            'fuck_you': '',
            'confirm': 'Close%20Ad%20and%20Watch%20as%20Free%20User'
        }
        url = url.replace(' ', '%20')

        theNet.set_user_agent(
            'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
        )

        html = theNet.http_POST(url, data).content

        try:
            url = re.compile('iframe src=\"(.+)\" frameborder').search(
                html).group(1)
            html = utils.getHTML(url)
            url = re.compile('file: \"(.+)\",\\r  height').search(html).group(
                1)

        except:
            url = re.compile('410px\\\' src=\\\'(.+)\\\' scrolling').search(
                html).group(1)
            html = utils.getHTML(url)

            url = re.compile('advURL=\"(.+)\";flashvars.cid3').search(
                html).group(1)
            html = utils.getHTML(url)

            flashfile = re.compile('flashvars.file=\"(.+)\";').search(
                html).group(1).split('"')[0]
            flashkey = re.compile('flashvars.filekey=\"(.+)\";').search(
                html).group(1).split('"')[0]

            url = 'http://www.videoweed.es/api/player.api.php?file=' + flashfile + '&key=' + flashkey.replace(
                ".", "%2E").replace("-", "%2D")
            html = theNet.http_GET(
                url,
                headers={
                    'Referer':
                    'http://www.videoweed.es/player/cloudplayer.swf',
                    'Host': 'www.videoweed.es'
                }).content
            url = re.compile('url=(.+\.flv)&title=').search(html).group(1)

            domain = re.compile('http://(.+)/.+').search(url).group(1).split(
                '/')[0]
            url += '?client=FLASH|Host=' + domain + '&User-Agent=Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0&Accept=application/octet-stream,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&Referer=http://www.videoweed.es/player/cloudplayer.swf&Connection=keep-alive'

        url = url.replace(' ', '%20')
        ret = url
    except:
        text = 'Error Resolving URL'

    return [[ret, text]]