Exemplo n.º 1
0
def play(uri = common.args.url,referer='http://www.mtv.com'):
    mtvn = 'http://media.mtvnservices.com/'+uri 
    swfUrl = common.getRedirect(mtvn,referer=referer)
    configurl = urllib.unquote_plus(swfUrl.split('CONFIG_URL=')[1].split('&')[0]).strip()
    #configurl = configurl.split('/config.xml?')[0]+'/context4/config.xml?'+configurl.split('/config.xml?')[1]
    configxml = common.getURL(configurl,referer=mtvn)
    tree=BeautifulStoneSoup(configxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    feed = tree.find('feed')
    #try:
    mrssurl = feed.string.replace('{uri}',uri).replace('&','&')
    mrssxml = common.getURL(mrssurl)
    mrsstree = BeautifulStoneSoup(mrssxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    #except:
    #    mrsstree = feed
    segmenturls = mrsstree.findAll('media:content')
    stacked_url = 'stack://'
    for segment in segmenturls:
        surl = segment['url']#+'&acceptMethods=fms,hdn1,hds'
        videos = common.getURL(surl)
        videos = BeautifulStoneSoup(videos, convertEntities=BeautifulStoneSoup.HTML_ENTITIES).findAll('rendition')
        hbitrate = -1
        sbitrate = int(common.settings['quality'])
        for video in videos:
            bitrate = int(video['bitrate'])
            if bitrate > hbitrate and bitrate <= sbitrate:
                hbitrate = bitrate
                rtmpdata = video.find('src').string
                rtmpurl = rtmpdata + " swfurl=" + swfUrl.split('?')[0] +" pageUrl=" + referer + " swfvfy=true"
        stacked_url += rtmpurl.replace(',',',,')+' , '
    stacked_url = stacked_url[:-3]
    item = xbmcgui.ListItem(path=stacked_url)
    xbmcplugin.setResolvedUrl(pluginhandle, True, item)
Exemplo n.º 2
0
def playuri(uri=common.args.url, referer='http://nicktoons.nick.com'):
    mtvn = 'http://media.nick.com/' + uri
    swfUrl = common.getRedirect(mtvn, referer=referer)
    configurl = urllib.unquote_plus(
        swfUrl.split('CONFIG_URL=')[1].split('&')[0]).strip()
    configxml = common.getURL(configurl, referer=mtvn)
    tree = BeautifulStoneSoup(configxml,
                              convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    mrssurl = tree.find('feed').string.replace('{uri}', uri).replace(
        '&amp;', '&').replace('{type}',
                              'network').replace('mode=episode', 'mode=clip')
    mrssxml = common.getURL(mrssurl)
    tree = BeautifulStoneSoup(mrssxml,
                              convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    segmenturls = tree.findAll('media:content')
    stacked_url = 'stack://'
    for segment in segmenturls:
        surl = segment['url']
        videos = common.getURL(surl)
        videos = BeautifulStoneSoup(
            videos, convertEntities=BeautifulStoneSoup.HTML_ENTITIES).findAll(
                'rendition')
        hbitrate = -1
        sbitrate = int(common.settings['quality'])
        for video in videos:
            bitrate = int(video['bitrate'])
            if bitrate > hbitrate and bitrate <= sbitrate:
                hbitrate = bitrate
                rtmpdata = video.find('src').string
                rtmpurl = rtmpdata + " swfurl=" + swfUrl.split(
                    '?')[0] + " pageUrl=" + referer + " swfvfy=true"
        stacked_url += rtmpurl.replace(',', ',,') + ' , '
    stacked_url = stacked_url[:-3]
    item = xbmcgui.ListItem(path=stacked_url)
    xbmcplugin.setResolvedUrl(pluginhandle, True, item)
Exemplo n.º 3
0
def playuri(uri = common.args.url,referer='http://www.teennick.com'):
    mtvn = 'http://media.nick.com/'+uri 
    swfUrl = common.getRedirect(mtvn,referer=referer)
    configurl = urllib.unquote_plus(swfUrl.split('CONFIG_URL=')[1].split('&')[0]).strip()
    configxml = common.getURL(configurl,referer=mtvn)
    tree=BeautifulStoneSoup(configxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    mrssurl = tree.find('feed').string.replace('{uri}',uri).replace('&amp;','&').replace('{type}','network').replace('mode=episode','mode=clip')
    mrssxml = common.getURL(mrssurl)
    tree=BeautifulStoneSoup(mrssxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    segmenturls = tree.findAll('media:content')
    stacked_url = 'stack://'
    for segment in segmenturls:
        surl = segment['url']
        videos = common.getURL(surl)
        videos = BeautifulStoneSoup(videos, convertEntities=BeautifulStoneSoup.HTML_ENTITIES).findAll('rendition')
        hbitrate = -1
        sbitrate = int(common.settings['quality'])
        for video in videos:
            bitrate = int(video['bitrate'])
            if bitrate > hbitrate and bitrate <= sbitrate:
                hbitrate = bitrate
                rtmpdata = video.find('src').string
                rtmpurl = rtmpdata + " swfurl=" + swfUrl.split('?')[0] +" pageUrl=" + referer + " swfvfy=true"
        stacked_url += rtmpurl.replace(',',',,')+' , '
    stacked_url = stacked_url[:-3]
    item = xbmcgui.ListItem(path=stacked_url)
    xbmcplugin.setResolvedUrl(pluginhandle, True, item)
Exemplo n.º 4
0
def play(uri = common.args.url,referer='http://www.mtv.com'):
    mtvn = 'http://media.mtvnservices.com/'+uri 
    swfUrl = common.getRedirect(mtvn,referer=referer)
    configurl = urllib.unquote_plus(swfUrl.split('CONFIG_URL=')[1].split('&')[0]).strip()
    #configurl = configurl.split('/config.xml?')[0]+'/context4/config.xml?'+configurl.split('/config.xml?')[1]
    configxml = common.getURL(configurl,referer=mtvn)
    tree=BeautifulStoneSoup(configxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    feed = tree.find('feed')
    #try:
    mrssurl = feed.string.replace('{uri}',uri).replace('&amp;','&')
    mrssxml = common.getURL(mrssurl)
    mrsstree = BeautifulStoneSoup(mrssxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    #except:
    #    mrsstree = feed
    segmenturls = mrsstree.findAll('media:content')
    stacked_url = 'stack://'
    for segment in segmenturls:
        surl = segment['url']#+'&acceptMethods=fms,hdn1,hds'
        videos = common.getURL(surl)
        videos = BeautifulStoneSoup(videos, convertEntities=BeautifulStoneSoup.HTML_ENTITIES).findAll('rendition')
        hbitrate = -1
        sbitrate = int(common.settings['quality'])
        for video in videos:
            bitrate = int(video['bitrate'])
            if bitrate > hbitrate and bitrate <= sbitrate:
                hbitrate = bitrate
                rtmpdata = video.find('src').string
                rtmpurl = rtmpdata + " swfurl=" + swfUrl.split('?')[0] +" pageUrl=" + referer + " swfvfy=true"
        stacked_url += rtmpurl.replace(',',',,')+' , '
    stacked_url = stacked_url[:-3]
    item = xbmcgui.ListItem(path=stacked_url)
    xbmcplugin.setResolvedUrl(pluginhandle, True, item)
Exemplo n.º 5
0
def playuri(uri=common.args.url, referer='www.vh1.com'):
    mp4_url = "http://mtvnmobile.vo.llnwd.net/kip0/_pxn=0+_pxK=18639+_pxE=/44620/mtvnorigin"
    mtvn = 'http://media.mtvnservices.com/' + uri
    swfUrl = common.getRedirect(mtvn)  #,referer=referer)
    configurl = urllib.unquote_plus(
        swfUrl.split('CONFIG_URL=')[1].split('&')[0])
    configxml = common.getURL(configurl)
    tree = BeautifulStoneSoup(configxml,
                              convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    feed = tree.find('player').find('feed')
    try:
        mrssurl = feed.string.replace('{uri}',
                                      uri).replace('{ref}', 'None').replace(
                                          '&amp;', '&').strip()
        mrssxml = common.getURL(mrssurl)
        mrsstree = BeautifulStoneSoup(
            mrssxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    except:
        mrsstree = feed
    segmenturls = mrsstree.findAll('media:content')
    stacked_url = 'stack://'
    for segment in segmenturls:
        surl = segment['url']
        videos = common.getURL(surl)
        videos = BeautifulStoneSoup(
            videos, convertEntities=BeautifulStoneSoup.HTML_ENTITIES).findAll(
                'rendition')
        hbitrate = -1
        sbitrate = int(common.settings['quality'])
        for video in videos:
            bitrate = int(video['bitrate'])
            if bitrate > hbitrate and bitrate <= sbitrate:
                hbitrate = bitrate
                rtmpdata = video.find('src').string
                rtmpurl = mp4_url + rtmpdata.split('viacomvh1strm')[2]
                #protocall = rtmpdata.split('://')[0]
                #host = rtmpdata.split('://')[1].split('/')[0]
                #app = rtmpdata.split('://')[1].split('/')[1]
                #playpath = rtmpdata.split(app+'/')[1]
                #if '.mp4' in playpath:
                #    playpath = 'mp4:'+playpath#.replace('.mp4','')
                #else:
                #    playpath = playpath#.replace('.flv','')
                #rtmpurl = 'rtmpe://'+host+':1935/'+app
                #rtmpurl += ' playpath=' + playpath + " swfurl=" + swfUrl.split('?')[0] +" pageUrl=" + referer + " swfvfy=true"
        stacked_url += rtmpurl.replace(',', ',,') + ' , '
    stacked_url = stacked_url[:-3]
    item = xbmcgui.ListItem(path=stacked_url)
    xbmcplugin.setResolvedUrl(pluginhandle, True, item)
Exemplo n.º 6
0
def playuri(uri = common.args.url,referer='http://www.comedycentral.com'):
    mp4_url = "http://mtvnmobile.vo.llnwd.net/kip0/_pxn=0+_pxK=18639+_pxE=/44620/mtvnorigin"
    mtvn = 'http://media.mtvnservices.com/'+uri 
    swfUrl = common.getRedirect(mtvn,referer=referer)
    configurl = urllib.unquote_plus(swfUrl.split('CONFIG_URL=')[1].split('&')[0]).strip()
    configxml = common.getURL(configurl)
    tree=BeautifulStoneSoup(configxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    mrssurl = tree.find('feed').string.replace('{uri}',uri).replace('&amp;','&')
    mrssxml = common.getURL(mrssurl)
    tree=BeautifulStoneSoup(mrssxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    segmenturls = tree.findAll('media:content')
    stacked_url = 'stack://'
    for segment in segmenturls:
        surl = segment['url']
        videos = common.getURL(surl)
        videos = BeautifulStoneSoup(videos, convertEntities=BeautifulStoneSoup.HTML_ENTITIES).findAll('rendition')
        hbitrate = -1
        sbitrate = int(common.settings['quality'])
        for video in videos:
            bitrate = int(video['bitrate'])
            if bitrate > hbitrate and bitrate <= sbitrate:
                hbitrate = bitrate
                rtmpdata = video.find('src').string
                if 'viacomspstrm' in rtmpdata:
                    rtmpurl = mp4_url+rtmpdata.split('viacomspstrm')[2]
                elif 'viacomccstrm' in rtmpdata:
                    rtmpurl = mp4_url+rtmpdata.split('viacomccstrm')[2]
                elif 'mtvnorigin' in rtmpdata:
                    rtmpurl = mp4_url+rtmpdata.split('mtvnorigin')[1]
                else:
                    rtmpurl = rtmpdata
                #app = rtmpdata.split('://')[1].split('/')[1]
                #rtmpdata = rtmpdata.split('/'+app+'/')
                #rtmp = rtmpdata[0]
                #playpath = rtmpdata[1]
                #f '.mp4' in playpath:
                #    playpath = 'mp4:'+playpath.replace('.mp4','')
                #else:
                #    playpath = playpath.replace('.flv','')
                #rtmpurl = rtmp+'/'+app+ ' playpath='+playpath + " swfurl=" + swfUrl.split('?')[0] +" pageUrl=" + referer + " swfvfy=true"
                #print rtmpurl
        stacked_url += rtmpurl.replace(',',',,')+' , '
    stacked_url = stacked_url[:-3]
    item = xbmcgui.ListItem(path=stacked_url)
    xbmcplugin.setResolvedUrl(pluginhandle, True, item)
Exemplo n.º 7
0
def play(uri = common.args.url,referer='http://www.tvland.com'):
    mp4_url = "http://mtvnmobile.vo.llnwd.net/kip0/_pxn=0+_pxK=18639+_pxE=/44620/mtvnorigin"
    mtvn = 'http://media.mtvnservices.com/'+uri 
    swfUrl = common.getRedirect(mtvn,referer=referer)
    configurl = urllib.unquote_plus(swfUrl.split('CONFIG_URL=')[1].split('&')[0])
    configxml = common.getURL(configurl)
    tree=BeautifulStoneSoup(configxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    #print tree.prettify()
    mrssurl = tree.find('feed').string.replace('{uri}',uri).replace('&amp;','&').replace('{ref}','www.spike.com')
    mrssxml = common.getURL(mrssurl)
    tree=BeautifulStoneSoup(mrssxml, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    segmenturls = tree.findAll('media:content')
    stacked_url = 'stack://'
    for segment in segmenturls:
        surl = segment['url']
        videos = common.getURL(surl)
        #print videos
        videos = BeautifulStoneSoup(videos, convertEntities=BeautifulStoneSoup.HTML_ENTITIES).findAll('rendition')
        hbitrate = -1
        sbitrate = int(common.settings['quality'])
        for video in videos:
            bitrate = int(video['bitrate'])
            if bitrate > hbitrate and bitrate <= sbitrate:
                hbitrate = bitrate
                rtmpdata = video.find('src').string
                rtmpdata = video.find('src').string
                rtmpurl = mp4_url+rtmpdata.split('mtvnorigin')[1]
                #app = rtmpdata.split('://')[1].split('/')[1]
                #rtmpdata = rtmpdata.split(app)
                #rtmp = rtmpdata[0]
                #playpath = rtmpdata[1]
                #if '.mp4' in playpath:
                #    playpath = 'mp4:'+playpath.replace('.mp4','')
                #else:
                #    playpath = playpath.replace('.flv','')
                #swfUrl = "http://media.mtvnservices.com/player/prime/mediaplayerprime.1.12.1.swf"
                #rtmpurl = rtmp+app+playpath +" playpath=" + playpath + " swfurl=" + swfUrl + " pageUrl=" + referer + " swfvfy=true"
                #print rtmpurl
        stacked_url += rtmpurl.replace(',',',,')+' , '
    stacked_url = stacked_url[:-3]
    item = xbmcgui.ListItem(path=stacked_url)
    xbmcplugin.setResolvedUrl(pluginhandle, True, item)
Exemplo n.º 8
0
def showsub():
    showname=common.args.name
    if 'series.jhtml' in common.args.url:
        videos_url = common.args.url.replace('series.jhtml','video.jhtml')
    elif common.args.url.endswith('/'):
        redirect_url = common.args.url+'video.jhtml'
        videos_url = common.getRedirect(redirect_url).replace('series.jhtml','video.jhtml')
    else:
        videos_url = common.args.url
    data = common.getURL(videos_url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    seasonmenu=tree.find('select',attrs={'id':'videolist_id'})
    if seasonmenu:
        seasons = seasonmenu.findAll('option')
        for season in seasons:
            url = BASE + season['value']
            name = season.string
            common.addDirectory(name,'mtv','seasonOptions',url)
        common.setView('seasons')
    else:
        seasonOptions(videos_url+'?filter=')
Exemplo n.º 9
0
def showsub():
    showname=common.args.name
    if 'series.jhtml' in common.args.url:
        videos_url = common.args.url.replace('series.jhtml','video.jhtml')
    elif common.args.url.endswith('/'):
        redirect_url = common.args.url+'video.jhtml'
        videos_url = common.getRedirect(redirect_url).replace('series.jhtml','video.jhtml')
    else:
        videos_url = common.args.url
    data = common.getURL(videos_url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    seasonmenu=tree.find('select',attrs={'id':'videolist_id'})
    if seasonmenu:
        seasons = seasonmenu.findAll('option')
        for season in seasons:
            url = BASE + season['value']
            name = season.string
            common.addDirectory(name,'mtv','seasonOptions',url)
        common.setView('seasons')
    else:
        seasonOptions(videos_url+'?filter=')
Exemplo n.º 10
0
def play():
    print "IN KIDS"
    #smilurl=common.args.url+'&format=SMIL'
    redirecturl=common.args.url
    finalurl=common.getRedirect(redirecturl)
    print "resolved url",finalurl
    #data = common.getURL(smilurl)
    #print "data",data
    #tree=BeautifulStoneSoup(data, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    #print "tree",tree.prettify()
    #base = tree.find('meta')
    #print "base",base
    #base='rtmp://s3h56pp78s3goi.cloudfront.net/cfx/st/mp4:cove2.0/wordgirl/634cc2f8-e5bc-4c20-bf85-9cc78ddaf48c/hd-mezzanine-16x9/WORG309_EpisodeA_M1080-16x9-mp4-1200k.mp4
    #base='rtmp://s3h56pp78s3goi.cloudfront.net/cfx/st/'
    #playpath='mp4:cove2.0/wordgirl/634cc2f8-e5bc-4c20-bf85-9cc78ddaf48c/hd-mezzanine-16x9/WORG309_EpisodeA_M1080-16x9-mp4-1200k.mp4'
    #finalurl = base+' playpath='+playpath  
   #playpath=tree.find('ref')['src']
   # if '.mp4' in playpath:
         #playpath = 'mp4:'+playpath
          #  else:
           #     playpath = playpath.replace('.flv','')
           # finalurl = base+' playpath='+playpath   
   #if base:
     #   base = base['base']
      #  if 'rtmp://' in base:
       #     playpath=tree.find('ref')['src']
        #    if '.mp4' in playpath:
         #       playpath = 'mp4:'+playpath
          #  else:
           #     playpath = playpath.replace('.flv','')
           # finalurl = base+' playpath='+playpath
       # elif 'http://' in base:
        #    playpath=tree.find('ref')['src']
     #       finalurl = base+playpath
   # else:
    #    finalurl=tree.find('ref')['src']
   # finalurl=smilurl
   # print "URL",finalurl
    item = xbmcgui.ListItem(path=finalurl)
    xbmcplugin.setResolvedUrl(pluginhandle, True, item)
Exemplo n.º 11
0
def play():
    url=common.args.url
    finalurl=common.getRedirect(url)
    #tree=BeautifulStoneSoup(data, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    #print tree.prettify()
    #base = tree.find('meta')
    #if base:
     #   base = base['base']
      #  if 'rtmp://' in base:
       #     playpath=tree.find('ref')['src']
        #    if '.mp4' in playpath:
         #       playpath = 'mp4:'+playpath
          #  else:
           #     playpath = playpath.replace('.flv','')
           # finalurl = base+' playpath='+playpath
       # elif 'http://' in base:
        #    playpath=tree.find('ref')['src']
         #   finalurl = base+playpath
    #else:
     #   finalurl=tree.find('ref')['src']
    item = xbmcgui.ListItem(path=finalurl)
    xbmcplugin.setResolvedUrl(pluginhandle, True, item)