crawler_81tv/scrapy_proj/items.py
2025-06-08 16:25:53 +08:00

31 lines
1.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from scrapy import Item, Field
from datetime import datetime
class VideoItem(Item):
"""视频信息数据模型"""
# 基本信息
title = Field() # 标题
description = Field() # 描述
source_url = Field() # 来源URL
publish_time = Field() # 发布时间
create_time = Field(serializer=lambda x: datetime.now().strftime('%Y-%m-%d %H:%M:%S')) # 创建时间
update_time = Field(serializer=lambda x: datetime.now().strftime('%Y-%m-%d %H:%M:%S')) # 更新时间
# 媒体信息
video_url = Field() # 视频URL
source_thumbnail_url = Field() # 原始缩略图URL
thumbnail_url = Field() # 缩略图URL
duration = Field() # 视频时长
# 附加信息,辅助数据导入迁移
video_list = Field() # 视频分类ID
# 阿里云点播信息
aliyun_video_id = Field() # 阿里云视频ID
aliyun_status = Field() # 阿里云处理状态
# 其他信息
status = Field() # 状态0待处理1处理中2处理完成-1处理失败
sqlite_id = Field() # sqlite处理ID