youtube下载
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

65 lines
1.3 KiB

from peewee import *
import Contant
import argparse
from LoggerUtils import Logger
parser = argparse.ArgumentParser(description='')
parser.add_argument('--db', type=str, default='')
parser.add_argument('--logDir', type=str, default='')
args = parser.parse_args()
Contant.db = args.db
db = SqliteDatabase(Contant.db)
def ormInit():
Channel.create_table()
Vidoe.create_table()
DownloadInfo.create_table()
class BaseModel(Model):
class Meta:
database = db
# 频道信息
class Channel(BaseModel):
id = PrimaryKeyField()
channelId = CharField(null=False)
channelTitle = CharField(null=False)
channelLanguage = CharField()
channelReptileTime = CharField(null=True)
class Meta:
db_table = 'Channel'
# 视频信息
class Vidoe(BaseModel):
id = PrimaryKeyField()
videoId = CharField(null=False)
channelId = CharField(null=False)
videoTitle = CharField()
videoLen = IntegerField()
videoType = CharField()
videoPublishTime = CharField()
videoLanguage = CharField()
isDownload = IntegerField()
class Meta:
db_table = 'Vidoes'
# 下载信息
class DownloadInfo(BaseModel):
id = PrimaryKeyField()
videoId = CharField()
downloadType = IntegerField()
tryTime = IntegerField()
isFinished = IntegerField()
class Meta:
db_table = 'Download_info'