Giter Club home page Giter Club logo

Comments (3)

PeterDing avatar PeterDing commented on May 28, 2024

不太清楚你描述的需求。api 都不会去实现业务逻辑。


如果你想对转存后的文件进行处理,你需要知道存了那些文件 (BaiduPCSApi.shared_pathsBaiduPCSApi.list_shared_paths) 或者转存到特定的目录下再获取目录下的文件。这之后再进行你的逻辑业务。

from baidupcs-py.

IWANABETHATGUY avatar IWANABETHATGUY commented on May 28, 2024

因为这个api 是异步的,不知道这个会再什么时候转存完成,是否出错

from baidupcs-py.

PeterDing avatar PeterDing commented on May 28, 2024

BaiduPCSApi.transfer_shared_paths 是同步的,如果转存出错会抛出异常的。

可以看看这个:

try:
api.transfer_shared_paths(
rd, [shared_path.fs_id], uk, share_id, bdstoken, shared_url
)
print(f"save: {shared_path.path} to {rd}")
continue
except BaiduPCSError as err:
if err.error_code not in (12, -33):
raise err
if err.error_code == 12: # 12: "文件已经存在"
print(f"[yellow]WARNING[/]: {shared_path.path} has be in {rd}")
if err.error_code == -33: # -33: '一次支持操作999个,减点试试吧'
print(
f"[yellow]WARNING[/]: {shared_path.path} "
"has more items and need to transfer one by one"
)

from baidupcs-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.