This commit is contained in:
jxxghp 2023-06-09 15:02:46 +08:00
parent a60e3b8a04
commit 017fce9e6f
4 changed files with 8 additions and 8 deletions

View File

@ -378,8 +378,8 @@ class Douban(_ModuleBase):
logger.info(f"正在下载{file_path.stem}图片:{url} ...") logger.info(f"正在下载{file_path.stem}图片:{url} ...")
r = RequestUtils().get_res(url=url) r = RequestUtils().get_res(url=url)
if r: if r:
# 下载到temp目录远程则先存到temp再远程移动本地则直接保存 file_path.write_bytes(r.content)
logger.info(f"图片已保存:{file_path.name}") logger.info(f"图片已保存:{file_path}")
else: else:
logger.info(f"{file_path.stem}图片下载失败,请检查网络连通性") logger.info(f"{file_path.stem}图片下载失败,请检查网络连通性")
except Exception as err: except Exception as err:
@ -394,4 +394,4 @@ class Douban(_ModuleBase):
return return
xml_str = doc.toprettyxml(indent=" ", encoding="utf-8") xml_str = doc.toprettyxml(indent=" ", encoding="utf-8")
file_path.write_bytes(xml_str) file_path.write_bytes(xml_str)
logger.info(f"NFO文件已保存{file_path.name}") logger.info(f"NFO文件已保存{file_path}")

View File

@ -167,7 +167,7 @@ class Qbittorrent(metaclass=Singleton):
trans_tasks.append({ trans_tasks.append({
'title': torrent.get('name'), 'title': torrent.get('name'),
'path': torrent_path, 'path': torrent_path,
'id': torrent.get('hash'), 'hash': torrent.get('hash'),
'tags': torrent.get('tags') 'tags': torrent.get('tags')
}) })
return trans_tasks return trans_tasks

View File

@ -474,8 +474,8 @@ class TheMovieDb(_ModuleBase):
logger.info(f"正在下载{file_path.stem}图片:{url} ...") logger.info(f"正在下载{file_path.stem}图片:{url} ...")
r = RequestUtils().get_res(url=url) r = RequestUtils().get_res(url=url)
if r: if r:
# 下载到temp目录远程则先存到temp再远程移动本地则直接保存 file_path.write_bytes(r.content)
logger.info(f"图片已保存:{file_path.name}") logger.info(f"图片已保存:{file_path}")
else: else:
logger.info(f"{file_path.stem}图片下载失败,请检查网络连通性") logger.info(f"{file_path.stem}图片下载失败,请检查网络连通性")
except Exception as err: except Exception as err:
@ -490,4 +490,4 @@ class TheMovieDb(_ModuleBase):
return return
xml_str = doc.toprettyxml(indent=" ", encoding="utf-8") xml_str = doc.toprettyxml(indent=" ", encoding="utf-8")
file_path.write_bytes(xml_str) file_path.write_bytes(xml_str)
logger.info(f"NFO文件已保存{file_path.name}") logger.info(f"NFO文件已保存{file_path}")

View File

@ -154,7 +154,7 @@ class Transmission(metaclass=Singleton):
trans_tasks.append({ trans_tasks.append({
'title': torrent.name, 'title': torrent.name,
'path': Path(path) / torrent.name, 'path': Path(path) / torrent.name,
'id': torrent.hashString, 'hash': torrent.hashString,
'tags': torrent.labels 'tags': torrent.labels
}) })
return trans_tasks return trans_tasks