Browse Source

正式发布

master
appolli 5 months ago
parent
commit
6d66f68c73
  1. 2
      download_video.py
  2. 15
      search_video.py

2
download_video.py

@ -45,7 +45,7 @@ if __name__ == "__main__":
downloadInfo: DownloadInfo = DownloadInfoService.getOneNoFinish() downloadInfo: DownloadInfo = DownloadInfoService.getOneNoFinish()
if downloadInfo != None: if downloadInfo != None:
Logger.info("开始下载videoId:{}".format(downloadInfo.videoId)) Logger.info("开始下载videoId:{}".format(downloadInfo.videoId))
# TODO 下载字幕文件或音频文件 # 下载字幕文件或音频文件
DownloadUtil.downloadOne(downloadInfo.videoId, downloadRootPath) DownloadUtil.downloadOne(downloadInfo.videoId, downloadRootPath)
# 重新获取下一个下载任务 # 重新获取下一个下载任务
downloadInfo: DownloadInfo = DownloadInfoService.getOneNoFinish() downloadInfo: DownloadInfo = DownloadInfoService.getOneNoFinish()

15
search_video.py

@ -42,9 +42,12 @@ if __name__ == "__main__":
Logger.info("连接mysql成功") Logger.info("连接mysql成功")
# 查询出所有Channel # 查询出所有Channel
# channels = ChannelService.queryAllChannel() channels = ChannelService.queryAllChannel()
# Logger.info("Channels length:{}".format(len(channels))) Logger.info("Channels length:{}".format(len(channels)))
# for channel in channels: for channel in channels:
# channel : Channel = channel channel: Channel = channel
# # 通过channelId查询videos # 通过channelId查询videos
# YouTubeUtil.getByChannelId(channel.channelId) Logger.info(
f"Id:{channel.id} channelId:{channel.channelId} startTime:{startTime} endTime:{endTime}")
YouTubeUtil.getByChannelId(
channelId=channel.channelId, startTime=startTime, endTime=endTime)

Loading…
Cancel
Save