(.+?).+?').findall(conteudo)
seleccionados=re.compile('(.+?)').findall(pastas[0])
for urlpasta,nomepasta,password in seleccionados:
if re.search('',password): displock=' (' + traducao(40024)+')'
else:displock=''
if nomepasta == 'Dokumenty' or nomepasta == 'Documentos': nomepasta=traducao(40057)
if nomepasta == 'Galeria': nomepasta=traducao(40058)
if nomepasta == 'Prywatne' or nomepasta == 'Privada': nomepasta=traducao(40059)
addDir('[B][COLOR white]' + nomepasta + '[/COLOR][/B]' + displock,sitebase + urlpasta,3,wtpath + art + 'pasta.png',len(seleccionados),True)
except: pass
reslist = []
reslist = ReturnConteudo(conteudo,past,color,url,deFora)
if reslist:
if deFora:
if foldertype == 1:
if selfAddon.getSetting('search-order') == 'true': reslist = sorted(reslist, key=getKey,reverse=True)
for part1,part2 in reslist:
if not part2[1]+part2[2]+part2[3] in uniqueList:
uniqueList.append(part2[1]+part2[2]+part2[3])
selectlist.append(part2[1]+part2[2]+part2[3])
urllist.append(sitebase + part2[4])
choose=source('Link a Abrir',selectlist)
if listagem==True: return urllist
else:
if choose > -1: analyzer(urllist[choose])
else:
reslist = sorted(reslist, key=getKey,reverse=True)
if listagem==True: return reslist
else:
if choose > -1:
analyzer(sitebase + reslist[1][1][4])
else:
if re.search('action/SearchFiles',url) and selfAddon.getSetting('search-order') == 'true': reslist = sorted(reslist, key=getKey,reverse=True)
for part1,part2 in reslist:
if foldertype == 1 and re.search('action/SearchFiles',url):
if not part2[0] in uniqueList:
uniqueList.append(part2[0])
selectlist.append(part2[0])
urllist.append(part2[1])
else:
if not (part2[1].replace(part2[2],'') + part2[2] + part2[3]) in uniqueList:
if '(video)' in part2[4] or '(audio)' in part2[4]: MainPlayList.append([ReplaceSpecialChar(part2[1]),sitebase + part2[4]])
uniqueList.append(part2[1].replace(part2[2],'') + part2[2] + part2[3])
addCont('[B][COLOR '+part2[0]+']' + part2[1].replace(part2[2],'') + part2[2] + '[/COLOR][/B]' + '[COLOR white]' + part2[3] + '[/COLOR]',sitebase + part2[4],part2[5],part2[3],part2[6],len(reslist))
if foldertype == 1 and re.search('action/SearchFiles',url):
choose=source('Link a Abrir',selectlist)
if choose > -1: analyzer(urllist[choose])
savefile('playlist.txt',str(MainPlayList))
if foldertype == 0 or (foldertype == 1 and not re.search('action/SearchFiles',url)) and not deFora: paginas(conteudo)
if foldertype == 0 or (foldertype == 1 and not re.search('action/SearchFiles',url)) and not deFora: xbmc.executebuiltin("Container.SetViewMode(51)")
#Mafarricos,sn - Novas alterações
def returnExtra():
fileListSortType = 'Name'
fileListAscending = 'True'
option1 = int(selfAddon.getSetting('filesorder'))
option2 = int(selfAddon.getSetting('fileasc'))
if option1 == 0: fileListSortType = 'Name'
elif option1 == 1: fileListSortType = 'Type'
elif option1 == 2: fileListSortType = 'Size'
elif option1 == 3: fileListSortType = 'Date'
if option2 == 0: fileListAscending = 'True'
elif option2 == 1: fileListAscending = 'False'
return '?IsGallery=False&requestedFolderMode=filesList&fileListSortType='+fileListSortType+'&fileListAscending='+fileListAscending
def GetThumbExt(extensao):
extensao=extensao.replace(' ','').lower()
if extensao=='.7z': return wtpath + art + 'rar/7z.png'
elif extensao=='.ace': return wtpath + art + 'rar/ace.png'
elif extensao=='.hqx': return wtpath + art + 'rar/hqx.png'
elif extensao=='.jar': return wtpath + art + 'rar/jar.png'
elif extensao=='.rar': return wtpath + art + 'rar/rar.png'
elif extensao=='.sit': return wtpath + art + 'rar/sit.png'
elif extensao=='.sitx': return wtpath + art + 'rar/sitx.png'
elif extensao=='.tar': return wtpath + art + 'rar/tar.png'
elif extensao=='.zip': return wtpath + art + 'rar/zip.png'
elif extensao=='.aac': return wtpath + art + 'music/aac.png'
elif extensao=='.aiff': return wtpath + art + 'music/aiff.png'
elif extensao=='.midi': return wtpath + art + 'music/midi.png'
elif extensao=='.m4a': return wtpath + art + 'music/mp4.png' #Convinha dizer m4a
elif extensao=='.mp3': return wtpath + art + 'music/mp3.png'
elif extensao=='.ogg': return wtpath + art + 'music/ogg.png'
elif extensao=='.ra': return wtpath + art + 'music/ra.png'
elif extensao=='.rmva': return wtpath + art + 'music/ra.png'
elif extensao=='.wav': return wtpath + art + 'music/wav.png'
elif extensao=='.wma': return wtpath + art + 'music/wma.png'
elif extensao=='.ac3': return wtpath + art + 'musica.png'
elif extensao=='.flac': return wtpath + art + 'musica.png'
elif extensao=='.m3u': return wtpath + art + 'musica.png'
elif extensao=='.bmp': return wtpath + art + 'foto/bmp.png'
elif extensao=='.gif': return wtpath + art + 'foto/gif.png'
elif extensao=='.ico': return wtpath + art + 'foto/ico.png'
elif extensao=='.jpeg': return wtpath + art + 'foto/jpeg.png'
elif extensao=='.jpg': return wtpath + art + 'foto/jpg.png'
elif extensao=='.png': return wtpath + art + 'foto/png.png'
elif extensao=='.tga': return wtpath + art + 'foto/tga.png'
elif extensao=='.tif': return wtpath + art + 'foto/tif.png'
elif extensao=='.tiff': return wtpath + art + 'foto/tiff.png'
#elif extensao=='.webp': return wtpath + art + 'foto/webp.png'
elif extensao=='.bin': return wtpath + art + 'img/bin.png'
elif extensao=='.ccd': return wtpath + art + 'img/ccd.png'
elif extensao=='.cue': return wtpath + art + 'img/cue.png'
elif extensao=='.img': return wtpath + art + 'img/img.png'
elif extensao=='.iso': return wtpath + art + 'img/iso.png'
elif extensao=='.mdf': return wtpath + art + 'img/mdf.png'
elif extensao=='.mds': return wtpath + art + 'img/mds.png'
elif extensao=='.avi': return wtpath + art + 'video/avi.png'
elif extensao=='.dat': return wtpath + art + 'video/dat.png'
elif extensao=='.ifo': return wtpath + art + 'video/ifo.png'
elif extensao=='.mov': return wtpath + art + 'video/mov.png'
elif extensao=='.mpg': return wtpath + art + 'video/mpeg.png'
elif extensao=='.mpeg': return wtpath + art + 'video/mpeg2.png'
elif extensao=='.mkv': return wtpath + art + 'video.png' #Estes todos estão a faltar
elif extensao=='.ogm': return wtpath + art + 'video.png'
elif extensao=='.mp4': return wtpath + art + 'video.png'
elif extensao=='.m4v': return wtpath + art + 'video.png'
elif extensao=='.3gp': return wtpath + art + 'video.png'
elif extensao=='.m2ts': return wtpath + art + 'video.png'
elif extensao=='.rm': return wtpath + art + 'video/rm.png'
elif extensao=='.rmvb': return wtpath + art + 'video/rm.png'
elif extensao=='.wmv': return wtpath + art + 'video/wmv.png'
elif extensao=='.doc': return wtpath + art + 'files/doc.png'
elif extensao=='.pdf': return wtpath + art + 'files/pdf.png'
elif extensao=='.ppt': return wtpath + art + 'files/ppt.png'
elif extensao=='.rtf': return wtpath + art + 'files/rtf.png'
elif extensao=='.txt': return wtpath + art + 'files/txt.png'
elif extensao=='.torrent': return wtpath + art + 'files/torrent.png'
else: return wtpath + art + 'file.png'
def ReturnConteudo(conteudo,past,color,url2,deFora):
diffItems = False
reslist = []
section = re.compile('\sfileItemContainer">.+?
\s+
', re.DOTALL).findall(conteudo)
if not section: section = re.compile('\sfileItemContainer">(.+?)\s+
', re.DOTALL).findall(conteudo)
if not section: section = re.compile('\sfileItemContainer">(.+?)
', re.DOTALL).findall(conteudo)
for part in section:
name = re.compile('data-title="(.+?)"', re.DOTALL).findall(part)
if not name: name = re.compile('(.+?)\..+?\s+\s+','').replace(' ','')))
tituloficheiro = h.unescape(name[0].replace('','').replace(' ',''))
if(
('.7z' in tituloficheiro[-3:]) or ('.ra' in tituloficheiro[-3:]) or ('.rm' in tituloficheiro[-3:])
): extensao = tituloficheiro[-3:]
if(
('.ace' in tituloficheiro[-4:]) or ('.hqx' in tituloficheiro[-4:]) or ('.jar' in tituloficheiro[-4:]) or ('.rar' in tituloficheiro[-4:]) or ('.sit' in tituloficheiro[-4:]) or ('.tar' in tituloficheiro[-4:]) or ('.zip' in tituloficheiro[-4:]) or
('.aac' in tituloficheiro[-4:]) or ('.m4a' in tituloficheiro[-4:]) or ('.mp3' in tituloficheiro[-4:]) or ('.ogg' in tituloficheiro[-4:]) or ('.wav' in tituloficheiro[-4:]) or ('.wma' in tituloficheiro[-4:]) or ('.ac3' in tituloficheiro[-4:]) or ('.m3u' in tituloficheiro[-4:]) or
('.bmp' in tituloficheiro[-4:]) or ('.gif' in tituloficheiro[-4:]) or ('.ico' in tituloficheiro[-4:]) or ('.jpg' in tituloficheiro[-4:]) or ('.png' in tituloficheiro[-4:]) or ('.tga' in tituloficheiro[-4:]) or ('.tif' in tituloficheiro[-4:]) or
('.bin' in tituloficheiro[-4:]) or ('.ccd' in tituloficheiro[-4:]) or ('.cue' in tituloficheiro[-4:]) or ('.img' in tituloficheiro[-4:]) or ('.iso' in tituloficheiro[-4:]) or ('.mdf' in tituloficheiro[-4:]) or ('.mds' in tituloficheiro[-4:]) or
('.dat' in tituloficheiro[-4:]) or ('.ifo' in tituloficheiro[-4:]) or ('.mpg' in tituloficheiro[-4:]) or ('.3gp' in tituloficheiro[-4:])or
('.doc' in tituloficheiro[-4:]) or ('.pdf' in tituloficheiro[-4:]) or ('.ppt' in tituloficheiro[-4:]) or ('.rtf' in tituloficheiro[-4:]) or ('.txt' in tituloficheiro[-4:])
): extensao = tituloficheiro[-4:]
if(
('.sitx' in tituloficheiro[-5:]) or ('.aiff' in tituloficheiro[-5:]) or ('.midi' in tituloficheiro[-5:]) or ('.rmva' in tituloficheiro[-5:]) or ('.flac' in tituloficheiro[-5:]) or ('.jpeg' in tituloficheiro[-5:]) or ('.tiff' in tituloficheiro[-5:]) or ('.webp' in tituloficheiro[-5:]) or ('.mpeg' in tituloficheiro[-5:]) or ('.m2ts' in tituloficheiro[-5:]) or ('.rmva' in tituloficheiro[-5:])
): extensao = tituloficheiro[-5:]
if(
('.torrent' in tituloficheiro[-8:])
): extensao = tituloficheiro[-8:]
if(
('.avi' in tituloficheiro[-4:]) or ('.mov' in tituloficheiro[-4:]) or ('.mkv' in tituloficheiro[-4:]) or ('.ogm' in tituloficheiro[-4:]) or ('.mp4' in tituloficheiro[-4:]) or ('.m4v' in tituloficheiro[-4:]) or ('.wmv' in tituloficheiro[-4:])
): extensao = tituloficheiro[-4:]
else:
ext = re.compile('.+?(\..+?)\s+\s+(.+?)
', re.DOTALL).findall(part)
if not size: size = re.compile('
\s+(.+?)\s+
', re.DOTALL).findall(part)
if not size: size = '0'
urlficheiro = url[0]
try: tamanhoficheiro = size[0]
except: tamanhoficheiro = '0'
tamanhoficheiro=tamanhoficheiro.replace(',','.').replace(' ','')
num_format = re.compile("^[0-9]+.?[0-9]+?K?M?G?B")
if(selfAddon.getSetting('imagens-disable') == 'true'):
if( (extensao == '.bmp') or (extensao == '.gif') or (extensao == '.ico') or (extensao == '.jpg') or (extensao == '.png') or (extensao == '.tga') or (extensao == '.tif') or (extensao == '.tiff') or (extensao == '.webp') ):
tamanhoficheiro='0'
if(selfAddon.getSetting('legendas-disable') == 'true'):
if( (extensao == '.srt') or (extensao == '.sub') or (extensao == '.ass') or (extensao == '.ssa') ):
tamanhoficheiro='0'
if( tamanhoficheiro != '0' and re.match(num_format,tamanhoficheiro) ):
tamanhoparavariavel=' (' + tamanhoficheiro + ')'
if deFora: reslist = SearchResults(tamanhoficheiro,color,tituloficheiro,extensao,tamanhoparavariavel,urlficheiro,4,thumb,reslist)
elif foldertype == 1 and re.search('action/SearchFiles',url2): reslist = SearchResultsFora(tamanhoficheiro,tituloficheiro+extensao+tamanhoparavariavel,MainURL + urlficheiro,color,reslist)
else: reslist = SearchResults(tamanhoficheiro,color,tituloficheiro,extensao,tamanhoparavariavel,urlficheiro,4,thumb,reslist)
elif re.match(num_format,tamanhoficheiro):
xbmc.executebuiltin("XBMC.Notification(Chomiteca,"+tamanhoficheiro+",'500000',"+iconpequeno.encode('utf-8')+")")
tamanhoficheiro = '0'
tamanhoparavariavel=' (' + tamanhoficheiro + ')'
if deFora: reslist = SearchResults(tamanhoficheiro,color,tituloficheiro,extensao,tamanhoparavariavel,urlficheiro,4,thumb,reslist)
elif foldertype == 1 and re.search('action/SearchFiles',url2): reslist = SearchResultsFora(tamanhoficheiro,tituloficheiro+extensao+tamanhoparavariavel,MainURL + urlficheiro,color,reslist)
else: reslist = SearchResults(tamanhoficheiro,color,tituloficheiro,extensao,tamanhoparavariavel,urlficheiro,4,thumb,reslist)
return reslist
def SearchResults(tamanhoficheiro,color,tituloficheiro,extensao,tamanhoparavariavel,urlficheiro,modo,thumb,reslist):
listresults = []
listresults.append(color)
listresults.append(tituloficheiro)
listresults.append(extensao)
listresults.append(tamanhoparavariavel)
listresults.append(urlficheiro)
listresults.append(modo)
listresults.append(thumb)
if 'GB' in tamanhoficheiro: tamanhoficheiro = str(float(tamanhoficheiro.replace('GB','').replace(',','.'))*1024).replace('.',',')+'MB'
if 'KB' in tamanhoficheiro: tamanhoficheiro = str(float(tamanhoficheiro.replace('KB','').replace(',','.'))/1024).replace('.',',')+'MB'
tamanhoficheiro = round(float(tamanhoficheiro.replace('GB','').replace('MB','').replace('KB','').replace(',','.')),2)
reslist.append([tamanhoficheiro,listresults])
return reslist
def SearchResultsFora(tamanhoficheiro,label,url,color,reslist):
listresults = []
listresults.append(label)
listresults.append(url)
if 'GB' in tamanhoficheiro: tamanhoficheiro = str(float(tamanhoficheiro.replace('GB','').replace(',','.'))*1024).replace('.',',')+'MB'
if 'KB' in tamanhoficheiro: tamanhoficheiro = str(float(tamanhoficheiro.replace('KB','').replace(',','.'))/1024).replace('.',',')+'MB'
tamanhoficheiro = round(float(tamanhoficheiro.replace('GB','').replace('MB','').replace('KB','').replace(',','.')),2)
reslist.append([tamanhoficheiro,listresults])
return reslist
def getKey(item):
return item[0]
def pastas_de_fora(url,name,formcont={},conteudo='',past=False):
login(True)
if selfAddon.getSetting('activate-size') == 'true': formcont = {'submitSearchFiles': 'Procurar', 'IsGallery':'False','FileName':name,'FileType':'video','ShowAdultContent':'True','SizeFrom':selfAddon.getSetting('min-size'),'SizeTo':selfAddon.getSetting('max-size')}
else: formcont = {'submitSearchFiles': 'Procurar', 'FileType': 'video', 'IsGallery': 'False', 'FileName': name }
pastas(url,name,formcont,conteudo,False,True)
def criarplaylist(url,name):
playlist = xbmc.PlayList(1)
playlist.clear()
conteudo = openfile('playlist.txt')
playlistsearch=re.compile("\['(.+?)', '(.+?)'\]").findall(conteudo)
for titulo,url in playlistsearch: analyzer(url,subtitles='',playterm='playlist',playlistTitle=titulo)
xbmcPlayer = xbmc.Player()
xbmcPlayer.play(playlist)
def trailer(name):
youtube_trailer_search = 'https://www.googleapis.com/youtube/v3/search?part=id,snippet&q=%s-Trailer&maxResults=1&key=AIzaSyCgpWUrGw2mySqmxxzlrsUoNhpGCBVJD7s'
cleanname=re.compile('COLOR .+?\](.+?)\[/COLOR').findall(name)
if cleanname: name = cleanname[0][:-4]
ytpage = abrir_url(youtube_trailer_search % (urllib.quote_plus(name)))
youtubeid = re.compile('"videoId": "(.+?)"').findall(ytpage)
url = 'plugin://plugin.video.youtube/play/?video_id=%s' % youtubeid[0]
if url == None: return
item = xbmcgui.ListItem(path=url)
item.setProperty("IsPlayable", "true")
xbmc.Player().play(url, item)
def ReturnStatus(site):
if selfAddon.getSetting(site+'-enable') == 'true': return True
return False
def appendValues():
username = []
password = []
site = []
label = []
color = []
if ReturnStatus('chomikuj'):
username.append(username_ck)
password.append(selfAddon.getSetting('chomikuj-password'))
site.append(MainURL)
label.append('Chomikuj')
color.append('green')
return username,password,site,label,color
def returnValues(link):
sitebase = ''
nextname = ''
color = ''
mode = ''
if re.search('chomikuj.pl',link):
sitebase=MainURL
nextname='Chomikuj'
color='green'
mode=24
return sitebase,nextname,color,mode
#Mafarricos,en - Fim de Novas alterações
def obterlistadeficheiros():
string=[]
nrdepaginas=71
for i in xrange(1,int(nrdepaginas)+1):
url='https://minhateca.com.br/qqcoisa,%s' % i
extra='?requestedFolderMode=filesList&fileListSortType=Name&fileListAscending=True'
conteudo=clean(abrir_url_cookie(url + extra))
items1=re.compile('
').findall(conteudo)
for urlficheiro,tituloficheiro,extensao,tamanhoficheiro,dataficheiro in items1: string.append(tituloficheiro)
items2=re.compile('\s+(.+?)(.+?).+?
(.+?)
.+?
(.+?)
').findall(conteudo)
for urlficheiro,tituloficheiro,extensao,tamanhoficheiro,dataficheiro in items2: string.append(tituloficheiro)
if not items1:
if not items2:
conteudo=clean(conteudo)
items3=re.compile('