Exemplo n.º 1
0
def build_m3u():
    #http://192.168.1.3/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22method%22:%22Addons.ExecuteAddon%22,%22params%22:{%22addonid%22:%22plugin.video.LivePolishTV%22,%22params%22:[%22mode=BUID_M3U%22]},%22id%22:1}
    fname = my_addon.getSetting('fname')
    path =  my_addon.getSetting('path')
    service = my_addon.getSetting('service')
    #print '$$$$$$$$ service', service

    error_msg=""
    if not fname:
        error_msg +="Podaj nazwe pliku "
    if not path:
        error_msg +="Podaj katalog docelowy "
    if not service:
         error_msg +="Wybierz jakies source"
        
    if error_msg:
        xbmcgui.Dialog().notification('[COLOR red]ERROR[/COLOR]', error_msg, xbmcgui.NOTIFICATION_ERROR, 1000)
        pvr_path=  xbmc.translatePath(os.path.join('special://userdata/','addon_data','pvr.iptvsimple'))
        #print pvr_path
        if os.path.exists(os.path.join(pvr_path,'settings.xml')):
            print 'settings.xml exists'
    else:
        outfilename = os.path.join(path,fname)     
        pDialog = xbmcgui.DialogProgressBG()
        pDialog.create('Tworze liste programow TV [%s]'%(fname), 'Uzyj z [COLOR blue]PVR IPTV Simple Client[/COLOR]')
        
        out_all = []
        pDialog.update(0,message='Szukam: [%s]'%service)
        if  service=='Telewizjada':
            out_all = tel.get_root_telewizjada(addheader=True)
        elif service=='Moje-Fimy':
            out_all =  m3u2list('')
        elif service=='Looknij':
            out_all = ltv.get_root_looknji(addheader=True)
        elif service=='iklub':
            out_all = iklub.get_root(addheader=True)            
        elif service=='ihtv':
            out_all = ihtv.get_root(addheader=True)   
        elif service=='itivi':
            out_all = itivi.get_root(addheader=True)                 
        elif service=='yoy':
            out_all = yoytv.get_root(addheader=True)            
        elif service=='looknij.in':
            out_all = looknijin.get_root(addheader=True)  
        elif service=='telewizja-live':
            out_all = telewizjalive.get_root(addheader=True)  
            
        N=len(out_all)
        out_sum=[]
        pDialog.update(0,message= 'Znalazlem!  %d' % N  )
        
        for i,one in enumerate(out_all):
            progress = int((i)*100.0/N)
            message = '%d/%d %s'%(i,N-1,one.get('title','')) 
            pDialog.update(progress, message=message)
            #print "%d\t%s" % (progress,message)
            try:
                if service=='Telewizjada':
                    one['url'] = tel.decode_url(one.get('url',''),one.get('id',''))
                if service=='Looknij':
                    one['url'] = ltv.decode_url(one.get('url',''))
                if service=='Moje-Fimy':
                    pass # no modification is needed
                if service=='iklub':
                    one['url'] = iklub.decode_url(one.get('url',''))
                if service=='ihtv':
                    one['url'] = ihtv.decode_url(one.get('url',''))
                if service=='itivi':
                    one['url'] = itivi.decode_url(one.get('url',''))
                if service=='yoy':
                    one['url'] = yoytv.decode_url(one.get('url',''))
                if service=='looknij.in':
                    one['url'] = looknijin.decode_url(one.get('url',''))   
                if service=='telewizja-live':
                    one['url'] = telewizjalive.decode_url(one.get('url',''))
                        
                if one['url']:
                    if isinstance(one['url'],list):
                        for url in one['url']:
                            print url
                            one_n=deepcopy(one)
                            one_n['url'] = url 
                            out_sum.append(one_n)
                    else:
                        out_sum.append(one)
            except:
                pass
        if out_sum:
            tel.build_m3u(out_sum,outfilename)
            pDialog.update(progress, message=outfilename)
            xbmcgui.Dialog().notification('Lista zapisana', outfilename, xbmcgui.NOTIFICATION_INFO, 10000)
            xbmcgui.Dialog().ok('[COLOR green]Lista zapisana[/COLOR] ','[COLOR blue]'+outfilename+'[/COLOR]','Uaktualnij ustawienia [COLOR blue]PVR IPTV Simple Client[/COLOR] i (re)aktywuj Live TV')
            
        pDialog.close()
Exemplo n.º 2
0
        addLinkItem(one.get('title',''),  one['url'], 'play_iptvsatlinks', one.get('epgname',None),IsPlayable=True,infoLabels=one, iconimage=one.get('img')) 

elif mode[0] == 'UPDATE_IPTV':
    update_iptv()

elif mode[0] == 'BUID_M3U':
    build_m3u()
    my_addon.openSettings()      

elif mode[0] == 'folder':
    if fname == 'LIVE TV: tvp.info':
        out = get_tvpLiveStreams(ex_link)
        for one in out:
           addLinkItem(one['title'].encode('utf-8'), one['url'], 'palyLiveVideo', iconimage=one['img'])
    elif fname == 'LIVE TV: looknij':
        content = ltv.get_root_looknji()
        for one in content:
            addLinkItem(one.get('title',''), one.get('url',''), 'play_looknij', iconimage=one.get('img'))
    elif fname == 'LIVE TV: telewizjada':
        content = tel.get_root_telewizjada()
        for one in content:
            ex_link="%s|%s" % (one.get('url',''),one.get('id'))
            addLinkItem(one.get('title',''), ex_link, 'play_telewizjada', one.get('epgname',None),iconimage=one.get('img'))
    elif fname == 'LIVE TV: moje-filmy.tk':
        content = m3u2list('')
        for one in content:
            addLinkItem(one.get('title',''),  one['url'], 'playUrl', one.get('epgname',None),iconimage=one.get('img'))
    elif fname == 'LIVE TV: iklub.net':
        content = iklub.get_root()
        for one in content:
            addLinkItem(one.get('title',''),  one['url'], 'play_iklub', one.get('epgname',None),infoLabels=one, iconimage=one.get('img'))
Exemplo n.º 3
0
            print 'settings.xml exists'
    else:
        outfilename = os.path.join(path,fname)     
        pDialog = xbmcgui.DialogProgressBG()
        pDialog.create('Tworze liste programow TV [%s]'%(fname), 'Uzyj z [COLOR blue]PVR IPTV Simple Client[/COLOR]')
        
        out_all = []
        if  service=='Telewizjada':
            pDialog.update(0,message='Szukam: [telewizjada]')
            out_all = tel.get_root_telewizjada(addheader=True)
        elif service=='Moje-Fimy':
            pDialog.update(0,message='Szukam: [Moje-Fimy]')
            out_all =  m3u2list('')
        elif service=='Looknij':
            pDialog.update(0,message='Szukam: [Looknij]')
            out_all = ltv.get_root_looknji(addheader=True)

        
        
        
        N=len(out_all)
        out_sum=[]
        pDialog.update(0,message= 'Znalazlem!  %d' % N  )
        
        for i,one in enumerate(out_all):
            progress = int((i)*100.0/N)
            message = '%d/%d %s'%(i,N-1,one.get('title','')) 
            pDialog.update(progress, message=message)
            #print "%d\t%s" % (progress,message)
            try:
                if 'telewizjada' in one.get('img',''):
Exemplo n.º 4
0
     pvr_path=  xbmc.translatePath(os.path.join('special://userdata/','addon_data','pvr.iptvsimple'))
     #print pvr_path
     if os.path.exists(os.path.join(pvr_path,'settings.xml')):
         print 'settings.xml exists'
 else:
     outfilename = os.path.join(path,fname)     
     pDialog = xbmcgui.DialogProgressBG()
     pDialog.create('Tworze liste programow TV [%s]'%(fname), 'Uzyj z [COLOR blue]PVR IPTV Simple Client[/COLOR]')
     
     out_all = []
     if src1: 
         pDialog.update(0,message='Szukam: [telewizjada.net]')
         out_all = out_all + tel.get_root_telewizjada(addheader=True)
     if src2:
         pDialog.update(0,message='Szukam: [telewizjada.net]')
         out_all = out_all + ltv.get_root_looknji(addheader=True)
     
     
     
     
     N=len(out_all)
     out_sum=[]
     pDialog.update(0,message= 'Znalazlem!  %d' % N  )
     
     for i,one in enumerate(out_all):
         progress = int((i)*100.0/N)
         message = '%d/%d %s'%(i,N-1,one.get('title','')) 
         pDialog.update(progress, message=message)
         #print "%d\t%s" % (progress,message)
         try:
             if 'telewizjada' in one.get('img',''):
Exemplo n.º 5
0
elif mode[0] == 'folder':
    if fname=='Kabarety TVP':
        addDir('TOP 10','/1342039/top10/')
        addDir('Skecze','/883/wideo/skecze/')
        addDir('Festiwale','/4982024/wideo/festiwale/')
        addDir('Teraz Ogladane','/5264287/teraz-ogladane/')
    elif fname == 'TVP info Live':
        out = get_tvpLiveStreams(ex_link)
        #xbmcgui.Dialog().ok('Jestem w Live',out[0]['title'].encode('utf-8'))
        for one in out:
           addLinkItem(one['title'].encode('utf-8'), one['url'], 'palyLiveVideo', iconimage=one['img'])
    elif fname == 'Dzieki Bogu Juz Weekend':
        addDir('Odcinki','/wideo/odcinki/',mode='update_DziekiBogu')
        addDir('Skecze','/wideo/skecze/',mode='update_DziekiBogu')
        addDir('Kulisy','/wideo/kulisy/',mode='update_DziekiBogu')        
    elif fname == 'vod.TVP.pl':
        Kategorie = vod.vodTVP_root()
        for k in Kategorie:
            addDir(k.get('title','').title().encode('utf-8'),str(k.get('id','')),mode='vodTVP')
# LOOKNIJ
    elif fname == '== Programy TV polskiej (live) ==':
        content = ltv.get_root_looknji()
        for one in content:
            addLinkItem(one.get('title',''), one.get('url',''), 'play_looknij', iconimage=one.get('img'))
# LOOKNIJ            
    else:
        scanTVPsource(ex_link)
       
        
xbmcplugin.endOfDirectory(addon_handle)
Exemplo n.º 6
0
def build_m3u():
    #http://192.168.1.3/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22method%22:%22Addons.ExecuteAddon%22,%22params%22:{%22addonid%22:%22plugin.video.LivePolishTV%22,%22params%22:[%22mode=BUID_M3U%22]},%22id%22:1}
    fname = my_addon.getSetting('fname')
    path =  my_addon.getSetting('path')
    service = my_addon.getSetting('service')
    #print '$$$$$$$$ service', service

    error_msg=""
    if not fname:
        error_msg +="Podaj nazwe pliku "
    if not path:
        error_msg +="Podaj katalog docelowy "
    if not service:
         error_msg +="Wybierz jakies source"
        
    if error_msg:
        xbmcgui.Dialog().notification('[COLOR red]ERROR[/COLOR]', error_msg, xbmcgui.NOTIFICATION_ERROR, 1000)
        pvr_path=  xbmc.translatePath(os.path.join('special://userdata/','addon_data','pvr.iptvsimple'))
        #print pvr_path
        if os.path.exists(os.path.join(pvr_path,'settings.xml')):
            print 'settings.xml exists'
    else:
        outfilename = os.path.join(path,fname)     
        pDialog = xbmcgui.DialogProgressBG()
        pDialog.create('Tworze liste programow TV [%s]'%(fname), 'Uzyj z [COLOR blue]PVR IPTV Simple Client[/COLOR]')
        
        out_all = []
        pDialog.update(0,message='Szukam: [%s]'%service)
        if  service=='Telewizjada':
            out_all = tel.get_root_telewizjada(addheader=True)
        elif service=='Moje-Fimy':
            out_all =  m3u2list('')
        elif service=='Looknij':
            out_all = ltv.get_root_looknji(addheader=True)
        elif service=='iklub':
            out_all = iklub.get_root(addheader=True)            
        elif service=='ihtv':
            out_all = ihtv.get_root(addheader=True)   
        elif service=='itivi':
            out_all = itivi.get_root(addheader=True)                 
        elif service=='yoy':
            out_all = yoytv.get_root(addheader=True)            
        elif service=='looknij.in':
            out_all = looknijin.get_root(addheader=True)  
  
        N=len(out_all)
        out_sum=[]
        pDialog.update(0,message= 'Znalazlem!  %d' % N  )
        
        for i,one in enumerate(out_all):
            progress = int((i)*100.0/N)
            message = '%d/%d %s'%(i,N-1,one.get('title','')) 
            pDialog.update(progress, message=message)
            #print "%d\t%s" % (progress,message)
            try:
                if service=='Telewizjada':
                    one['url'] = tel.decode_url(one.get('url',''),one.get('id',''))
                if service=='Looknij':
                    one['url'] = ltv.decode_url(one.get('url',''))
                if service=='Moje-Fimy':
                    pass # no modification is needed
                if service=='iklub':
                    one['url'] = iklub.decode_url(one.get('url',''))
                if service=='ihtv':
                    one['url'] = ihtv.decode_url(one.get('url',''))
                if service=='itivi':
                    one['url'] = itivi.decode_url(one.get('url',''))
                if service=='yoy':
                    one['url'] = yoytv.decode_url(one.get('url',''))
                if service=='looknij.in':
                    one['url'] = looknijin.decode_url(one.get('url',''))   
                    
                if one['url']:
                    if isinstance(one['url'],list):
                        for url in one['url']:
                            print url
                            one_n=deepcopy(one)
                            one_n['url'] = url 
                            out_sum.append(one_n)
                    else:
                        out_sum.append(one)
            except:
                pass
        if out_sum:
            tel.build_m3u(out_sum,outfilename)
            pDialog.update(progress, message=outfilename)
            xbmcgui.Dialog().notification('Lista zapisana', outfilename, xbmcgui.NOTIFICATION_INFO, 10000)
            xbmcgui.Dialog().ok('[COLOR green]Lista zapisana[/COLOR] ','[COLOR blue]'+outfilename+'[/COLOR]','Uaktualnij ustawienia [COLOR blue]PVR IPTV Simple Client[/COLOR] i (re)aktywuj Live TV')
            
        pDialog.close()