howto stack:// url and download multipart at once
#1
hi i need some help on code

in my plugin (diziport) user see a dialog
1 - watch online
2 - Download !
--watch online goes
part 1 enter -->play
part 2 enter -->play
part 3 enter -->play
--Download goes to
part 1 enter -->download
part 2 enter -->download
part 3 enter -->download

Both segment working right now i want to improve both segment.
-
1- stack resolved movie links (user need to press enter just one time.)

2-download 3 part without select every part.

could you show me an example to fix it..
Reply
#2
any help?
Reply
#3
the url format for stacks is

stack://<urlencodedurl1> / <urlencodedurl2> / <urlencodedurl3>

aso. shouldn't be more to this than returning such a formatted url. note, shouldn't, i dont think anyone has done this for http urls before.

i have a feeling it won't work as you want it to. what you probably want to do is to push a playlist to the player, then play the playlist.
Reply
#4
I did it before exactly like @spiff told you. Just make playlist on play definition and resolve url's there. last add it to playlist and play.

example: https://gist.github.com/92a1674bf852dfdb6a68
Reply
#5
Code:
match=re.compile('<title>(.*?)</title>\n\t  <jwplayer:file>(.*?)</jwplayer:file>').findall(link)#this is final resolved mp4 url
        for mname,url in match:
                        a = name+'-'+mname
                        playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
                        playlist.clear()
                        listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage='special://home/addons/plugin.video.diziport/resources/images/main.jpg')
                        listitem.setInfo( type="Video", infoLabels={ "Title": name } )
                        playlist.add(url)
                        # Play all videos...
                        xbmcPlayer = xbmc.Player()
                        xbmcPlayer.play(playlist)

with that code creating playlist an add link inside ok but xbmc check resolved links and starts to play from last one i can see it' try to play previous links.
in log it says before closing attemp for every url "CRenderManager::FlipPage - timeout waiting for flip to complete"

any ideas
Reply
#6
create playlist before for statement. add playlist inside for statement then play after and outside of for statement.

PHP Code:
playlist xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
match=re.compile('<title>(.*?)</title>\n\t  <jwplayer:file>(.*?)</jwplayer:file>').findall(link)#this is final resolved mp4 url
for mname,url in match:
    
name+'-'+mname
    listitem 
xbmcgui.ListItem(nameiconImage="DefaultVideo.png"thumbnailImage='special://home/addons/plugin.video.diziport/resources/images/main.jpg')
    
listitem.setInfotype="Video"infoLabels={ "Title"name } )
    
playlist.add(url)
# Play all videos...
xbmcPlayer xbmc.Player()
xbmcPlayer.play(playlist
Reply
#7
Code:
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        playlist.clear()
        match=re.compile('<title>.*?</title>\n\t  <jwplayer:file>(.*?)</jwplayer:file>').findall(link)#this is final resolved mp4 url
        for url in match:
                        listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage='special://home/addons/plugin.video.diziport/resources/images/main.jpg')
                        listitem.setInfo( type="Video", infoLabels={ "Title": name } )
                        playlist.add(url)
                        xbmcPlayer = xbmc.Player()
                        xbmcPlayer.play(playlist)


YESS it works thanks for advice....
Reply
#8
I edit my post. you can see example.
Reply
#9
queeup Wrote:I edit my post. you can see example.
yes i prepared same thing with your guidness

also do you give me a trick to solve download section sameway (one click to download all part )
Reply
#10
I don't know how are you trying to download. past example code to gist. I will look at it
Reply
#11
here is the code

i disabled download section to edit playlist function.thanks for help by the way..

i plan to collect all plugins to one plugin and add live tv channels like plugin.video.TVonDesiZone...

it will be biggest turkish collection i hope...
Reply
#12
@spiff and @queue thank you for your help.i'll fix it everythink about listing.
it here for somebody else who needed..
Code:
#creating url list for playlist
        playList = ''
        #this is final resolved mp4 url
        match=re.compile('<title>(.*?)</title>\n\t  <jwplayer:file>(.*?)</jwplayer:file>').findall(link)
                            
    #dialog let user choose watch or download...
        dialog = xbmcgui.Dialog()
        ret = dialog.select(__language__(30008), [__language__(30009), __language__(30010)])
        if ret == 0:
                ok = True
                for mname,partLink in match:
                        a = name+'-'+mname
                        playList = playList + partLink
                        playList = playList + ':;'
                        listitem = xbmcgui.ListItem( name, iconImage="DefaultVideo.png", thumbnailImage='special://home/addons/plugin.video.diziport/resources/images/main.jpg')
                        listitem.setInfo( type="Video", infoLabels={ "Title": name } )
                #create seperate links
                        addLink(a,partLink,'')
                #create url1:;url2:;url3.....an send a directory to resolve and add to playlist...
                addPlayListLink(__language__(30015),playList,12,'')
                        
        if ret == 1:
                for mname,url in match:
                        a = name+'-'+mname
                        #addDir(a,url,8,'special://home/addons/plugin.video.diziport/resources/images/izle.png')
                        

def PLAYLIST_VIDEOLINKS(name,url):
        ok=True
        playList = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        playList.clear()
        #time.sleep(2)
        links = url.split(':;')
        print links
        pDialog = xbmcgui.DialogProgress()
        ret = pDialog.create('Loading playlist...')
        totalLinks = len(links)
        loadedLinks = 0
        remaining_display = 'Videos loaded :: [b]'+str(loadedLinks)+' / '+str(totalLinks)+'[/b] into XBMC player playlist.'
        pDialog.update(0,'Please wait for the process to retrieve video link.',remaining_display)
        
        for videoLink in links:
                playList.add(videoLink)
                loadedLinks = loadedLinks + 1
                percent = (loadedLinks * 100)/totalLinks
                #print percent
                remaining_display = 'Videos loaded :: [b]'+str(loadedLinks)+' / '+str(totalLinks)+'[/b] into XBMC player playlist.'
                pDialog.update(percent,'Please wait for the process to retrieve video link.',remaining_display)
                if (pDialog.iscanceled()):
                        return False
        xbmcPlayer = xbmc.Player()
        xbmcPlayer.play(playList)
        if not xbmcPlayer.isPlayingVideo():
                d = xbmcgui.Dialog()
                d.ok('INVALID VIDEO PLAYLIST', 'videos cannot find.','Check other links.')
        return ok

def addPlayListLink(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="DefaultVideo.png", thumbnailImage=iconimage)
        liz.setInfo( type="Video", infoLabels={ "Title": name } )
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz)
        return ok
Reply

Logout Mark Read Team Forum Stats Members Help
howto stack:// url and download multipart at once0