WIP my addon to automated the script creation
Publicado: 22 Oct 2014, 10:40
hi was recommended this site by a friend i have been working really hard to create a website that users can login click a few button and create there own video plugin i have since created that site it will walk you through every step if you wish or click a few button and have it created for you once create you can add links to the site and there will automatically show up in your addon i have gone as far as live streams sopcast acestrems youtube videos direct links as well as having your plugin it automatically creates the playlist like for plugin live streams you iptv pvr istreams playlist it is all there on my site except one function i would like to add is the urlresolver i have been up almost 2 days copying little segments from here and the following tutorial after tutorial leading to dead ends i was told Jesus is the man too go so Jesus can you help me please visit the site there is loads more functions i Have not mentioned
go to pipcan.info
or register go www.pipcan.info/register.php
gallery www.imgur.com/a/hGHfq
youu tube preview http://www.youtube.com/embed/E1bU_KhBnxo
go to pipcan.info
or register go www.pipcan.info/register.php
gallery www.imgur.com/a/hGHfq
youu tube preview http://www.youtube.com/embed/E1bU_KhBnxo
Código: Seleccionar todo
import xbmc,xbmcplugin,xbmcgui,xbmcaddon,xbmcvfs
import urllib,urllib2,re,os,sys,htmllib,string,StringIO,logging,random,array,time,datetime,copy,HTMLParser,htmlentitydefs,urlresolver
BASE = "http://pipcan.info/"
def CATEGORIES():
addDir('sss (TESTING) ','cat.php?id=18',1,'')
addDir('555464 (TESTING) ','cat.php?id=19',1,'')
addDir('HHKHH (TESTING) ','cat.php?id=20',1,'')
addDir('Video Hosted Files ','vh.php?u=vid22',1,'')
addDir('live Streams ','ls.php?u=vid22',1,'')
addDir('torrent ','to.php?u=vid22',1,'')
addDir('YouTube ','yt.php?u=vid22',1,'')
addDir('Search','browse.php?q=',1,'')
def INDEX(url):
if url=="browse.php?q=":
searchString = addSearch()
url="browse.php?q="+searchString
after = url
url = BASE + url
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
try:
appdg = after.split('&')[1]
before = after.split('&')[0]
appdg = int(appdg.split('=')[1]) + 1
newURL = before + "" + str(appdg)
except:
newURL = after + ""
appdg = 2
match=re.compile('<a href="(.+?)"><img class="thumbnail_image" src="(.+?)" alt="(.+?)"').findall(link)
for url,thumbnail,name, in match:
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('file: "(.+?)",').findall(link)
for url in match:
addLink(name,url,thumbnail,"")
match=re.compile('src="http://www.youtube.com/embed/(.+?)?rel=0').findall(link)
for url in match:
youtubeurl = 'plugin://plugin.video.youtube/?action=play_video&videoid=%s' % url
addLink(name,youtubeurl,thumbnail,"")
match=re.compile('acestream: "acestream://(.+?)",').findall(link)
for url in match:
acestream = 'plugin://plugin.video.p2p-streams/?url=acestream://%s&mode=1&name=Acestream' % url
addLink(name,acestream,thumbnail,"")
match=re.compile('torrent: "(.+?).torrent",').findall(link)
for url in match:
torrent = 'plugin://plugin.video.p2p-streams/?url=http://%s.torrent&mode=1&name=Acestream' % url
addLink(name,torrent,thumbnail,"")
match=re.compile('sop: "sop://(.+?)",').findall(link)
for url in match:
sop = 'plugin://plugin.video.p2p-streams/?url=sop://%s&mode=2&name=title+sopcast' % url
addLink(name,sop,thumbnail,"")
def VIDEOLINKS(url,name):
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('file: "(.+?)",').findall(link)
for url in match:
addLink(name,url,'',"")
def get_params():
param=[]
paramstring=sys.argv[2]
if len(paramstring)>=2:
params=sys.argv[2]
cleanedparams=params.replace('?','')
if (params[len(params)-1]=='/'):
params=params[0:len(params)-2]
pairsofparams=cleanedparams.split('&')
param={}
for i in range(len(pairsofparams)):
splitparams={}
splitparams=pairsofparams[i].split('=')
if (len(splitparams))==2:
param[splitparams[0]]=splitparams[1]
return param
def addLink(name,url,iconimage,urlType):
ok=True
liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
liz.setInfo( type="Video", infoLabels={ "Title": name } )
liz.setProperty('IsPlayable','true')
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
return ok
def addSearch():
searchStr = ''
keyboard = xbmc.Keyboard(searchStr, 'Search')
keyboard.doModal()
if (keyboard.isConfirmed()==False):
return
searchStr=keyboard.getText()
if len(searchStr) == 0:
return
else:
return searchStr
def addDir(name,url,mode,iconimage):
u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
ok=True
liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
liz.setInfo( type="Video", infoLabels={ "Title": name } )
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
return ok
params=get_params()
url=None
name=None
mode=None
try:
url=urllib.unquote_plus(params["url"])
except:
pass
try:
name=urllib.unquote_plus(params["name"])
except:
pass
try:
mode=int(params["mode"])
except:
pass
print "Mode: "+str(mode)
print "URL: "+str(url)
print "Name: "+str(name)
if mode==None or url==None or len(url)<1:
print ""
CATEGORIES()
elif mode==1:
print ""+url
INDEX(url)
elif mode==2:
print ""+url
addSearch()
xbmcplugin.endOfDirectory(int(sys.argv[1]))