zhangyong 7 months ago
parent
commit
a195e06748
1 changed files with 300 additions and 297 deletions
  1. 300 297
      video_rewriting/video_processor.py

+ 300 - 297
video_rewriting/video_processor.py

@@ -87,124 +87,171 @@ class VideoProcessor:
         """
         处理单个任务
         """
-
-        task_mark = task["task_mark"]
-        channel_id = str(task["channel_id"])
-        url = str(task["channel_url"])
-        piaoquan_id = str(task["piaoquan_id"])
-        number = task["number"]
-        title = task["title"]
-        video_share = task["video_share"]
-        video_ending = task["video_ending"]
-        crop_total = task["crop_total"]
-        gg_duration_total = task["gg_duration_total"]
-        voice = task['voice']
-        if voice:
-            if ',' in voice:
-                voices = voice.split(',')
+        try:
+            task_mark = task["task_mark"]
+            channel_id = str(task["channel_id"])
+            url = str(task["channel_url"])
+            piaoquan_id = str(task["piaoquan_id"])
+            number = task["number"]
+            title = task["title"]
+            video_share = task["video_share"]
+            video_ending = task["video_ending"]
+            crop_total = task["crop_total"]
+            gg_duration_total = task["gg_duration_total"]
+            voice = task['voice']
+            if voice:
+                if ',' in voice:
+                    voices = voice.split(',')
+                else:
+                    voices = [voice]
+                voice = random.choice(voices)
             else:
-                voices = [voice]
-            voice = random.choice(voices)
-        else:
-            voice = "zhifeng_emo"
-        zm = Material.get_pzsrt_data("summary", "500Oe0", video_share)
-        Common.logger(mark).info(f"{name}的{task_mark}下{channel_id}的用户:{url}开始获取视频")
-        new_count = None
-        if name in ['快手品类账号', '抖音品类账号', '抖音品类账号-1', '视频号品类账号']:
-            new_count = OdpsDataCount.main(channel_id, name, url)
-        data_list = cls.get_data_list(
-            channel_id, task_mark, url,
-            new_count if new_count is not None else number,
-            mark, feishu_id, cookie_sheet, name, task
-        )
-        if not data_list:
-            AliyunLogger.logging(channel_id, name, url, "", "无改造视频", "4000")
-            Common.logger(mark).info(f"{name}的{task_mark}下{channel_id}的视频ID{url} 无改造视频")
-            text = (
-                f"**通知类型**: 没有改造的视频\n"
-                f"**负责人**: {name}\n"
-                f"**渠道**: {channel_id}\n"
-                f"**视频主页ID**: {url}\n"
+                voice = "zhifeng_emo"
+            zm = Material.get_pzsrt_data("summary", "500Oe0", video_share)
+            Common.logger(mark).info(f"{name}的{task_mark}下{channel_id}的用户:{url}开始获取视频")
+            new_count = None
+            if name in ['快手品类账号', '抖音品类账号', '抖音品类账号-1', '视频号品类账号']:
+                new_count = OdpsDataCount.main(channel_id, name, url)
+            data_list = cls.get_data_list(
+                channel_id, task_mark, url,
+                new_count if new_count is not None else number,
+                mark, feishu_id, cookie_sheet, name, task
             )
-            Feishu.finish_bot(text, "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
-                              "【 机器改造通知 】")
-            return
-        if new_count:
-            sqlCollect.insert_spider_supply_targetcnt(channel_id, name, url, number, new_count, str(len(data_list)))
-            current_time = datetime.now()
-            formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
-            values = [
-                [
-                    name,
-                    channel_id,
-                    url,
-                    str(number),
-                    str(new_count),
-                    str(len(data_list)),
-                    formatted_time
+            if not data_list:
+                AliyunLogger.logging(channel_id, name, url, "", "无改造视频", "4000")
+                Common.logger(mark).info(f"{name}的{task_mark}下{channel_id}的视频ID{url} 无改造视频")
+                text = (
+                    f"**通知类型**: 没有改造的视频\n"
+                    f"**负责人**: {name}\n"
+                    f"**渠道**: {channel_id}\n"
+                    f"**视频主页ID**: {url}\n"
+                )
+                Feishu.finish_bot(text, "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
+                                  "【 机器改造通知 】")
+                return
+            if new_count:
+                sqlCollect.insert_spider_supply_targetcnt(channel_id, name, url, number, new_count, str(len(data_list)))
+                current_time = datetime.now()
+                formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
+                values = [
+                    [
+                        name,
+                        channel_id,
+                        url,
+                        str(number),
+                        str(new_count),
+                        str(len(data_list)),
+                        formatted_time
+                    ]
                 ]
-            ]
-            Feishu.insert_columns("Z5xLsdyyxh3abntTTvUc9zw8nYd", "099da8", "ROWS", 1, 2)
-            time.sleep(0.5)
-            Feishu.update_values("Z5xLsdyyxh3abntTTvUc9zw8nYd", "099da8", "A2:Z2", values)
+                Feishu.insert_columns("Z5xLsdyyxh3abntTTvUc9zw8nYd", "099da8", "ROWS", 1, 2)
+                time.sleep(0.5)
+                Feishu.update_values("Z5xLsdyyxh3abntTTvUc9zw8nYd", "099da8", "A2:Z2", values)
 
 
-        Common.logger(mark).info(f"{name}的{task_mark}下的ID{url} 获取视频完成,共{len(data_list)}条")
-        for video in data_list:
+            Common.logger(mark).info(f"{name}的{task_mark}下的ID{url} 获取视频完成,共{len(data_list)}条")
             try:
-                cls.remove_files(mark)
-                video_path_url = cls.create_folders(mark)
-                new_title = cls.generate_title(video, title)
-                v_id = video["video_id"]
-                cover = video["cover"]
-                video_url = video["video_url"]
-                old_title = video['old_title']
-                rule = video['rule']
-                # if channel_id == "单点视频":
-                #     redis_video = get_redis_video_data(v_id)
-                #     if redis_video:
-                #         continue
-                if not old_title:
-                    old_title = '这个视频,分享给我的老友,祝愿您能幸福安康'
-                    text = (
-                        f"**通知类型**: 标题为空,使用兜底标题生成片尾\n"
-                        f"**负责人**: {name}\n"
-                        f"**渠道**: {channel_id}\n"
-                        f"**视频主页ID**: {url}\n"
-                        f"**视频Video_id**: {v_id}\n"
-                    )
-                    Feishu.finish_bot(text,
-                                      "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
-                                      "【 机器改造通知 】")
-                    Common.logger(mark).info(f"{name}的{task_mark}下的视频{url},标题为空,使用兜底标题生成片尾")
-                time.sleep(1)
-                pw_random_id = cls.random_id()
-                Common.logger(mark).info(f"{name}的{task_mark}下的ID{url} 开始下载视频")
-                new_video_path = cls.download_and_process_video(channel_id, video_url, video_path_url, v_id,
-                                                                crop_total, gg_duration_total, pw_random_id, new_title, mark, video)
-                if not os.path.isfile(new_video_path) or new_video_path == None:
-                    AliyunLogger.logging(channel_id, name, url, v_id, "视频下载失败", "3002", f"video_url:{video_url}")
-                    text = (
-                        f"**通知类型**: 视频下载失败\n"
-                        f"**负责人**: {name}\n"
-                        f"**渠道**: {channel_id}\n"
-                        f"**视频主页ID**: {url}\n"
-                        f"**视频Video_id**: {v_id}\n"
-                    )
-                    Feishu.finish_bot(text,
-                                      "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
-                                      "【 机器改造通知 】")
-                    continue
-                if new_video_path:
-                    if video_ending and video_ending != 'None':
-                        new_video_path = cls.handle_video_ending(new_video_path, video_ending, old_title, pw_random_id, video_path_url, mark, task_mark, url, name, video_share, zm, voice)
-                        if new_video_path == None:
-                            if name == "单点视频":
-                                sqlCollect.update_shp_dd_vid_4(v_id)
+                for video in data_list:
+
+                    cls.remove_files(mark)
+                    video_path_url = cls.create_folders(mark)
+                    new_title = cls.generate_title(video, title)
+                    v_id = video["video_id"]
+                    cover = video["cover"]
+                    video_url = video["video_url"]
+                    old_title = video['old_title']
+                    rule = video['rule']
+                    # if channel_id == "单点视频":
+                    #     redis_video = get_redis_video_data(v_id)
+                    #     if redis_video:
+                    #         continue
+                    if not old_title:
+                        old_title = '这个视频,分享给我的老友,祝愿您能幸福安康'
+                        text = (
+                            f"**通知类型**: 标题为空,使用兜底标题生成片尾\n"
+                            f"**负责人**: {name}\n"
+                            f"**渠道**: {channel_id}\n"
+                            f"**视频主页ID**: {url}\n"
+                            f"**视频Video_id**: {v_id}\n"
+                        )
+                        Feishu.finish_bot(text,
+                                          "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
+                                          "【 机器改造通知 】")
+                        Common.logger(mark).info(f"{name}的{task_mark}下的视频{url},标题为空,使用兜底标题生成片尾")
+                    time.sleep(1)
+                    pw_random_id = cls.random_id()
+                    Common.logger(mark).info(f"{name}的{task_mark}下的ID{url} 开始下载视频")
+                    new_video_path = cls.download_and_process_video(channel_id, video_url, video_path_url, v_id,
+                                                                    crop_total, gg_duration_total, pw_random_id, new_title, mark, video)
+                    if not os.path.isfile(new_video_path) or new_video_path == None:
+                        AliyunLogger.logging(channel_id, name, url, v_id, "视频下载失败", "3002", f"video_url:{video_url}")
+                        text = (
+                            f"**通知类型**: 视频下载失败\n"
+                            f"**负责人**: {name}\n"
+                            f"**渠道**: {channel_id}\n"
+                            f"**视频主页ID**: {url}\n"
+                            f"**视频Video_id**: {v_id}\n"
+                        )
+                        Feishu.finish_bot(text,
+                                          "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
+                                          "【 机器改造通知 】")
+                        continue
+                    if new_video_path:
+                        if video_ending and video_ending != 'None':
+                            new_video_path = cls.handle_video_ending(new_video_path, video_ending, old_title, pw_random_id, video_path_url, mark, task_mark, url, name, video_share, zm, voice)
+                            if new_video_path == None:
+                                if name == "单点视频":
+                                    sqlCollect.update_shp_dd_vid_4(v_id)
+                                    from_user_name = video['from_user_name']  # 来源用户
+                                    from_group_name = video['from_group_name']  # 来源群组
+                                    source = video['source']  # 渠道
+                                    text = (
+                                        f"**渠道**: {source}\n"
+                                        f"**来源用户**: {from_user_name}\n"
+                                        f"**来源群组**: {from_group_name}\n"
+                                        f"**原视频链接**: {video['video_url']}\n"
+                                        f"**原视频封面**: {video['cover']}\n"
+                                        f"**原视频标题**: {video['old_title']}\n"
+                                    )
+                                    AliyunLogger.logging(channel_id, name, url, v_id, "视频下载失败", "3002")
+                                    Feishu.finish_bot(text,
+                                                      "https://open.feishu.cn/open-apis/bot/v2/hook/493b3d4c-5fae-4a9d-980b-1dd86636524e",
+                                                      "【 视频下载失败,跳过该视频 】")
+                                continue
+                        else:
+                            if video_share and video_share != 'None':
+                                new_video_path = FFmpeg.single_video(new_video_path, video_path_url, zm)
+                                # new_video_path = FFmpeg.single_video(new_video_path, video_path_url, zm)
+
+                        if not os.path.isfile(new_video_path):
+                            # log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title}"
+                            AliyunLogger.logging(channel_id, name, url, v_id, "视频改造失败", "3001")
+                            text = (
+                                f"**通知类型**: 视频改造失败\n"
+                                f"**负责人**: {name}\n"
+                                f"**渠道**: {channel_id}\n"
+                                f"**视频主页ID**: {url}\n"
+                                f"**视频Video_id**: {v_id}\n"
+                            )
+                            Feishu.finish_bot(text,
+                                              "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
+                                              "【 机器改造通知 】")
+                            continue
+                        # 上传视频和封面,并更新数据库
+                        code = cls.upload_video_and_thumbnail(new_video_path, cover, v_id, new_title, task_mark, name, piaoquan_id,
+                                                       video_path_url, mark, channel_id, url, old_title, title, rule, video)
+                        # 更新已使用的视频号状态
+                        pq_url = f'https://admin.piaoquantv.com/cms/post-detail/{code}/detail'  # 站内视频链接
+                        if name == "单点视频":
+                            sphdd_status = sqlCollect.update_shp_dd_vid(v_id)
+                            if sphdd_status == 1:
+                                Common.logger(mark).info(f"{name}的{task_mark}下的ID{url} 视频修改已使用,状态已修改")
                                 from_user_name = video['from_user_name']  # 来源用户
                                 from_group_name = video['from_group_name']  # 来源群组
                                 source = video['source']  # 渠道
+                                channel_id = source
                                 text = (
+                                    f"**站内视频链接**: {pq_url}\n"
                                     f"**渠道**: {source}\n"
                                     f"**来源用户**: {from_user_name}\n"
                                     f"**来源群组**: {from_group_name}\n"
@@ -212,206 +259,163 @@ class VideoProcessor:
                                     f"**原视频封面**: {video['cover']}\n"
                                     f"**原视频标题**: {video['old_title']}\n"
                                 )
-                                # AliyunLogger.logging(channel_id, name, url, v_id, "视频下载失败", "3002", log_data)
-                                Feishu.finish_bot(text,
-                                                  "https://open.feishu.cn/open-apis/bot/v2/hook/493b3d4c-5fae-4a9d-980b-1dd86636524e",
-                                                  "【 视频下载失败,跳过该视频 】")
-                            continue
-                    else:
-                        if video_share and video_share != 'None':
-                            new_video_path = FFmpeg.single_video(new_video_path, video_path_url, zm)
-                            # new_video_path = FFmpeg.single_video(new_video_path, video_path_url, zm)
-
-                    if not os.path.isfile(new_video_path):
-                        # log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title}"
-                        AliyunLogger.logging(channel_id, name, url, v_id, "视频改造失败", "3001")
+                                Feishu.finish_bot(text, "https://open.feishu.cn/open-apis/bot/v2/hook/493b3d4c-5fae-4a9d-980b-1dd86636524e", "【 有一条新的内容改造成功 】")
+
+                        if channel_id == "快手历史" or channel_id == "抖音历史" or channel_id == "视频号历史":
+                            explain = "历史爆款"
+                        else:
+                            explain = "新供给"
+                        current_time = datetime.now()
+                        formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
+                        if name == "品类关键词搜索":
+                            first_category = task["first_category"]
+                            keyword_principal = task["keyword_name"]
+                            tag_first = f"一级品类_{first_category}"
+                            tag_keyword = f"关键词_{url}"
+                            if channel_id == "抖音搜索":
+                                tag_channel = "来源_抖音关键词"
+                            elif channel_id == "快手搜索":
+                                tag_channel = "来源_快手关键词"
+                            elif channel_id == "视频号搜索":
+                                tag_channel = "来源_视频号关键词"
+                            tag = f"{tag_first},{tag_keyword},{tag_channel}"
+                            tag_status = Tag.video_tag(code, tag)
+                            if tag_status == 0:
+                                Common.logger(mark).info(f"{name}的{task_mark}下的ID{url}下的票圈视频{code},写入标签成功")
+                            secondary_category = task["secondary_category"]
+                            log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title},,voice:{voice},,first_category:{first_category},,secondary_category:{secondary_category},,keyword_principal:{keyword_principal},,tag:{tag}"
+                            values = [
+                                [
+                                    name,
+                                    task_mark,
+                                    channel_id,
+                                    url,
+                                    str(v_id),
+                                    piaoquan_id,
+                                    old_title,
+                                    title if title in ["原标题", "AI标题"] else "",
+                                    new_title,
+                                    str(code),
+                                    formatted_time,
+                                    str(rule),
+                                    explain,
+                                    voice,
+                                    first_category,
+                                    secondary_category,
+                                    keyword_principal,
+                                    pq_url
+                                ]
+                            ]
+                        elif name == "抖音品类账号-1" or name == "抖音品类账号" or name == "视频号品类账号" or name == "快手品类账号":
+                            first_category = task["first_category"]
+                            tag_first = f"一级品类_{first_category}"
+                            if channel_id == "抖音" or channel_id == "抖音历史":
+                                tag_channel = "来源_抖音品类账号"
+                            elif channel_id == "快手" or channel_id == "快手历史":
+                                tag_channel = "来源_快手品类账号"
+                            elif channel_id == "视频号" or channel_id == "视频号历史":
+                                tag_channel = "来源_视频号品类账号"
+                            tag = f"{tag_first},{tag_channel}"
+                            tag_status = Tag.video_tag( code, tag )
+                            if tag_status == 0:
+                                Common.logger(mark).info(f"{name}的{task_mark}下的ID{url}下的票圈视频{code},写入标签成功")
+                            log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title},,voice:{voice},,tag:{tag}"
+                            # log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title},,voice:{voice},,first_category:{first_category},,tag:{tag}"
+                            values = [
+                                [
+                                    name,
+                                    task_mark,
+                                    channel_id,
+                                    url,
+                                    str( v_id ),
+                                    piaoquan_id,
+                                    old_title,
+                                    title if title in ["原标题", "AI标题"] else "",
+                                    new_title,
+                                    str( code ),
+                                    formatted_time,
+                                    str( rule ),
+                                    explain,
+                                    voice,
+                                    first_category,
+                                    pq_url
+                                ]
+                            ]
+
+                        else:
+                            log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title},,voice:{voice}"
+                            values = [
+                                [
+                                    name,
+                                    task_mark,
+                                    channel_id,
+                                    url,
+                                    str(v_id),
+                                    piaoquan_id,
+                                    old_title,
+                                    title if title in ["原标题", "AI标题"] else "",
+                                    new_title,
+                                    str(code),
+                                    formatted_time,
+                                    str(rule),
+                                    explain,
+                                    voice
+                                ]
+                            ]
+                        AliyunLogger.logging(channel_id, name, url, v_id, "视频改造成功", "1000", log_data, str(code))
                         text = (
-                            f"**通知类型**: 视频改造失败\n"
+                            f"**通知类型**: 视频改造成功\n"
+                            f"**站内视频链接**: {pq_url}\n"
                             f"**负责人**: {name}\n"
                             f"**渠道**: {channel_id}\n"
                             f"**视频主页ID**: {url}\n"
                             f"**视频Video_id**: {v_id}\n"
+                            f"**使用音频音色**: {voice}\n"
                         )
                         Feishu.finish_bot(text,
                                           "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
                                           "【 机器改造通知 】")
-                        continue
-                    # 上传视频和封面,并更新数据库
-                    code = cls.upload_video_and_thumbnail(new_video_path, cover, v_id, new_title, task_mark, name, piaoquan_id,
-                                                   video_path_url, mark, channel_id, url, old_title, title, rule, video)
-                    # 更新已使用的视频号状态
-                    pq_url = f'https://admin.piaoquantv.com/cms/post-detail/{code}/detail'  # 站内视频链接
-                    if name == "单点视频":
-                        sphdd_status = sqlCollect.update_shp_dd_vid(v_id)
-                        if sphdd_status == 1:
-                            Common.logger(mark).info(f"{name}的{task_mark}下的ID{url} 视频修改已使用,状态已修改")
-                            from_user_name = video['from_user_name']  # 来源用户
-                            from_group_name = video['from_group_name']  # 来源群组
-                            source = video['source']  # 渠道
-                            channel_id = source
-                            text = (
-                                f"**站内视频链接**: {pq_url}\n"
-                                f"**渠道**: {source}\n"
-                                f"**来源用户**: {from_user_name}\n"
-                                f"**来源群组**: {from_group_name}\n"
-                                f"**原视频链接**: {video['video_url']}\n"
-                                f"**原视频封面**: {video['cover']}\n"
-                                f"**原视频标题**: {video['old_title']}\n"
-                            )
-                            Feishu.finish_bot(text, "https://open.feishu.cn/open-apis/bot/v2/hook/493b3d4c-5fae-4a9d-980b-1dd86636524e", "【 有一条新的内容改造成功 】")
-
-                    if channel_id == "快手历史" or channel_id == "抖音历史" or channel_id == "视频号历史":
-                        explain = "历史爆款"
-                    else:
-                        explain = "新供给"
-                    current_time = datetime.now()
-                    formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
-                    if name == "品类关键词搜索":
-                        first_category = task["first_category"]
-                        keyword_principal = task["keyword_name"]
-                        tag_first = f"一级品类_{first_category}"
-                        tag_keyword = f"关键词_{url}"
-                        if channel_id == "抖音搜索":
-                            tag_channel = "来源_抖音关键词"
-                        elif channel_id == "快手搜索":
-                            tag_channel = "来源_快手关键词"
-                        elif channel_id == "视频号搜索":
-                            tag_channel = "来源_视频号关键词"
-                        tag = f"{tag_first},{tag_keyword},{tag_channel}"
-                        tag_status = Tag.video_tag(code, tag)
-                        if tag_status == 0:
-                            Common.logger(mark).info(f"{name}的{task_mark}下的ID{url}下的票圈视频{code},写入标签成功")
-                        secondary_category = task["secondary_category"]
-                        log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title},,voice:{voice},,first_category:{first_category},,secondary_category:{secondary_category},,keyword_principal:{keyword_principal},,tag:{tag}"
-                        values = [
-                            [
-                                name,
-                                task_mark,
-                                channel_id,
-                                url,
-                                str(v_id),
-                                piaoquan_id,
-                                old_title,
-                                title if title in ["原标题", "AI标题"] else "",
-                                new_title,
-                                str(code),
-                                formatted_time,
-                                str(rule),
-                                explain,
-                                voice,
-                                first_category,
-                                secondary_category,
-                                keyword_principal,
-                                pq_url
-                            ]
-                        ]
-                    elif name == "抖音品类账号-1" or name == "抖音品类账号" or name == "视频号品类账号" or name == "快手品类账号":
-                        first_category = task["first_category"]
-                        tag_first = f"一级品类_{first_category}"
-                        if channel_id == "抖音" or channel_id == "抖音历史":
-                            tag_channel = "来源_抖音品类账号"
-                        elif channel_id == "快手" or channel_id == "快手历史":
-                            tag_channel = "来源_快手品类账号"
-                        elif channel_id == "视频号" or channel_id == "视频号历史":
-                            tag_channel = "来源_视频号品类账号"
-                        tag = f"{tag_first},{tag_channel}"
-                        tag_status = Tag.video_tag( code, tag )
-                        if tag_status == 0:
-                            Common.logger(mark).info(f"{name}的{task_mark}下的ID{url}下的票圈视频{code},写入标签成功")
-                        log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title},,voice:{voice},,tag:{tag}"
-                        # log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title},,voice:{voice},,first_category:{first_category},,tag:{tag}"
-                        values = [
-                            [
-                                name,
-                                task_mark,
-                                channel_id,
-                                url,
-                                str( v_id ),
-                                piaoquan_id,
-                                old_title,
-                                title if title in ["原标题", "AI标题"] else "",
-                                new_title,
-                                str( code ),
-                                formatted_time,
-                                str( rule ),
-                                explain,
-                                voice,
-                                first_category,
-                                pq_url
-                            ]
-                        ]
-
-                    else:
-                        log_data = f"user:{url},,video_id:{v_id},,video_url:{video_url},,ai_title:{new_title},,voice:{voice}"
-                        values = [
-                            [
-                                name,
-                                task_mark,
-                                channel_id,
-                                url,
-                                str(v_id),
-                                piaoquan_id,
-                                old_title,
-                                title if title in ["原标题", "AI标题"] else "",
-                                new_title,
-                                str(code),
-                                formatted_time,
-                                str(rule),
-                                explain,
-                                voice
-                            ]
-                        ]
-                    AliyunLogger.logging(channel_id, name, url, v_id, "视频改造成功", "1000", log_data, str(code))
-                    text = (
-                        f"**通知类型**: 视频改造成功\n"
-                        f"**站内视频链接**: {pq_url}\n"
-                        f"**负责人**: {name}\n"
-                        f"**渠道**: {channel_id}\n"
-                        f"**视频主页ID**: {url}\n"
-                        f"**视频Video_id**: {v_id}\n"
-                        f"**使用音频音色**: {voice}\n"
-                    )
-                    Feishu.finish_bot(text,
-                                      "https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
-                                      "【 机器改造通知 】")
-                    if values:
-                        if name == "王雪珂":
-                            sheet = "vfhHwj"
-                        elif name == "鲁涛":
-                            sheet = "FhewlS"
-                        elif name == "范军":
-                            sheet = "B6dCfS"
-                        elif name == "余海涛":
-                            sheet = "mfBrNT"
-                        elif name == "罗情":
-                            sheet = "2J3PwN"
-                        elif name == "王玉婷":
-                            sheet = "bBHFwC"
-                        elif name == "刘诗雨":
-                            sheet = "fBdxIQ"
-                        elif name == "信欣":
-                            sheet = "lPe1eT"
-                        elif name == "快手创作者版品类推荐流":
-                            sheet = "k7l7nQ"
-                        elif name == "抖音品类账号":
-                            sheet = "ZixHmf"
-                        elif name == "抖音品类账号-1":
-                            sheet = "61kvW7"
-                        elif name == "视频号品类账号":
-                            sheet = "b0uLWw"
-                        elif name == "单点视频":
-                            sheet = "ptgCXW"
-                        elif name == "快手品类账号":
-                            sheet = "ibjoMx"
-                        elif name == "品类关键词搜索":
-                            sheet = "Tgpikc"
-                        Feishu.insert_columns("ILb4sa0LahddRktnRipcu2vQnLb", sheet, "ROWS", 1, 2)
-                        time.sleep(0.5)
-                        Feishu.update_values("ILb4sa0LahddRktnRipcu2vQnLb", sheet, "A2:Z2", values)
+                        if values:
+                            if name == "王雪珂":
+                                sheet = "vfhHwj"
+                            elif name == "鲁涛":
+                                sheet = "FhewlS"
+                            elif name == "范军":
+                                sheet = "B6dCfS"
+                            elif name == "余海涛":
+                                sheet = "mfBrNT"
+                            elif name == "罗情":
+                                sheet = "2J3PwN"
+                            elif name == "王玉婷":
+                                sheet = "bBHFwC"
+                            elif name == "刘诗雨":
+                                sheet = "fBdxIQ"
+                            elif name == "信欣":
+                                sheet = "lPe1eT"
+                            elif name == "快手创作者版品类推荐流":
+                                sheet = "k7l7nQ"
+                            elif name == "抖音品类账号":
+                                sheet = "ZixHmf"
+                            elif name == "抖音品类账号-1":
+                                sheet = "61kvW7"
+                            elif name == "视频号品类账号":
+                                sheet = "b0uLWw"
+                            elif name == "单点视频":
+                                sheet = "ptgCXW"
+                            elif name == "快手品类账号":
+                                sheet = "ibjoMx"
+                            elif name == "品类关键词搜索":
+                                sheet = "Tgpikc"
+                            Feishu.insert_columns("ILb4sa0LahddRktnRipcu2vQnLb", sheet, "ROWS", 1, 2)
+                            time.sleep(0.5)
+                            Feishu.update_values("ILb4sa0LahddRktnRipcu2vQnLb", sheet, "A2:Z2", values)
             except Exception as e:
                 AliyunLogger.logging(channel_id, name, url, video["video_id"], f"改造失败{e}", "3001", log_data)
                 Common.logger(mark).error(f"{name}的{task_mark}任务处理失败:{e}")
-                continue
+        except Exception as e:
+            AliyunLogger.logging(channel_id, name, url, video["video_id"], f"改造失败{e}", "3001", log_data)
+            Common.logger(mark).error(f"{name}的{task_mark}任务处理失败:{e}")
+
 
     @classmethod
     def get_data_list(cls, channel_id, task_mark, url, number, mark, feishu_id, cookie_sheet, name, task):
@@ -631,7 +635,6 @@ class VideoProcessor:
         except Exception as e:
             Common.logger(mark).error(f"{name}的{task_mark}上传视频和封面到OSS,并更新数据库失败:{e}\n")
             AliyunLogger.logging(channel_id, name, url, video["video_id"], "改造失败-上传视频和封面到OSS", "3001")
-
             return