mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 16:07:01 +08:00
fix #3166
This commit is contained in:
@@ -213,7 +213,7 @@ class Alist(StorageBase):
|
|||||||
path=(Path(fileitem.path) / item["name"]).as_posix() + ("/" if item["is_dir"] else ""),
|
path=(Path(fileitem.path) / item["name"]).as_posix() + ("/" if item["is_dir"] else ""),
|
||||||
name=item["name"],
|
name=item["name"],
|
||||||
basename=Path(item["name"]).stem,
|
basename=Path(item["name"]).stem,
|
||||||
extension=Path(item["name"]).suffix if not item["is_dir"] else None,
|
extension=Path(item["name"]).suffix[1:] if not item["is_dir"] else None,
|
||||||
size=item["size"] if not item["is_dir"] else None,
|
size=item["size"] if not item["is_dir"] else None,
|
||||||
modify_time=self.__parse_timestamp(item["modified"]),
|
modify_time=self.__parse_timestamp(item["modified"]),
|
||||||
thumbnail=item["thumb"],
|
thumbnail=item["thumb"],
|
||||||
@@ -351,7 +351,7 @@ class Alist(StorageBase):
|
|||||||
path=path.as_posix() + ("/" if result["data"]["is_dir"] else ""),
|
path=path.as_posix() + ("/" if result["data"]["is_dir"] else ""),
|
||||||
name=result["data"]["name"],
|
name=result["data"]["name"],
|
||||||
basename=Path(result["data"]["name"]).stem,
|
basename=Path(result["data"]["name"]).stem,
|
||||||
extension=Path(result["data"]["name"]).suffix,
|
extension=Path(result["data"]["name"]).suffix[1:],
|
||||||
size=result["data"]["size"],
|
size=result["data"]["size"],
|
||||||
modify_time=self.__parse_timestamp(result["data"]["modified"]),
|
modify_time=self.__parse_timestamp(result["data"]["modified"]),
|
||||||
thumbnail=result["data"]["thumb"],
|
thumbnail=result["data"]["thumb"],
|
||||||
@@ -521,13 +521,15 @@ class Alist(StorageBase):
|
|||||||
).get_res(download_url)
|
).get_res(download_url)
|
||||||
|
|
||||||
if not path:
|
if not path:
|
||||||
path = settings.TEMP_PATH / fileitem.name
|
new_path = settings.TEMP_PATH / fileitem.name
|
||||||
|
else:
|
||||||
|
new_path = path / fileitem.name
|
||||||
|
|
||||||
with open(path, "wb") as f:
|
with open(new_path, "wb") as f:
|
||||||
f.write(resp.content)
|
f.write(resp.content)
|
||||||
|
|
||||||
if path.exists():
|
if new_path.exists():
|
||||||
return path
|
return new_path
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def upload(
|
def upload(
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ class U115Pan(StorageBase, metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if not self.client or not self.client.cookies or force:
|
if not self.client or not self.client.cookies or force:
|
||||||
self.client = P115Client(self.__credential)
|
self.client = P115Client(self.__credential,
|
||||||
|
check_for_relogin=True, app="alipaymini", console_qrcode=False)
|
||||||
self.fs = P115FileSystem(self.client)
|
self.fs = P115FileSystem(self.client)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
logger.error(f"115连接失败,请重新扫码登录:{str(err)}")
|
logger.error(f"115连接失败,请重新扫码登录:{str(err)}")
|
||||||
|
|||||||
Reference in New Issue
Block a user