[CLOSED]video stops and get its loop, unable to return to menu
#1
hi
i am working on a add on for playing youtube videos after scraped from a webpage.
the video plays fine.
but when i click on stop - the video stops and goes back to play same video again.
i am not sure where is the error.
anyone please review my code and guide me

full script is here - http://pastebin.com/MPtrvgTa
Reply
#2
you should be using addlink fucntion

Code:
def INDEX2(url):
    #teslink='pPYPDWQnoUU'
    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('height="380" src="(.+?)?rel=0').findall(link)
    match=re.compile('www.youtube.com\/embed\/(.+?)\?rel=0').findall(link)
    url = match[0]
    print ("Playing video " + name + " id: " + url)
    url = 'plugin://plugin.video.youtube/?action=play_video&videoid=%s' % (url)
    addlLink(name,url)
Reply
#3
read http://forum.xbmc.org/showthread.php?tid=118083

it's not only about faster listing, it's about doing shit properly. you *NEVER* start the player, you are not a script you are a virtual file system entry.
Reply
#4
thanks for your help.
managed to fix the problem.
the script is now at http://pastebin.com/KMcdR76n
i have cleaned as much as possible.
let me know if there is any error in it.
Reply

Logout Mark Read Team Forum Stats Members Help
[CLOSED]video stops and get its loop, unable to return to menu0