def merge_videos(): global mer path_name_seg = [] for i in all_filename: path_name_seg.append( os.path.join(target_path, sel_res.getVideoTitle(), i)) mer = Merger( unicode( os.path.join( target_path, sel_res.getVideoTitle() + '.' + sel_res.getFileFormat())), path_name_seg) gui.frame_main.initTotal_Merge(len(all_filename)) mer.start() while True: gui.frame_main.updateMerge(mer.now) time.sleep(0.05) if mer.now == mer.sum: gui.frame_main.updateMerge(mer.now) break with open('config.ini', 'wb') as f: save_configure() dlg = wx.MessageDialog(gui.frame_main, u'视频已经合并完成,是否删除分段文件?', u'提示', wx.YES_NO | wx.ICON_QUESTION) if dlg.ShowModal() == wx.ID_YES: del_seg_video() dlg = wx.MessageDialog(gui.frame_main, u'分段文件删除完成。', u'提示', wx.OK | wx.ICON_QUESTION) dlg.ShowModal()
def merge_videos(): _, res = iqiyi.getLastRes() path_name_seg = [] for i in all_filename: path_name_seg.append(os.path.join(video_title, i)) mer = Merger( unicode( os.path.join(target_path, video_title + '.' + res[sel_bid]['ff'])), path_name_seg) gui.frame_main.initTotal_Merge(len(all_filename)) mer.start() while True: gui.frame_main.updateMerge(mer.now) time.sleep(0.01) if mer.now == mer.sum: gui.frame_main.updateMerge(mer.now) break del_seg_video()