当前位置: 首页>>代码示例>>Python>>正文


Python Addon.save_data方法代码示例

本文整理汇总了Python中t0mm0.common.addon.Addon.save_data方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.save_data方法的具体用法?Python Addon.save_data怎么用?Python Addon.save_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在t0mm0.common.addon.Addon的用法示例。


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

示例1: proxpesquisa

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import save_data [as 别名]
def proxpesquisa():
    from t0mm0.common.addon import Addon
    addon=Addon(addon_id)
    form_d=addon.load_data('temp.txt')
    ref_data = {'Accept':'*/*','Content-Type':'application/x-www-form-urlencoded','Host':'abelhas.pt','Origin':'http://abelhas.pt','Referer':url,'User-Agent':user_agent,'X-Requested-With':'XMLHttpRequest'}
    form_d['Page']= form_d['Page'] + 1
    endlogin=MainURL + 'action/SearchFiles/Results'
    net.set_cookies(cookies)
    conteudo= net.http_POST(endlogin,form_data=form_d,headers=ref_data).content.encode('latin-1','ignore')
    addon.save_data('temp.txt',form_d)
    pastas(MainURL + 'action/nada','coco',conteudo=conteudo)
开发者ID:Thewallguy,项目名称:fightnight-addons,代码行数:13,代码来源:default.py

示例2: Search

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import save_data [as 别名]
def Search():
    last_search = Addon.load_data('search')
    if not last_search: last_search = ''
    search_entered =''
    keyboard = xbmc.Keyboard(search_entered, '[B][I] SEARCH TV-REALEASE.NET TVShows[/B][/I]')
    last_search = last_search.replace('%20',' ')
    keyboard.setDefault(last_search)
    keyboard.doModal()
    if keyboard.isConfirmed():
        search_entered = keyboard.getText().replace(' ','%20')# sometimes you need to replace spaces with + or %20#
        Addon.save_data('search',search_entered)
    if search_entered == None or len(search_entered)<1:
        MAIN()
    else:
        url = base64.b64encode('http://www.tv-release.net/?s='+search_entered+'&cat=')
        Index(url, '')
开发者ID:philtimmes,项目名称:addons,代码行数:18,代码来源:default.py

示例3: SEARCH

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import save_data [as 别名]
def SEARCH(url):
    last_search = Addon.load_data('search')
    if not last_search: last_search = ''
    search_entered =''
    keyboard = xbmc.Keyboard(search_entered, '[B][I] SEARCH TV-REALEASE.NET TVShows[/B][/I]')
    last_search = last_search.replace('+',' ')
    keyboard.setDefault(last_search)
    keyboard.doModal()
    if keyboard.isConfirmed():
        search_entered = keyboard.getText().replace(' ','+')# sometimes you need to replace spaces with + or %20#
        Addon.save_data('search',search_entered)
    if search_entered == None or len(search_entered)<1:
        MAIN()
    else:
        url = 'http://tv-release.net/?s="%s"&cat='%(search_entered)
        types = None
        SEARCHRESULTS(url,types)
开发者ID:Ultraporing,项目名称:jas0npc,代码行数:19,代码来源:default.py

示例4: criarplaylist

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import save_data [as 别名]
def criarplaylist(url,name,formcont={},conteudo=''):
      mensagemprogresso.create('Abelhas.pt', traducao(40049))
      playlist = xbmc.PlayList(1)
      playlist.clear()
      if re.search('action/SearchFiles',url):
            ref_data = {'Host': 'abelhas.pt', 'Connection': 'keep-alive', 'Referer': 'http://abelhas.pt/','Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8','User-Agent':user_agent,'Referer': 'http://abelhas.pt/'}
            endlogin=MainURL + 'action/SearchFiles'
            conteudo= net.http_POST(endlogin,form_data=formcont,headers=ref_data).content.encode('latin-1','ignore')
            if re.search('O ficheiro n&#227;o foi encontrado',conteudo):
                  mensagemok('Abelhas.pt','Sem resultados.')
                  sys.exit(0)
            try:
                  filename=re.compile('<input name="FileName" type="hidden" value="(.+?)" />').findall(conteudo)[0]
                  try:ftype=re.compile('<input name="FileType" type="hidden" value="(.+?)" />').findall(conteudo)[0]
                  except: ftype='All'
                  pagina=1
                  token=re.compile('<input name="__RequestVerificationToken" type="hidden" value="(.+?)"').findall(conteudo)[0]
                  form_d = {'IsGallery':'True','FileName':filename,'FileType':ftype,'ShowAdultContent':'True','Page':pagina,'__RequestVerificationToken':token}
                  from t0mm0.common.addon import Addon
                  addon=Addon(addon_id)
                  addon.save_data('temp.txt',form_d)
                  ref_data = {'Accept':'*/*','Content-Type':'application/x-www-form-urlencoded','Host':'abelhas.pt','Origin':'http://abelhas.pt','Referer':url,'User-Agent':user_agent,'X-Requested-With':'XMLHttpRequest'}
                  endlogin=MainURL + 'action/SearchFiles/Results'
                  conteudo= net.http_POST(endlogin,form_data=form_d,headers=ref_data).content.encode('latin-1','ignore')
            except: pass
      else:
            if conteudo=='':
                  extra='?requestedFolderMode=filesList&fileListSortType=Name&fileListAscending=True'
                  conteudo=clean(abrir_url_cookie(url + extra))
      if re.search('ProtectedFolderChomikLogin',conteudo):
            chomikid=re.compile('<input id="ChomikId" name="ChomikId" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            folderid=re.compile('<input id="FolderId" name="FolderId" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            foldername=re.compile('<input id="FolderName" name="FolderName" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            token=re.compile('<input name="__RequestVerificationToken" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            passwordfolder=caixadetexto('password')
            form_d = {'ChomikId':chomikid,'FolderId':folderid,'FolderName':foldername,'Password':passwordfolder,'Remember':'true','__RequestVerificationToken':token}
            ref_data = {'Accept':'*/*','Content-Type':'application/x-www-form-urlencoded','Host':'abelhas.pt','Origin':'http://abelhas.pt','Referer':url,'User-Agent':user_agent,'X-Requested-With':'XMLHttpRequest'}
            endlogin=MainURL + 'action/Files/LoginToFolder'
            teste= net.http_POST(endlogin,form_data=form_d,headers=ref_data).content.encode('latin-1','ignore')
            teste=urllib.unquote(teste)
            if re.search('IsSuccess":false',teste):
                  mensagemok('Abelhas.pt',traducao(40002))
                  sys.exit(0)
            else: pastas_ref(url)
      elif re.search('/action/UserAccess/LoginToProtectedWindow',conteudo):
            chomikid=re.compile('<input id="TargetChomikId" name="TargetChomikId" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            chomiktype=re.compile('<input id="ChomikType" name="ChomikType" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            sex=re.compile('<input id="Sex" name="Sex" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            accname=re.compile('<input id="AccountName" name="AccountName" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            isadult=re.compile('<input id="AdultFilter" name="AdultFilter" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            adultfilter=re.compile('<input id="AdultFilter" name="AdultFilter" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            passwordfolder=caixadetexto('password')
            form_d = {'Password':passwordfolder,'OK':'OK','RemeberMe':'true','IsAdult':isadult,'Sex':sex,'AccountName':accname,'AdultFilter':adultfilter,'ChomikType':chomiktype,'TargetChomikId':chomikid}
            ref_data = {'Accept':'*/*','Content-Type':'application/x-www-form-urlencoded','Host':'abelhas.pt','Origin':'http://abelhas.pt','Referer':url,'User-Agent':user_agent,'X-Requested-With':'XMLHttpRequest'}
            endlogin=MainURL + 'action/UserAccess/LoginToProtectedWindow'
            teste= net.http_POST(endlogin,form_data=form_d,headers=ref_data).content.encode('latin-1','ignore')
            teste=urllib.unquote(teste)
            if re.search('<span class="field-validation-error">A password introduzida est',teste):
                  mensagemok('Abelhas.pt',traducao(40002))
                  sys.exit(0)
            else: pastas_ref(url)
      else:
            items1=re.compile('<li class="fileItemContainer">\s+<p class="filename">\s+<a class="downloadAction" href=".+?">    <span class="bold">.+?</span>(.+?)</a>\s+</p>\s+<div class="thumbnail">\s+<div class="thumbnailWrapper expType" rel="Image" style=".+?">\s+<a href="(.+?)" class="thumbImg" rel="highslide" style=".+?" title="(.+?)">\s+<img src=".+?" rel=".+?" alt=".+?" style=".+?"/>\s+</a>\s+</div>\s+</div>\s+<div class="smallTab">\s+<ul>\s+<li>\s+(.+?)</li>\s+<li><span class="date">(.+?)</span></li>').findall(conteudo)
            for extensao,urlficheiro,tituloficheiro,tamanhoficheiro,dataficheiro in items1: analyzer(MainURL + urlficheiro,subtitles='',playterm='playlist',playlistTitle=tituloficheiro)
            items2=re.compile('<ul class="borderRadius tabGradientBg">.+?<li><span>(.+?)</span></li>.+?<li><span class="date">(.+?)</span></li></ul></div>.+?<ul>            <li><a href="/(.+?)" class="downloadAction".+?<li class="fileActionsFacebookSend" data-url=".+?" data-title="(.+?)">.+?<span class="bold">.+?</span>(.+?)</a>').findall(conteudo)
            for tamanhoficheiro,dataficheiro,urlficheiro, tituloficheiro,extensao in items2: analyzer(MainURL + urlficheiro,subtitles='',playterm='playlist',playlistTitle=tituloficheiro)				  
            if not items1:
                  if not items2:
                        conteudo=clean(conteudo)
                        items3=re.compile('<div class="thumbnail">.+?<a href="(.+?)".+?title="(.+?)">.+?<div class="smallTab">.+?<li>(.+?)</li>.+?<span class="date">(.+?)</span>').findall(conteudo)
                        for urlficheiro,tituloficheiro, tamanhoficheiro,dataficheiro in items3: analyzer(MainURL + urlficheiro,subtitles='',playterm='playlist',playlistTitle=tituloficheiro)
      mensagemprogresso.close()
      xbmcPlayer = xbmc.Player(xbmc.PLAYER_CORE_AUTO)
      xbmcPlayer.play(playlist)
开发者ID:Thewallguy,项目名称:fightnight-addons,代码行数:76,代码来源:default.py

示例5: pastas

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import save_data [as 别名]
def pastas(url,name,formcont={},conteudo=''):
      
      if re.search('action/SearchFiles',url):
            ref_data = {'Host': 'abelhas.pt', 'Connection': 'keep-alive', 'Referer': 'http://abelhas.pt/','Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8','User-Agent':user_agent,'Referer': 'http://abelhas.pt/'}
            endlogin=MainURL + 'action/SearchFiles'
            conteudo= net.http_POST(endlogin,form_data=formcont,headers=ref_data).content.encode('latin-1','ignore')
            if re.search('O ficheiro n&#227;o foi encontrado',conteudo):
                  mensagemok('Abelhas.pt','Sem resultados.')
                  sys.exit(0)
            try:
                  filename=re.compile('<input name="FileName" type="hidden" value="(.+?)" />').findall(conteudo)[0]
                  try:ftype=re.compile('<input name="FileType" type="hidden" value="(.+?)" />').findall(conteudo)[0]
                  except: ftype='All'
                  #pagina=re.compile('<input name="Page" type="hidden" value="(.+?)" />').findall(conteudo)[0]

                  pagina=1
                  token=re.compile('<input name="__RequestVerificationToken" type="hidden" value="(.+?)"').findall(conteudo)[0]

                  form_d = {'IsGallery':'True','FileName':filename,'FileType':ftype,'ShowAdultContent':'True','Page':pagina,'__RequestVerificationToken':token}
                  from t0mm0.common.addon import Addon
                  addon=Addon(addon_id)
                  addon.save_data('temp.txt',form_d)
                  ref_data = {'Accept':'*/*','Content-Type':'application/x-www-form-urlencoded','Host':'abelhas.pt','Origin':'http://abelhas.pt','Referer':url,'User-Agent':user_agent,'X-Requested-With':'XMLHttpRequest'}
                  endlogin=MainURL + 'action/SearchFiles/Results'
                  conteudo= net.http_POST(endlogin,form_data=form_d,headers=ref_data).content.encode('latin-1','ignore')
            except: pass
            
      else:
            if conteudo=='':
                  extra='?requestedFolderMode=filesList&fileListSortType=Name&fileListAscending=True'
                  conteudo=clean(abrir_url_cookie(url + extra))

      if re.search('ProtectedFolderChomikLogin',conteudo):
            chomikid=re.compile('<input id="ChomikId" name="ChomikId" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            folderid=re.compile('<input id="FolderId" name="FolderId" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            foldername=re.compile('<input id="FolderName" name="FolderName" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            token=re.compile('<input name="__RequestVerificationToken" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            passwordfolder=caixadetexto('password')
            
            
            
            form_d = {'ChomikId':chomikid,'FolderId':folderid,'FolderName':foldername,'Password':passwordfolder,'Remember':'true','__RequestVerificationToken':token}
            ref_data = {'Accept':'*/*','Content-Type':'application/x-www-form-urlencoded','Host':'abelhas.pt','Origin':'http://abelhas.pt','Referer':url,'User-Agent':user_agent,'X-Requested-With':'XMLHttpRequest'}
            endlogin=MainURL + 'action/Files/LoginToFolder'
            teste= net.http_POST(endlogin,form_data=form_d,headers=ref_data).content.encode('latin-1','ignore')
            teste=urllib.unquote(teste)
            if re.search('IsSuccess":false',teste):
                  mensagemok('Abelhas.pt',traducao(40002))
                  sys.exit(0)
            else:
                  pastas_ref(url)
      elif re.search('/action/UserAccess/LoginToProtectedWindow',conteudo):
            chomikid=re.compile('<input id="TargetChomikId" name="TargetChomikId" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            chomiktype=re.compile('<input id="ChomikType" name="ChomikType" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            sex=re.compile('<input id="Sex" name="Sex" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            accname=re.compile('<input id="AccountName" name="AccountName" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            isadult=re.compile('<input id="AdultFilter" name="AdultFilter" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            adultfilter=re.compile('<input id="AdultFilter" name="AdultFilter" type="hidden" value="(.+?)" />').findall(conteudo)[0]
            
            passwordfolder=caixadetexto('password')
            
            
      
            form_d = {'Password':passwordfolder,'OK':'OK','RemeberMe':'true','IsAdult':isadult,'Sex':sex,'AccountName':accname,'AdultFilter':adultfilter,'ChomikType':chomiktype,'TargetChomikId':chomikid}
            ref_data = {'Accept':'*/*','Content-Type':'application/x-www-form-urlencoded','Host':'abelhas.pt','Origin':'http://abelhas.pt','Referer':url,'User-Agent':user_agent,'X-Requested-With':'XMLHttpRequest'}
            endlogin=MainURL + 'action/UserAccess/LoginToProtectedWindow'
            teste= net.http_POST(endlogin,form_data=form_d,headers=ref_data).content.encode('latin-1','ignore')
            teste=urllib.unquote(teste)
            if re.search('<span class="field-validation-error">A password introduzida est',teste):
                  mensagemok('Abelhas.pt',traducao(40002))
                  sys.exit(0)
            else:
                  pastas_ref(url)
      else:
            try:
                  conta=re.compile('<div class="bigFileInfoRight">.+?<h3>(.+?)<span>(.+?)</span></h3>').findall(conteudo)[0]
                  nomeconta=re.compile('<input id="FriendsTargetChomikName" name="FriendsTargetChomikName" type="hidden" value="(.+?)" />').findall(conteudo)[0]
                  addLink('[COLOR blue][B]' + traducao(40023) + nomeconta + '[/B][/COLOR]: ' + conta[0] + conta[1],'',wtpath + art + 'star2.png')
            except: pass

            try:
                  pastas=re.compile('<div id="foldersList">(.+?)</table>').findall(conteudo)[0]
                  seleccionados=re.compile('<a href="/(.+?)".+?title="(.+?)">(.+?)</a>').findall(pastas)
                  for urlpasta,nomepasta,password in seleccionados:
                        if re.search('<span class="pass">',password): displock=' (' + traducao(40024)+')'
                        else:displock=''
                        addDir(nomepasta + displock,MainURL + urlpasta,3,wtpath + art + 'pasta.png',len(seleccionados),True)
            except: pass
            #contributo mafarricos com alteracoes, ty
            items1=re.compile('<li class="fileItemContainer">\s+<p class="filename">\s+<a class="downloadAction" href=".+?">    <span class="bold">.+?</span>(.+?)</a>\s+</p>\s+<div class="thumbnail">\s+<div class="thumbnailWrapper expType" rel="Image" style=".+?">\s+<a href="(.+?)" class="thumbImg" rel="highslide" style=".+?" title="(.+?)">\s+<img src=".+?" rel=".+?" alt=".+?" style=".+?"/>\s+</a>\s+</div>\s+</div>\s+<div class="smallTab">\s+<ul>\s+<li>\s+(.+?)</li>\s+<li><span class="date">(.+?)</span></li>').findall(conteudo)         
            for extensao,urlficheiro,tituloficheiro,tamanhoficheiro,dataficheiro in items1:
                  extensao=extensao.replace(' ','')
                  tamanhoficheiro=tamanhoficheiro.replace(' ','')
                  if extensao=='.rar' or extensao=='.RAR' or extensao == '.zip' or extensao=='.ZIP' or extensao=='.RAR' or extensao=='.7z' or extensao=='.7Z': thumb=wtpath + art + 'rar.png'
                  elif extensao=='.mp3' or extensao=='.MP3' or extensao == '.wma' or extensao=='.WMA' or extensao=='.m3u' or extensao=='.M3U' or extensao=='.flac' or extensao=='.FLAC': thumb=wtpath + art + 'musica.png'
                  elif extensao=='.jpg' or extensao == '.JPG' or extensao == '.bmp' or extensao == '.BMP' or extensao=='.gif' or extensao=='.GIF' or extensao=='.png' or extensao=='.PNG': thumb=wtpath + art + 'foto.png'
                  elif extensao=='.mkv' or extensao == '.MKV' or extensao == '.avi' or extensao == '.AVI' or extensao=='.mp4' or extensao=='.MP4' or extensao=='.3gp' or extensao=='.3GP' or extensao=='.wmv' or extensao=='.WMV': thumb=wtpath + art + 'video.png'
                  else:thumb=wtpath + art + 'file.png'
                  tamanhoparavariavel=' (' + tamanhoficheiro + ')'
                  addCont('[B]' + tituloficheiro + '[/B]' + tamanhoparavariavel,MainURL + urlficheiro,4,tamanhoparavariavel,thumb,len(items1),False)
#.........这里部分代码省略.........
开发者ID:Thewallguy,项目名称:fightnight-addons,代码行数:103,代码来源:default.py

示例6: addDir

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import save_data [as 别名]
        iconimage=i
        name = i
        url = BASE_URL+'browse/tv-shows/All_Genres/%s/'%i
        addDir(150,url,'None','ATOZ','',name,'')
    
elif mode == 130:
    last_search = addon.load_data('tvsearch')
    if not last_search: last_search = ''
    search_entered =''
    keyboard = xbmc.Keyboard(search_entered, '[B][I] SEARCH TubePlus TVShows[/B][/I]')
    last_search = last_search.replace('+',' ')
    keyboard.setDefault(last_search)
    keyboard.doModal()
    if keyboard.isConfirmed():
        search_entered = keyboard.getText().replace(' ','+')# sometimes you need to replace spaces with + or %20#
        addon.save_data('tvsearch',search_entered)
    if search_entered == None or len(search_entered)<1:
        TVMENU()
    else:
        url = 'http://www.tubeplus.me/search/tv-shows/%s/'%(search_entered)
        types = 'None'
        linkback = 'latesttv'
        INDEX2(url,types,linkback)
    
elif mode == 150:
    INDEX2(url,types,linkback)
        
elif mode == 200:
    types = 'movie'
    GET_INDEX(url,types,meta_name)
    
开发者ID:Ultraporing,项目名称:jas0npc,代码行数:32,代码来源:default.py


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