tried everything
#1
Question 
Tried Everything

Hi i have tried everything to create a video addon ive read all the tutorials, even tried making one from the most basic of sites. but yet im still stuck, i know there is a way of explaining it, that will make it all click, but im am yet to find it, i have history in web html, php, MySQL but this leaves me stomped. i would really like to contact or even web chat with someone in the know. or if someone would make a youtube video of them making a addon or even going though the tutorial would be great, i have so meany ideas on plugins that would really bring a whole new way of looking at xbmc some of witch i have in development all i need to do is get a swing on this python and i would be set. i hope to get some reply thanks for taking the time and reading this

paul
Reply
#2
Where are you up to? Can you create a window that says "Hello World"?

Have you tried finding another addon that does what you are looking to do and taken it apart to see how it works?
Reply
#3
yes i can create the hello world. and lets just say i have downloaded over 50 addons to get pointers off lol.. here is an example i downloaded the live leak addon and i sort of understood it i created the webpage and used myregex and i got that to identify my video links i make the changes to the addon but i can never get the links to show up that's why i think im only a little bit off with my coding

below is a example i whipped up just a minute ago im trying to create a script that can be installed on any server and be compatible with the xbmc script with some minor changes
now i would like it working. but i want to know why and how its working and why its wrong if you get my point i do have other scripts this is just a quick example

Demo Page


admin panel
username admin password admin

Code:
import urllib,urllib2,re,xbmcplugin,xbmcgui

#LiveLeak.com- by Oneadvent 2012.
BASE = "http://pipcanvid.uphero.com/"
def CATEGORIES():
        addDir('Movives','index.php',1,'')
        addDir('Search','browse?q=',1,'')
        
                      
def INDEX(url):
    if url=="browse?q=":
      searchString = addSearch()
      url="browse?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 + "&page=" + str(appdg)
    except:
      newURL = after + "&page=2"
      appdg = 2
    addDir("Go To Page " + str(appdg), newURL, 1, "")
        match=re.compile('<a href="(.+?)"><img 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,"")
                
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 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]))
Reply
#4
(2013-10-14, 13:16)pipcan Wrote: Tried Everything

Hi i have tried everything to create a video addon ive read all the tutorials, even tried making one from the most basic of sites. but yet im still stuck, i know there is a way of explaining it, that will make it all click, but im am yet to find it, i have history in web html, php, MySQL but this leaves me stomped. i would really like to contact or even web chat with someone in the know. or if someone would make a youtube video of them making a addon or even going though the tutorial would be great, i have so meany ideas on plugins that would really bring a whole new way of looking at xbmc some of witch i have in development all i need to do is get a swing on this python and i would be set. i hope to get some reply thanks for taking the time and reading this

paul
here same too.. looking for a tutorial or youtube video.. hope someone see and help us soon...
Reply
#5
out of curiosity risigvalue what are you building or trying to build or learn
Reply
#6
(2013-10-14, 15:27)pipcan Wrote: out of curiosity risigvalue what are you building or trying to build or learn

i just wanted to make a video add on for xbmc. so i know so many turkish hd movies. i want to make a video plugin so i can put all those website into video add-on and i can watch vithout dowloading.
Reply
#7
If you look at the xbmc.log file it will tell you which lines threw errors.
Reply
#8
well risigvalue once i get the video addon to work il post the web script with tut on how to upload to web host hopefully my plan to have a universal plugin and web-script for everyone wont take to long any help would be very much appreciated

i will be updating the webscript again in next couple of days hope you enjoyed the preview still its a work in progress lol
Reply
#9
i have put a turkish movie video in your place,
you need to add category as TurkishMovie and you need to sort how to edit uploaded videos as well
Reply
#10
yes at the top of the add video logged in page you will see add category and user and yes the editing and sorting is next on the list glad to see you gave it a go thanks hopfully have improvements done by the weekend
Reply
#11
Update

finished the edit video page just need to add functions
will have finished tomoro please test it out and let us know



Edit Video Page
Reply
#12
(2013-10-15, 00:18)pipcan Wrote: Update

finished the edit video page just need to add functions
will have finished tomoro please test it out and let us know



Edit Video Page
that looks better.. hope new user doesnt delete videos :p

by the way, while i m trying to add new category it says " Column 'cat' cannot be null "

if you fix that too, would be so nice.
Reply
#13
yea will do should all be working by sunday buddy
Reply
#14
I was to learn to play this video, but it's not as easy as it seems to me it NGI is something different with the video that I've ever played

FRIV


HOPY
Reply
#15
massive update today its still not complete but looks and fuctions properly

Demo Page

Demo Admin Page

Username admin password admin

Image
Image
Image
Image

have a few more tweeks like security and stuff

Download Script

\Connections\localhost.php and change the settings
the phpmyadmin create database open xbmc(1).sql copy and run it in sql

as i say its still in development would love to hear any feedback
Reply

Logout Mark Read Team Forum Stats Members Help
tried everything2