video_blacklist/创建数据库/全部日志.py

28 lines
1.0 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import sqlite3
'''
进入日志 进入直播间
互动日志 :弹幕 礼物 点赞 分享 关注
拉黑日志 :拉黑
'''
# 连接到数据库(如果不存在则创建)
conn = sqlite3.connect('all_log.db')
c = conn.cursor()
# 创建表
c.execute('''CREATE TABLE all_log (
id INTEGER PRIMARY KEY AUTOINCREMENT, -- 自增主键
account_url_part TEXT NOT NULL, -- 该日志的主播账号的 url_part (sec_uid)
user_sid TEXT NOT NULL, -- 该条日志用户的抖音主页ID (user_sid)
user_douyin_id TEXT, -- 该条日志黑用户的抖音号 (display_id)
user_nickname TEXT, -- 该条日志用户的昵称
user_avatar TEXT, -- 该条日志用户的头像URL
code INTEGER, -- 该条日志的状态码 0 进入日志 1 互动日志 2 拉黑日志
message TEXT, -- 该条日志的状态信息
log_time TEXT -- 该条日志的时间 (YYYY-MM-DD HH:MM:SS 格式文本)
);
''')
conn.commit()
conn.close()