From 6d66f68c73e7d30d529c2bd6f8d30ef841c77281 Mon Sep 17 00:00:00 2001 From: appolli Date: Sat, 24 Aug 2024 15:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- download_video.py | 2 +- search_video.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/download_video.py b/download_video.py index a1c9d25..f0b2ca2 100644 --- a/download_video.py +++ b/download_video.py @@ -45,7 +45,7 @@ if __name__ == "__main__": downloadInfo: DownloadInfo = DownloadInfoService.getOneNoFinish() if downloadInfo != None: Logger.info("开始下载videoId:{}".format(downloadInfo.videoId)) - # TODO 下载字幕文件或音频文件 + # 下载字幕文件或音频文件 DownloadUtil.downloadOne(downloadInfo.videoId, downloadRootPath) # 重新获取下一个下载任务 downloadInfo: DownloadInfo = DownloadInfoService.getOneNoFinish() diff --git a/search_video.py b/search_video.py index ba2554a..abdacba 100644 --- a/search_video.py +++ b/search_video.py @@ -42,9 +42,12 @@ if __name__ == "__main__": Logger.info("连接mysql成功") # 查询出所有Channel - # channels = ChannelService.queryAllChannel() - # Logger.info("Channels length:{}".format(len(channels))) - # for channel in channels: - # channel : Channel = channel - # # 通过channelId查询videos - # YouTubeUtil.getByChannelId(channel.channelId) + channels = ChannelService.queryAllChannel() + Logger.info("Channels length:{}".format(len(channels))) + for channel in channels: + channel: Channel = channel + # 通过channelId查询videos + Logger.info( + f"Id:{channel.id} channelId:{channel.channelId} startTime:{startTime} endTime:{endTime}") + YouTubeUtil.getByChannelId( + channelId=channel.channelId, startTime=startTime, endTime=endTime)