#coding:utf8 def havethumbnail(self): if path.exists(self.dirfile): mi=run(f'-i "{self.filename}"',self.dir,bin='ffprobe') for ee in mi: if isinstance(ee,str) and 'attached pic' in ee: break else: self.cw.setTitle(f'{tr_("썸네일 고정")}...{self.filename}') self.pp(self.dirfile) def tojpg(self): self.thumbz.seek(0) bythz=self.thumbz.read() if len(bythz)>0: with open(self.dirfile+'.webp',"wb")as f: f.write(bythz) f.close imagen_webp=Image.open(self.thumbz) if imagen_webp.mode!="RGB": imagen_webp=imagen_webp.convert("RGB") imagen_webp.save(self.thumb,"JPEG",quality=90) self.thumbz.truncate(0) def ofuscado(self,url): soup=Soup(downloader.read_html(url,user_agent=USERAGEN)) self.urlthumb=soup.find('meta',{'property':'og:image'})['content'] title=soup.find('h1').text.strip() vid='/video/'not in url if vid: codigo=soup.find('meta',{'property':'og:url'})['content'] codigo=codigo[codigo.rfind('/')+1:].upper() un=title.find(' ') if un==-1: un=len(title) title=codigo+title[un:] self.filename=clean_title(title,n=190)+'.mp4' codigo=soup.findAll('script',{'type':'text/javascript'})[-2].text un=codigo.find('eval(') codigo=codigo[un:codigo.find('.split(',un)-1] un=codigo.find('://') k_array=codigo[codigo.find(',\'',un)+2:].split('|') narray=[] for car in codigo[un-1:codigo.find(';',un)-2]: num=ord(car) narray.append((k_array[num-48]if 58>num>47 else k_array[num-87] if 96<num<123 else car)or car) url=''.join(narray) if not vid: return url codigo=downloader.read_html(url,headers={'Origin':'https://missav.ws'},user_agent=USERAGEN) reso=get_resolution() for tex in codigo.split()[::-1]: if '#' not in tex: codigo=tex else: un=tex.find('x',tex.find('RESOL'))+1 dos=tex.find(',',un) if not int(tex[un: None if dos<0 else dos])>reso: break return url.replace('playlist.m3u8',codigo) def pp(self,filename): self.thumb.seek(0) bythum=self.thumb.read() if len(bythum)>0: pathum=f'{filename}.I' with open(pathum,'wb')as f: f.write(bythum) f.close convert(filename,filename,f'-i "{pathum}" -map 1 -map 0 -c copy -disposition:0 attached_pic',cw=self.cw) remove(pathum) return filename class Strimin(M3u8_stream): class Downloader_missav(Downloader): @try_n(2) def read(self): if not path.exists(self.dir): makedirs(self.dir) vi=Video(self.url,self.cw,self.dir) self.setIcon(vi.thumb) self.urls.append(vi.url) self.title=vi.filename (责任编辑:) |