• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.downloadCatalog函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中resources.lib.utils.downloadCatalog函数的典型用法代码示例。如果您正苦于以下问题:Python downloadCatalog函数的具体用法?Python downloadCatalog怎么用?Python downloadCatalog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了downloadCatalog函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: list_shows

def list_shows(channel,folder):
  shows=[]
  
  if folder=='none' :                                                       
    shows.append( [channel,'ba', 'Bandes Annonces'.encode('utf-8') , '','folder'] )
    shows.append( [channel,'158003', 'Parodies'.encode('utf-8') , '','folder'] )
    shows.append( [channel,'158004', 'Emissions dActu'.encode('utf-8') , '','folder'] )
    shows.append( [channel,'158005', 'Emissions Bonus'.encode('utf-8') , '','folder'] )
    
  else:
    if folder=='ba':        
      shows.append( [channel,'/bandes-annonces/', 'A ne pas manquer'.encode('utf-8') , '','folder'] )
      shows.append( [channel,'/bandes-annonces/plus-recentes/', 'Les plus recentes'.encode('utf-8') , '','folder'] )
      shows.append( [channel,'/bandes-annonces/prochainement/', 'Bientot au cinema'.encode('utf-8') , '','folder'] )
    
    
    elif folder.find('/')==-1 or  folder.find('bandes-annonces')!=-1:
      if folder.find('bandes-annonces')!=-1:          
        filePath=utils.downloadCatalog('http://www.allocine.fr/video%s' % (folder),'allocine%s1.html' % (folder),False) 
      else:
        filePath=utils.downloadCatalog('http://www.allocine.fr/video/prgcat-%s/' % (folder),'allocine%s1.html' % (folder),False)    
      html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace('\n', ' ').replace('\r', '')
      nbPages=1
      pages=re.findall('<li><a href="(.*?)">(.*?)</a></li>', html)
      if pages:
        nbPages=len(pages)+1
        
      for i in range(1, nbPages+1): 
        if folder.find('bandes-annonces')!=-1:          
          filePath=utils.downloadCatalog('http://www.allocine.fr/video%s?page=%s' % (folder,i),'allocine%s%s.html' % (folder,i),False) 
        else:
          filePath=utils.downloadCatalog('http://www.allocine.fr/video/prgcat-%s/?page=%s' % (folder,i),'allocine%s%s.html' % (folder,i),False)
        html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace('\n', ' ').replace('\r', '')
        
        images=re.findall('<div class="pos_rel thumbs.*?" > <span class="(.*?)"> <img(.*?)src=\'(.*?)\' /> </span> </div>', html)
        
        items=re.findall('<h. class="title "> <a href="(.*?)">(.*?)</a> </h.>', html)
        j=0
        image=''
        for item in items:
          if images[j][1]!=' ':
             image= images[j][1].replace(' data-attr=\'{"src":"','').replace('"}\'','')
          else:
            image=images[j][2]
          if folder.find('bandes-annonces')!=-1: 
            videoId=re.findall('player_gen_cmedia=(.*?)&cfilm',item[0])[0]   
            infoLabels={ "Title": formatTitle(item[1])}
            shows.append( [channel, videoId, formatTitle(item[1]), image,'play'] )   
          else:        
            shows.append( [channel,item[0], formatTitle(item[1]) ,image ,'folder'] )
          j=j+1
    else:
      filePath=utils.downloadCatalog('http://www.allocine.fr%s' % (folder),'allocine%s.html' % (folder),False)
      html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace('\n', ' ').replace('\r', '')
                                                                                                                                 
      seasons=re.findall('<a class="button btn-primary btn-large" href="(.*?)">(.*?)</a>', html)
      for season in seasons:                                                          
        shows.append( [channel,season[0], formatTitle(season[1]) ,'' ,'shows'] )
              
  return shows
开发者ID:julfla,项目名称:plugin.video.freplay,代码行数:60,代码来源:allocine.py


示例2: list_shows

def list_shows(channel,folder):

    shows=[]
    
    filePath=utils.downloadCatalog('http://www.nrj-play.fr/%s/replay' % channel,channel + '.html',False,{})    
    html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace("\n", "")
    html=' '.join(html.split())
    
    if folder=='none':      
        match = re.compile(r'<li class="subNav-menu-item">(.*?)<a href="(.*?)" class=(.*?)>(.*?)</a>',re.DOTALL).findall(html)
        if match:
            for empty,link,empty2,title in match:
                if 'active' not in empty2:
                  shows.append( [channel,link, title , '','folder'] )
    
    else:                                                                                     
      print 'http://www.nrj-play.fr%s' % (folder)
      filePath=utils.downloadCatalog('http://www.nrj-play.fr%s' % (folder),channel + folder +'.html',False,{})  
      html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace("\n", "")
      html=' '.join(html.split())
      print html
      
      match = re.compile(r'<h2 class="linkProgram-title">(.*?)</h2>(.*?)<a href="(.*?)" class="linkProgram-more"(.*?)<img src="(.*?)" class="program-img"',re.DOTALL).findall(html)

      if match:
        for title,empty1,link,empty2,img in match:
          title = common.replaceHTMLCodes(title)
          title = title.title()
          shows.append( [channel,link, title.encode("utf-8") , img,'shows'] )                           
                     
    return shows           
开发者ID:mperreir,项目名称:plugin.video.freplay,代码行数:31,代码来源:nrj12.py


示例3: list_shows

def list_shows(channel,folder):  
  shows      = []       
  uniqueItem = dict()  
          
  if folder=='none':
    filePath   = utils.downloadCatalog(urlCatalog ,'rts.json',False,{})  
    filPrgm    = open(filePath).read()
    jsonParser = json.loads(filPrgm)   
    topics  = jsonParser['Topics']['Topic']
    for topic in topics :           
      shows.append( [channel,topic['id'], topic['title'].encode('utf-8'),'','folder'] )  
  else:        
    filePath   = utils.downloadCatalog(showsList % folder ,'rts%s.json' % folder,False,{})  
    filPrgm    = open(filePath).read()
    jsonParser = json.loads(filPrgm)   
    videos  = jsonParser['Videos']['Video']
    for video in videos :    
      print video  
      idSet=video['AssetSet']['Show']['id']
      if idSet not in uniqueItem:
        uniqueItem[idSet]=idSet
        imgURL=video['AssetSet']['Show']['Image']['ImageRepresentations']['ImageRepresentation'][0]['url']+imgFormat    
        shows.append( [channel,folder + '-' + idSet, video['AssetSet']['title'].encode('utf-8'),imgURL.encode('utf-8'),'shows'] )
      
  return shows
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:25,代码来源:rts.py


示例4: list_shows

def list_shows(channel,folder):

    shows=[]
    
    filePath=utils.downloadCatalog('http://www.nrj-play.fr/%s/replay' % channel,channel + '.html',False,{})    
    html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a')

    if folder=='none':      
        match = re.compile(r'<li class="subNav-menu-item">(.*?)<a href="(.*?)" class=(.*?)>(.*?)</a>',re.DOTALL).findall(html)
            
        if match:
            for empty,link,empty2,title in match:
                if 'active' not in empty2:
                  shows.append( [channel,link, title , '','folder'] )
    else:                                                                                     
      print 'http://www.nrj-play.fr%s' % (folder)
      filePath=utils.downloadCatalog('http://www.nrj-play.fr%s' % (folder),channel + folder +'.html',False,{})  
      html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace("\n", "")
      
      match = re.compile(r'<div class="linkProgram-infos">(.*?)<a href="(.*?)" class="linkProgram-thumbnail embed-responsive embed-responsive-16by9">(.*?)<img src="(.*?)" class="program-img embed-responsive-item" alt="(.*?)"',re.DOTALL).findall(html)
      if match:
        for empty,link,empty2,img,title in match:
          shows.append( [channel,link, title.encode("utf-8") , img,'shows'] )                           
                     
    return shows
开发者ID:X-ardion,项目名称:JUL1EN094-xbmc-addons,代码行数:25,代码来源:nrj12.py


示例5: list_shows

def list_shows(channel,folder):
  shows=[]
  
  if folder=='none' :                                                       
    shows.append( [channel,'ba', 'Bandes Annonces'.encode('utf-8') , '','folder'] )
    shows.append( [channel,'158001|1', 'Webseries'.encode('utf-8') , '','folder'] )
    shows.append( [channel,'158002|1', 'Mangas'.encode('utf-8') , '','folder'] )
    shows.append( [channel,'158003|1', 'Parodies'.encode('utf-8') , '','folder'] )
    shows.append( [channel,'158004|1', 'Emissions dActu'.encode('utf-8') , '','folder'] )
    shows.append( [channel,'158005|1', 'Emissions Bonus'.encode('utf-8') , '','folder'] )
    shows.append( [channel,'158006|1', 'Stars'.encode('utf-8') , '','folder'] )
    
  else:
    if folder=='ba':        
      shows.append( [channel,'video/bandes-annonces/|1', 'A ne pas manquer'.encode('utf-8') , '','shows'] )
      shows.append( [channel,'/bandes-annonces/plus-recentes/|1', 'Les plus recentes'.encode('utf-8') , '','shows'] )
      shows.append( [channel,'/bandes-annonces/prochainement/|1', 'Bientot au cinema'.encode('utf-8') , '','shows'] )
    else:    
      if 'programme' in folder:
        filePath=utils.downloadCatalog('http://www.allocine.fr/' + folder ,'allocine' + folder.replace('\\','') +'.html',False,{})
        html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace('\n', ' ').replace('\r', '')
        
        match = re.compile(r'<a class="button btn-primary btn-large" href="(.*?)">(.*?)</a>',re.DOTALL).findall(html)
        for url,title in match:
          shows.append( [channel,url + '|1', title.replace("<i class='icon-sign-plus'></i>","") ,'' ,'shows'] )  
                  
      else:   
        cat,page=folder.split('|')
        filePath=utils.downloadCatalog('http://www.allocine.fr/video/prgcat-' + cat + '/?page=' + page ,'allocine' + cat + '-' + page +'.html',False,{})
        html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace('\n', ' ').replace('\r', '')
        
        match = re.compile(r'btn-primary btn-large (.*?)">(.*?)<i class="icon-arrow-(.*?)"></i>',re.DOTALL).findall(html)
        prev=False
        next=False
        for status,empty,arrow in match:
          if arrow=='left':
            prev=('disabled' not in status)
          if arrow=='right':
            next=('disabled' not in status)
            
        if prev:
          shows.append( [channel,cat + '|' + str(int(page)-1), '<<Page Precedente' ,'' ,'folder'] )
              
        match = re.compile(r'<h2 class="title "> <span > <a href="(.*?)">(.*?)</a> </span> </h2>',re.DOTALL).findall(html)
        for url,title in match:                                                          
          shows.append( [channel,url, title ,'' ,'folder'] )
        
        if next :
          shows.append( [channel,cat + '|' + str(int(page)+1), 'Page Suivante>>' ,'' ,'folder'] )
                             
      
  return shows          
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:52,代码来源:allocine2.py


示例6: list_videos

def list_videos(channel,params):
    videos      = []                  
    program_url = params.split('|')[0]
    titre_program      = params.split('|')[1]

    filePath = utils.downloadCatalog(program_url,'becurioustv_'+titre_program+'.html',False,{})
    html     = open(filePath).read().decode("utf-8")

    season_grid = common.parseDOM(html,"div",attrs={"class":"seasons-grid tab-season"})

    for season in season_grid:
        list_li = common.parseDOM(season,"li")
        for li in list_li:
            title_h5 = common.parseDOM(li,"h5")
            title = common.parseDOM(title_h5,"a")[0].encode('utf-8')
            #title = common.replaceHTMLCodes(title)

            url_show = common.parseDOM(title_h5,"a", ret="href")[0].encode('utf-8')
            url_show = url_root+url_show

            url_icon = common.parseDOM(li,"img", ret="src")[0].encode('utf-8')

            episode_number = common.parseDOM(li,"div", attrs={"class":"user-info"})
            episode_number = common.parseDOM(episode_number, "a")[0].encode('utf-8')

            videos.append([channel,url_show+'|'+title,title,url_icon,{'Title':title+" - "+episode_number},'play'])
    return videos
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:27,代码来源:becurioustv.py


示例7: list_shows

def list_shows(channel,folder):
    shows = []
    filePath = utils.downloadCatalog(url_shows,'becurioustv.html',False,{}) # Page principale du replay
    html = open(filePath).read().decode("utf-8")
    shows_container = common.parseDOM(html,"div", attrs={"class": "shows-container background-pink"})
    
    if folder == 'none':
        for show in shows_container:
            title = common.parseDOM(show,"h1", attrs={"class": "color-magenta"})[0].encode('utf-8')
            show_icon = common.parseDOM(show,"div", attrs={"class": "shows__icon"})
            url_show = common.parseDOM(show_icon,"img", ret="src")[0].encode('utf-8')
            url_show = url_root+url_show
            shows.append([channel,title,title,url_show,'folder'])
    else:
        for show in shows_container:
            if folder in show.encode('utf-8'):
                item_list = common.parseDOM(show,"div", attrs={"class": "item"})
                for item in item_list: 
                    title = common.parseDOM(item,"h2")[0].encode('utf-8')
                    #title = common.replaceHTMLCodes(title)

                    episodes_length = common.parseDOM(item,"span")[0].encode('utf-8')

                    url_show = common.parseDOM(item,"a", ret="href")[0].encode('utf-8')
                    url_show = url_root+url_show

                    url_icon = common.parseDOM(item,"img", ret="src")[0].encode('utf-8')
                    url_icon = url_root+url_icon

                    shows.append([channel,url_show+'|'+title,title+" - "+episodes_length,url_icon,'shows'])
    return shows
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:31,代码来源:becurioustv.py


示例8: list_videos

def list_videos(channel,show_title):
    videos=[]     
    
    filePath=utils.downloadCatalog('http://webservices.francetelevisions.fr/catchup/flux/flux_main.zip','Pluzz.zip',False)

    zf          = zipfile.ZipFile(filePath)
    data        = zf.read('catch_up_' + channel + '.json')
    jsoncatalog = json.loads(data)
    programmes  = jsoncatalog['programmes']
    for programme in programmes :
        name  = programme['titre'].encode("utf-8")
        if name == show_title :
            desc=''
            duration=0
            date=''
            if programme['date'] :
                date      = str(programme['date'].split('-')[2])+'-'+str(programme['date'].split('-')[1])+'-'+str(programme['date'].split('-')[0])
                
            if programme['sous_titre'] != "" :
                name  = name +' : '+programme['sous_titre'].encode("utf-8") 
            else:
                name+=' - ' + date
            video_url   = url_base_videos+programme['url_video'].encode("utf-8")
            image_url = url_base_images+programme['url_image_racine'].encode("utf-8")+'.'+programme['extension_image'].encode("utf-8")
            if programme['accroche'] :
                desc      = programme['accroche'].encode("utf-8")
            if programme['duree'] :
                duration  = programme['duree'].encode("utf-8")
            infoLabels={ "Title": name,"Plot":desc,"Aired":date,"Duration": duration, "Year":date[:4]}
            videos.append( [channel, video_url, name, image_url,infoLabels,'play'] )

    return videos
开发者ID:julfla,项目名称:plugin.video.freplay,代码行数:32,代码来源:pluzz.py


示例9: getVideoURL

def getVideoURL(channel,video_url):
    file_path = utils.downloadCatalog(video_url, video_url, bypass_cache, {})
    html = open(file_path).read()
    videoId  = video_id_re.search(html).group(1)
    result = 'plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid='+videoId;
    print("RESULT : " + result)
    return result;
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:7,代码来源:tetesaclaques.py


示例10: list_videos

def list_videos(channel,show): 
    
    videos=[]
    url_list = show.split('|')[0]
    title = show.split('|')[1]                                                                               
    
    another_page = True
    current_page = 1
    while another_page == True:
        url_page = url_list+'?&page='+str(current_page)
        filePath=utils.downloadCatalog(url_page ,channel +'_'+ title +'_'+str(current_page)+'.html',False,{})  
        html=open(filePath).read()

        if 'document.documentSelection.page.value='+str(current_page+1) in html:
            current_page += 1
        else:
            another_page = False

                                                       # empty         # year        #empty1        # duration     #empty2 #empty3 #title   #empty4 #desc      #empty5       #link       #empty6 
        match = re.compile(r'<div class="bloc_gauche_image">(.*?)<img src="(.*?)" border="0"(.*?)Date :</span>(.*?)</div>(.*?)Durée : </span>(.*?):(.*?):(.*?)</div>(.*?)<span(.*?)>(.*?)</span>(.*?)>(.*?)</span>(.*?)<a href="(.*?)" class=(.*?)',re.DOTALL).findall(html)

        if match:
            for empty0, img, empty, year, empty1, hour, minutes, seconds, empty2, empty3, title, empty4, desc, empty5, link, empty6 in match:
                link = url_root+"/"+link

                duration = int(hour)*3600 + int(minutes)*60 + int(seconds)
                #desc = " ".join(desc.split())
                date = "01/01/"+year
                infoLabels={ "Title": title, "Plot":desc, "Year":year, "Aired":date}
                videos.append( [channel, link, title, img,infoLabels,'play'] ) 

    return videos
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:32,代码来源:cnes.py


示例11: list_videos

def list_videos(channel,param):
  folder=param.split('$$')[0]  
  category=param.split('$$')[1]
  
  videos=[] 
  filePath=utils.downloadCatalog(urlBase + folder,'gulli' + folder +'.html',False,{})    
  html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace("\n", " ") 
  html=' '.join([segment for segment in html.split()])
  
  uls = common.parseDOM(html,"ul",attrs={"class":"liste_resultats"})
  for ul in uls:
    replays = common.parseDOM(ul,"li")
    for replay in replays :
      title = (common.parseDOM(replay,"span",attrs={"class":"tooltip_ctnt"}) [0]).encode("utf-8") 
      if title == category:
        match = re.compile(r'<p> <strong>(.*?)</strong> <span>(.*?)<br/>(.*?)</span> </p>',re.DOTALL).findall(replay)            
        if match:
          for t,st,e in match:
            title=t + '-' + st + '-' + e.replace('&nbsp;',' ')
        img = re.findall('src="(.*?)"',replay) [0]  
        url= re.findall('href="(.*?)"',replay) [0]
        iStart=url.find('VOD')
        vodId= url[iStart:]       
        infoLabels={ "Title": title}
        videos.append( [channel, vodId.encode("utf-8") , title.encode("utf-8") , img,infoLabels,'play'] )
  return videos
开发者ID:SylvainCecchetto,项目名称:JUL1EN094-xbmc-addons,代码行数:26,代码来源:gulli.py


示例12: list_shows

def list_shows(channel, folder):
    shows = []
    d = dict()

    filePath = utils.downloadCatalog(url_xml, "ARTE.XML", False, {})
    if folder == "none":
        xml = open(filePath).read()
        url = common.parseDOM(xml, "url")
        for i in range(0, len(url)):
            categoryTab = common.parseDOM(url[i], "video:category")
            if len(categoryTab) > 0:
                category = typo_correction(fix_text(categoryTab[0]))
                if category not in d:
                    shows.append([channel, category, category, "", "folder"])
                    d[category] = category
    else:
        xml = open(filePath).read()
        url = common.parseDOM(xml, "url")
        for i in range(0, len(url)):
            show_titleTab = common.parseDOM(url[i], "video:show_title")
            if len(show_titleTab) > 0:
                title = fix_text(show_titleTab[0])
            categoryTab = common.parseDOM(url[i], "video:category")
            if globalvar.ADDON.getSetting("arteFull") == "true":
                videoTag = common.parseDOM(url[i], "video:tag")[0]
            else:
                videoTag = "ARTE+7"
            if len(categoryTab) > 0:
                if typo_correction(fix_text(categoryTab[0])) == folder and title not in d and videoTag == "ARTE+7":
                    shows.append([channel, title, title, "", "shows"])
                    d[title] = title
    return shows
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:32,代码来源:arte.py


示例13: list_videos

def list_videos(channel,link): 
    
    videos=[]
    
    filePath=utils.downloadCatalog('http://www.nrj-play.fr' + link,channel + link.replace('/','') +'.html',False,{})    
    html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace("\n", "")
    html=' '.join(html.split())    
    print html
    
    match = re.compile(r'<img itemprop="thumbnailUrl" src="(.*?)" class="thumbnail-img embed-responsive-item"(.*?)<h3 class="thumbnail-title" itemprop="name"> <a href="(.*?)">(.*?)</a> </h3>',re.DOTALL).findall(html)

    if match:
      for img,empty,link,title in match:
        title = common.replaceHTMLCodes(title)
        title = title.title()                          
        infoLabels={ "Title": title}
        videos.append( [channel, link , title , img,infoLabels,'play'] )
    else:         
      match = re.compile(r'<meta itemprop="name" content="(.*?)" />',re.DOTALL).findall(html) 
      if match:
        for title in match:
          title = common.replaceHTMLCodes(title)
          title = title.title()                          
          infoLabels={ "Title": title}
          videos.append( [channel, link , title , '',infoLabels,'play'] )
          
    return videos
开发者ID:mperreir,项目名称:plugin.video.freplay,代码行数:27,代码来源:nrj12.py


示例14: list_videos

def list_videos(channel,params):
    videos      = []                  
    program_url = params.split('|')[0]
    titre_program      = params.split('|')[1]

    filePath = utils.downloadCatalog(program_url,'telequebec_'+titre_program+'.html',False,{})
    html     = open(filePath).read().decode("utf-8")

    # season_grid = common.parseDOM(html,"div",attrs={"class":"seasons-grid tab-season"})

    # for season in season_grid:
    #     list_li = common.parseDOM(season,"li")
    #     for li in list_li:
    #         title_h5 = common.parseDOM(li,"h5")
    #         title = common.parseDOM(title_h5,"a")[0].encode('utf-8')
    #         #title = common.replaceHTMLCodes(title)

    #         url_show = common.parseDOM(title_h5,"a", ret="href")[0].encode('utf-8')
    #         url_show = url_root+url_show

    #         url_icon = common.parseDOM(li,"img", ret="src")[0].encode('utf-8')

    #         episode_number = common.parseDOM(li,"div", attrs={"class":"user-info"})
    #         episode_number = common.parseDOM(episode_number, "a")[0].encode('utf-8')

    #videos.append([channel,program_url+'|'+'title','title','url_icon',{'Title':'title'+" - "+'episode_number'},'play'])
    return videos
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:27,代码来源:telequebec.py


示例15: list_videos

def list_videos(channel,folder):
  videos     = []    
  uniqueItem = dict()  
  filePath   = utils.downloadCatalog(channelCatalog % (channel),'%s.json' % (channel),False) 
  filPrgm    = open(filePath).read()
  jsonParser = json.loads(filPrgm)   
  emissions  = jsonParser['reponse']['emissions']  
  for emission in emissions :           
    titre = emission['titre_programme'].encode('utf-8')
    if titre==folder: 
      id_diffusion=emission['id_diffusion']
      filPrgm        = urllib2.urlopen(showInfo % (emission['id_diffusion'])).read()
      jsonParserShow = json.loads(filPrgm)       
      plot           = jsonParserShow['synopsis'].encode('utf-8')
      date           = jsonParserShow['diffusion']['date_debut']
      if jsonParserShow['real_duration']!=None : 
          duration   = jsonParserShow['real_duration']/60
      titre          = jsonParserShow['titre'].encode('utf-8')
      if jsonParserShow['sous_titre']!='':
        titre+=' - ' + jsonParserShow['sous_titre'].encode('utf-8')
      image      = imgURL % (jsonParserShow['image'])  
      infoLabels = { "Title": titre,"Plot":plot,"Aired":date,"Duration": duration, "Year":date[6:10]}
      if jsonParserShow['genre']!='':
          infoLabels['Genre']=jsonParserShow['genre'].encode('utf-8')
      videos.append( [channel, id_diffusion, titre, image,infoLabels,'play'] )    
  return videos    
开发者ID:julfla,项目名称:plugin.video.freplay,代码行数:26,代码来源:pluzz2.py


示例16: list_videos

def list_videos(channel,show_title):
  videos=[]                
  filePath=utils.downloadCatalog('http://www.tv5mondeplusafrique.com/dotscreen/exportAfrique.xml','TV5AF.XML',False,{})
  xml = open(filePath).read()
  item=common.parseDOM(xml, "item")
  lids = common.parseDOM(xml, "item", ret = "lid")
  
  for i in range(0, len(item)):
    titres=common.parseDOM(item[i], "titre")
    if len(titres)>0:
      titre=titres[0]
      titre=titre[9:-3]
      if '-EP' in titre:
        titreFilter=titre[:titre.find('-EP')]
        titre=titre[titre.find('-EP')+1:]
        
    if titreFilter==show_title:
      plots=common.parseDOM(item[i], "descriptif")
      if len(plots)>0:
        plot=plots[0]
        plot=plot[9:-3] 
        
      durees=common.parseDOM(item[i], "duree")
      if len(durees)>0:
        sDuree=durees[0]
        duree=int(sDuree[0:2])*60+int(sDuree[3:5])
        
      dates=common.parseDOM(item[i], "dateCreation")
      if len(dates)>0:
        date=dates[0]
    
      infoLabels={ "Title": titre,"Plot":plot,"Aired":date,"Duration": duree}
      videos.append( [channel, lids[i], titre.encode('utf-8'), urlIMG % (lids[i]),infoLabels,'play'] )
  return videos
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:34,代码来源:tv5af.py


示例17: list_videos

def list_videos(channel,param):
  folder=param.split('$$')[0]
  category=param.split('$$')[1]

  videos=[]
  cpt=0
  cptStr=''
  while cpt != -1:
    filePath=utils.downloadCatalog(urlBase + folder + cptStr,'gulli' + folder + str(cpt) +'.html',False,{})
    html=open(filePath).read().replace('\xe9', 'e').replace('\xe0', 'a').replace("\n", " ")

    uls = common.parseDOM(html,"ul",attrs={"class":"block_content clearfix"})
    for ul in uls:
        replays = common.parseDOM(ul,"li")
        for replay in replays :
          title = (common.parseDOM(replay,"span",attrs={"class":"title"}) [0]).encode("utf-8")
          if title == category:
            cpt=-1
            title=(htmlParser.unescape(common.parseDOM(replay,"span",attrs={"class":"episode_title"}) [0])).encode("utf-8")
            img = 'http://' + re.findall('src="//(.*?)"',replay) [0]
            url= re.findall('href="(.*?)"',replay) [0]
            iStart=url.find('VOD')
            vodId= url[iStart:]
            infoLabels={ "Title": title}
            videos.append( [channel, vodId.encode("utf-8") , title , img,infoLabels,'play'] )
    if len(uls) != 0 and cpt != -1:
        cpt=cpt+1
        cptStr='/'+str(cpt)
    else:
        cpt=-1
  return videos
开发者ID:X-ardion,项目名称:JUL1EN094-xbmc-addons,代码行数:31,代码来源:gulli.py


示例18: list_shows

def list_shows(channel,folder):
  shows      = []
  uniqueItem = dict()  
  filePath   = utils.downloadCatalog(channelCatalog % (channel),'%s.json' % (channel),False) 
  filPrgm    = open(filePath).read()
  jsonParser = json.loads(filPrgm)   
  emissions  = jsonParser['reponse']['emissions']  
  if folder=='none':           
    for emission in emissions :           
      rubrique = emission['rubrique'].title().encode('utf-8')
      if rubrique not in uniqueItem:
        uniqueItem[rubrique] = rubrique
        shows.append( [channel,rubrique, rubrique,'','folder'] )
  else:
    for emission in emissions :           
      rubrique = emission['rubrique'].title().encode('utf-8')
      if rubrique==folder:        
        titre = emission['titre_programme'].encode('utf-8')
        if titre!='':      
          id = emission['id_programme'].encode('utf-8')
          if id=='':
            id = emission['id_emission'].encode('utf-8')        
          if id not in uniqueItem:
            uniqueItem[id]=id
            shows.append( [channel,id,titre,imgURL % (emission['image_large']),'shows'] )     
  return shows
开发者ID:mickylove,项目名称:JUL1EN094-xbmc-addons,代码行数:26,代码来源:pluzz2.py


示例19: list_shows

def list_shows(channel,folder):
    shows=[]
    d=dict()
    
    filePath=utils.downloadCatalog('http://www.arte.tv/papi/tvguide-flow/sitemap/feeds/videos/F.xml','ARTE.XML',False,{})
    if folder=='none':
        xml = open(filePath).read()
        url=common.parseDOM(xml, "url")
        for i in range(0, len(url)):
            categoryTab=common.parseDOM(url[i], "video:category")
            if len(categoryTab)>0:
                category=fix_text(categoryTab[0])
                if category not in d:
                    shows.append( [channel,category,category,'','folder'] )
                    d[category]=category
    else:
        xml = open(filePath).read()
        url=common.parseDOM(xml, "url")
        for i in range(0, len(url)):
            titleTab=common.parseDOM(url[i], "video:title")
            if len(titleTab)>0:
                title=fix_text(titleTab[0])
            categoryTab=common.parseDOM(url[i], "video:category")
            if globalvar.ADDON.getSetting('arteFull')=='true':
              videoTag=common.parseDOM(url[i], "video:tag")[0]
            else:
              videoTag='ARTE+7'  
            if len(categoryTab)>0:
                if(fix_text(categoryTab[0])==folder and title not in d and videoTag=='ARTE+7'):                   
                    shows.append( [channel,title,title,'','shows'] )
                    d[title]=title
    return shows
开发者ID:Kawakiw,项目名称:kawakodi,代码行数:32,代码来源:arte.py


示例20: list_shows

def list_shows(channel,folder):
    shows    = []
    filePath = utils.downloadCatalog(url_catalog,'cherie25.html',False)
    html     = open(filePath).read().decode("utf-8")
    line_s   = common.parseDOM(html,"div",attrs={"class":u"line replay magazines"})
    for line in line_s :
        title          = common.parseDOM(line,"div",attrs={"class":"title"})[0]
        categorie_name = common.parseDOM(title,"span")[0].encode("utf-8")
        if folder=='none' :
            shows.append([channel,categorie_name,categorie_name,'','folder'])
        elif folder==categorie_name :
            li_s = common.parseDOM(line,"li",attrs={"id":"liste_[0-9]"})
            for li in li_s :
                replay_hover_s = common.parseDOM(li,"div",attrs={"class":u"replay_hover"})
                if replay_hover_s :
                    image_div  = common.parseDOM(li,"div",attrs={"class":"image"})[0]
                    image_a_u  = common.parseDOM(image_div,"a")[0]
                    image_url  = common.parseDOM(image_a_u,"img",ret="src")[0]
                    titre_p    = common.parseDOM(li,"p",attrs={"class":"titre"})[0]
                    titre_u    = common.parseDOM(titre_p,"a")[0]
                    titre      = titre_u.encode("utf-8")
                    shows.append([channel,titre+'|'+image_url,titre,image_url,'shows'])
                else :
                    image_div   = common.parseDOM(li,"div",attrs={"class":"image"})[0]
                    image_a_u   = common.parseDOM(image_div,"a")[0]
                    image_url   = common.parseDOM(image_a_u,"img",ret="src")[0]
                    titre_p     = common.parseDOM(li,"p",attrs={"class":"titre"})[0]
                    titre_u     = common.parseDOM(titre_p,"a")[0]
                    titre       = titre_u.encode("utf-8")
                    video_url_u = url_root+common.parseDOM(titre_p,"a",ret="href")[0]
                    video_url   = video_url_u.encode("utf-8")
                    shows.append([channel,video_url+'|'+titre,titre,image_url,'shows'])                     
    return shows
开发者ID:mickylove,项目名称:JUL1EN094-xbmc-addons,代码行数:33,代码来源:cherie25.py



注:本文中的resources.lib.utils.downloadCatalog函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.getHtml函数代码示例发布时间:2022-05-26
下一篇:
Python utils.cleantext函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap