FeedScanner.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:Albireo 作者: lordfriend 项目源码 文件源码
def __add_download(self, video_file_list):
        logger.debug(video_file_list)
        download_url_dict = {}
        for video_file in video_file_list:
            if video_file.download_url not in download_url_dict:
                download_url_dict[video_file.download_url] = []
            download_url_dict[video_file.download_url].append(video_file)

        for download_url, same_torrent_video_file_list in download_url_dict.iteritems():
            first_video_file = same_torrent_video_file_list[0]
            bangumi_path = self.base_path + '/' + str(first_video_file.bangumi_id)
            try:
                torrent_id = yield download_manager.download(first_video_file.download_url, bangumi_path)
                logger.info(torrent_id)
                if torrent_id is None:
                    logger.warn('episode %s already in download queue', str(first_video_file.episode_id))
                else:
                    yield threads.deferToThread(self.__update_video_file, same_torrent_video_file_list, torrent_id)
            except Exception as error:
                logger.error(error, exc_info=True)
                logger.error('episode %s download failed', str(first_video_file.episode_id))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号