def _networkM3U8(self, url: str) -> None: url = url.replace("www.", "").removeprefix("https://") filmName = re.findall( r"[altadefinizione\..*|altadefinizionecommunity\.net]\/(.*/)", url) serieName = re.findall(r"seriehd\..*\/(.*/)", url) if filmName != []: out = self.output() self.root.destroy() film = Film(filmName[0], out) if film.init[0] == 'created': Downloader(film.outputFile) elif film.init[0] == "continuare": messagebox.showinfo("4K Downloader", "Download già iniziato, verrà ripreso") Downloader(film.outputFile) elif film.init[0] == "sostituire": s = messagebox.askyesno( "4K Downloader", "Nome già esistente ma i file sono diversi.\nSi -> Indicizza file\nNo -> Sostituisci file" ) if s: film.outputFile = film.outputFile.duplicate() else: film.outputFile.temp().remove() Data.delete(film.outputFile.name) Film.initialize(film.outputFile, film.m3u8Path) Downloader(film.outputFile)
def _localM3U8(self, _name) -> None: if _name != '' and self.m3u8Path != '': outputPath = self.output().add(f'{_name}.mp4') initialized = Film.initialize(outputPath, PathModel(self.m3u8Path)) if initialized == "created": self.root.destroy() Downloader(outputPath) else: print(initialized)