Giter Club home page Giter Club logo

baiduyun_share's Introduction

BaiduYun_Share

百度云分享功能api(Python3)

关于百度云的api,已经有很多做的很好的项目,例如使用PCS apibypyBaiduPCS,使用百度网盘api的baidupcsapi,都可以轻松地实现文件操作、下载上传等功能。

因为PCS不提供分享接口,模拟登陆又会出现许多问题(验证码、弹窗等),所以本项目对两种api进行结合,提供一些关于分享的功能,算是对已有项目的补充。

具体功能

  • 分享文件 share
  • 列出所有分享 list_share
  • 取消分享 cancel_share

用法

使用本项目需有百度云的access_token。如果没有,参考bypy,请先安装bypy,在命令行输入bypy info并进行授权,接着在~/.bypy/bypy.json中找到access_token供api使用。

import BaiduYun_Share
access_token = '1.54be391000a16ee6a21791d4a8ea04fe.86400.1331206383.67272939-188383'
bys = BaiduYun_Share.BYS(access_token)

response = bys.share(['/apps/bypy/a'])  #分享/apps/bypy/a
shareid = response['shareid']  #获取分享id
print(response)

response = bys.list_share()  #列出分享
print(response)

response = bys.cancel_share([shareid])  #取消分享
print(response)

baiduyun_share's People

Contributors

sdwalker233 avatar

Stargazers

wsadczh avatar  avatar Wenze Liu avatar Luffy Liu(秋名山车神) avatar Youmeng avatar 51itclub avatar Thunderball avatar  avatar Blanke avatar XenoAmess avatar BillowSky avatar 来姐 avatar  avatar HuangWei avatar

Watchers

 avatar

baiduyun_share's Issues

分享失败

Ubuntu16.04

{u'error_code': 31066, u'error_msg': u'file does not exist', u'request_id': 1995450273605376755}
Error: sharing file: ///, errno: 31066, error_msg: file does not exist

不知道什么情况,但是使用bypy同步是可以的。

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.