diff --git a/Dockerfile b/Dockerfile index 2563a7c..a2aba48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -# 使用官方Python基础镜像 -FROM python:3.9-bookworm +# 使用国内Python基础镜像 +FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/python:3.9-bookworm # 设置工作目录 WORKDIR /app diff --git a/scrapy_proj/pipelines.py b/scrapy_proj/pipelines.py index 80822b1..dc05a1b 100644 --- a/scrapy_proj/pipelines.py +++ b/scrapy_proj/pipelines.py @@ -221,6 +221,8 @@ class AliyunVodPipeline: # 2. 通过URL上传视频,获取JobId title = item.get('title', '') + # 延迟3秒上传 + time.sleep(3) job_id = self.upload_media_by_url( video_url=video_url, title=title, @@ -378,7 +380,7 @@ class MariaDBPipeline: Returns: item: 处理后的item """ - # 这里不需要处理item,因为我们要从SQLite读取数据 + # 从SQLite读取数据 return item def migrate_data(self): @@ -425,7 +427,8 @@ class MariaDBPipeline: 'video_remote_id': video.aliyun_video_id or '', 'video_url': '', 'video_list': video.video_list or 0, - 'month': '1' + 'month': '1', + 'video_status': video.aliyun_status or '', } # 映射到wz_video_data表 @@ -447,12 +450,12 @@ class MariaDBPipeline: cid, title, css, thumb, keywords, remark, block, url, status, route, publisher, addtime, updatetime, area, category, theme, year, video_remote_id, video_url, - video_list, month + video_list, month, video_status ) VALUES ( :cid, :title, :css, :thumb, :keywords, :remark, :block, :url, :status, :route, :publisher, :addtime, :updatetime, :area, :category, :theme, :year, :video_remote_id, :video_url, - :video_list, :month + :video_list, :month, :video_status )"""), wz_video ) diff --git a/static/index.html b/static/index.html index d94f167..872effa 100644 --- a/static/index.html +++ b/static/index.html @@ -216,7 +216,7 @@