Advertisement
Guest User

own3d.py v.0.2.1 modifiedv2

a guest
Mar 28th, 2012
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.69 KB | None | 0 0
  1. def ShowLiveVideo(videoid,title):
  2.         xbmc.log("rtmp play")  
  3.         item = xbmcgui.ListItem("RTMPLocal")
  4.         plot="live"
  5.  
  6.         baseinfo="http://www.own3d.tv/livecfg/"+str(videoid)
  7.         dom = parse(urllib.urlopen(baseinfo))
  8.         channelname = dom.getElementsByTagName("channel")[0].attributes["owner"].value
  9.         streaminfolist = dom.getElementsByTagName("item")
  10.         i = 0
  11.         cdninfo=[]
  12.         for stream in streaminfolist:
  13.                 cdninfo.append(stream)
  14.                 i = i + 1
  15.         cdnrtmp=[None]*(i+1)
  16.         cdnHD=[None]*(i+1)
  17.         cdnpath=[None]*(i+1)
  18.         j = 0
  19.         while j < i:
  20.                 cdnrtmp[j] = cdninfo[j].attributes["base"].value
  21.                 cdnHD[j] = cdninfo[j].getElementsByTagName("stream")
  22.                 cdnpath[j] = cdnHD[j][0].attributes["name"].value
  23.                 j = j + 1
  24.         j = 0
  25.         cdn1 = -1
  26.         cdn2 = -1
  27.         cdncust = -1
  28.         while j < i:
  29.                 if '${cdn2}' in cdnrtmp[j]:
  30.                         cdn2 = j
  31.                 if 'rtmp' in cdnrtmp[j]:
  32.                         cdncust = j
  33.                 if '${cdn1}' in cdnrtmp[j]:
  34.                         cdn1 = j
  35.                 j = j + 1
  36.  
  37.         if cdn1 != -1:
  38.             rtmpurl = 'rtmp://fml.2010.edgecastcdn.net:1935/202010'
  39.             cdnpathc = cdnpath[cdn1]
  40.         elif cdncust != -1:
  41.             rtmpurl = cdnrtmp[cdncust]
  42.             cdnpathc = cdnpath[cdncust]
  43.         elif cdn2 != -1:
  44.             rtmpurl = 'rtmp://fcds503.atl.llnw.net:1935/owned/'
  45.             cdnpathc = cdnpath[cdn2]
  46.         else:
  47.             rtmpurl = 'rtmp://fml.2010.edgecastcdn.net:1935/202010'
  48.             cdnpathc = cdnpath[0]
  49.                      
  50.         channelinfo = dom.getElementsByTagName("channel")
  51.         ownerlinkurl = channelinfo[0].attributes["ownerLink"]
  52.         pageurl = ' pageUrl='+ownerlinkurl.value
  53.         swf = ' swfUrl=http://static.ec.own3d.tv/player/Own3dPlayerV2_86.swf swfVfy=True Live=True'
  54.  
  55.         i = ['?', '.', '-']
  56.         for splitchar in i:
  57.                 if splitchar in cdnpathc:
  58.                         tcUrl = rtmpurl+'?'+cdnpathc.split(splitchar,1)[1]
  59.                         break
  60.                 else:
  61.                         tcUrl = rtmpurl+'?'+cdnpathc
  62.         playpath = ' Playpath='+cdnpathc
  63.         url = tcUrl+pageurl+playpath+swf
  64.  
  65.         item.setInfo( type="Video", infoLabels={"Title": title, "Plot": plot , "TVShowTitle": channelname, "Description": plot} )
  66.         xbmc.log(str(channelname).lower()+"_"+str(videoid)+"url: "+str(url))
  67.         xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(url, item)
  68.  
  69.         xbmcplugin.endOfDirectory(int(sys.argv[1]))
  70.         return 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement