Kaynağa Gözat

异常处理

zhangyong 11 ay önce
ebeveyn
işleme
cfb942857e
1 değiştirilmiş dosya ile 11 ekleme ve 12 silme
  1. 11 12
      video_rewriting/video_prep.py

+ 11 - 12
video_rewriting/video_prep.py

@@ -84,19 +84,18 @@ class getVideo:
             video_ending = task["video_ending"]
             crop_total = task["crop_total"]
             gg_duration_total = task["gg_duration_total"]
-
+            if ',' in new_id:
+                n_id = new_id.split(',')
+            else:
+                n_id = [new_id]
+            if old_id and old_id != 'None':
+                task_id = old_id.split(',')
+            else:
+                task_id = video_id.split(',')
+            values = [task_id[0], task_marks]
+            task_mark = "_".join(map(str, values))  # 最终任务标示
+            video_path_url = cls.create_folders(mark, str(task_mark))  # 创建目录
             try:
-                if ',' in new_id:
-                    n_id = new_id.split(',')
-                else:
-                    n_id = [new_id]
-                if old_id and old_id != 'None':
-                    task_id = old_id.split(',')
-                else:
-                    task_id = video_id.split(',')
-                values = [task_id[0], task_marks]
-                task_mark = "_".join(map(str, values))  # 最终任务标示
-                video_path_url = cls.create_folders(mark, str(task_mark))  # 创建目录
                 count = 0  # 初始化计数器
                 for id in task_id:
                     pw_list, zm_list = Material.get_pwsrt_data(feishu_id, pw_sheet)  # 获取srt