Coder Social home page Coder Social logo

baidupcs's People

Contributors

bob-fu avatar boleynsu avatar elfsundae avatar gangzhuo avatar hipboi avatar hosiet avatar imzjy avatar luo87 avatar marks-yag avatar mayenjoy avatar moruoxian avatar pexcn avatar semigodking avatar tbfly avatar tenwx avatar vinewx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

baidupcs's Issues

Build failed on Mac OS X

It will fail when I build the project on Mac OS X(Mavericks, builtin gcc 5.0).
I fixed it by remove all of the inline functions, e.g., change

inline void append_mem_ent(struct pcs_mem *mem)

to

void append_mem_ent(struct pcs_mem *mem)

Do you have any idea on why this happen?
Thanks!

gcc -o bin/pcs bin/main.o bin/shell.o bin/pcs_io.o bin/shell_args.o bin/dir.o bin/hashtable.o bin/rc4.o bin/daemon.o bin/logger.o bin/sqlite3.o   -L./bin -lpcs -lm -lcurl -lssl -lcrypto
Undefined symbols for architecture x86_64:
  "_append_mem_ent", referenced from:
      _pcs_mem_malloc in libpcs.a(pcs_mem.o)
  "_argp_parse", referenced from:
      _shell_args_parse in shell_args.o
  "_chcmpi", referenced from:
      _pcs_utils_strcmpi in libpcs.a(pcs_utils.o)
  "_pcs_http_append_bytes", referenced from:
      _pcs_http_write in libpcs.a(pcs_http.o)
  "_pcs_http_parse_http_head", referenced from:
      _pcs_http_write in libpcs.a(pcs_http.o)
  "_pcs_http_perform", referenced from:
      _pcs_http_get in libpcs.a(pcs_http.o)
      _pcs_http_get_raw in libpcs.a(pcs_http.o)
      _pcs_http_post in libpcs.a(pcs_http.o)
      _pcs_http_get_download in libpcs.a(pcs_http.o)
      _pcs_post_httpform in libpcs.a(pcs_http.o)
  "_pcs_http_prepare", referenced from:
      _pcs_http_get in libpcs.a(pcs_http.o)
      _pcs_http_get_raw in libpcs.a(pcs_http.o)
      _pcs_http_post in libpcs.a(pcs_http.o)
      _pcs_http_get_download in libpcs.a(pcs_http.o)
      _pcs_post_httpform in libpcs.a(pcs_http.o)
  "_read_cookie_attr", referenced from:
      _pcs_http_get_cookie in libpcs.a(pcs_http.o)
  "_remove_mem_ent", referenced from:
      _pcs_mem_free in libpcs.a(pcs_mem.o)
  "_skip_cookie_attr", referenced from:
      _pcs_http_get_cookie in libpcs.a(pcs_http.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/pcs] Error 1

ls命令时自动转换文件的大小

pcs ls 输出格式是这样的
1044374762 2016-04-26 09:45:41 /video/marvel.75.years-from.pulp.to.pop.720p.hdtv.x264-bajskorv.mkv
文件大小(1044374762)是以 byte 为单位,阅读起来很不方便,希望能根据大小调整为 Kb,Mb等单位

几个问题

1)树莓派raspbian下,用户pi登录网盘,并设置定时任务(crontab -e)来自动同步,但是pcs命令都执行失败。这个该如何解决?

2)pcs search查找不到结果,执行echo $?显示0。应该参考其它linux命令,查找不到结果时返回1。

3)pcs upload -f /local/a.txt /remote/a.txt 如果网盘不存在/remote/a.txt,会报错。应该改为程序自动判断网盘是否已存在该问题,若存在,则自动覆盖。既然已经加上-f,表示需要强制复制,为什么还要提示错误?

在 VS 2013 编译 64bit 报错

error LNK1112: 模块计算机类型“X86”与目标计算机类型“x64”冲突 BaiduPCS-master\pcs\argp.lib(vsnprintf.obj) BaiduPCS_DLL

Can't get the file size.

作者你好,我在同步文件到本地时,出现了【Can't get the file size.】错误。百度云上面对应的文件大小是0B,通过火狐浏览器是可以下载文件的。麻烦关注下

下载操作未能识别参数类型为目录

pcs d /packages/index.html download/

以上指令会将index.html保存为本地文件download,而不是先创建本地目录download再将文件下载为download/index.html。是不是可以修改一下这个行为呢?毕竟mvcp这些工具都这么干的。

可否增加其它功能

可否增加以下功能:
1)离线下载,包括链接和BT
2)获取多媒体文件的DLNA地址,用于推送到电视盒子或其它设备播放

cgi-bin

#OpenWRT

/www/cgi/pcs
文件内容:

!/bin/sh

echo "Content-type: text/html"
echo ""
set|while read LINE
do
echo $LINE"
"
done

pcs help

pcs(/usr/bin/pcs) help
任何参数都没有输出,用ssh(root)操作一切正常

set 输出的变量
CONTENT_LENGTH=''
CONTENT_TYPE=''
DOCUMENT_ROOT='/www'
GATEWAY_INTERFACE='CGI/1.1'
HOSTNAME='OpenWrt'
HTTP_ACCEPT='text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8'
HTTP_ACCEPT_CHARSET=''
HTTP_ACCEPT_ENCODING='gzip, deflate, '
HTTP_ACCEPT_LANGUAGE='en-US,en;q=0.8'
HTTP_AUTHORIZATION=''
HTTP_CONNECTION='keep-alive'
HTTP_COOKIE='PHPSESSID=8e2e41e7681e318af90f29b5b33b8674'
HTTP_HOST='192.168.1.1'
HTTP_REFERER=''
HTTP_USER_AGENT='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36'
HTTP_X_HTTP_METHOD_OVERRIDE=''
IFS='
'
OPTIND='1'
PATH='/sbin:/usr/sbin:/bin:/usr/bin'
PPID='2692'
PS1='w $ '
PS2='> '
PS4='+ '
PWD='/www'
QUERY_STRING=''
REDIRECT_STATUS='200'
REMOTE_ADDR='192.168.1.1'
REMOTE_HOST='192.168.1.1'
REMOTE_PORT='47433'
REQUEST_METHOD='GET'
REQUEST_URI='/cgi-bin/pcs'
SCRIPT_FILENAME='/www/cgi-bin/pcs'
SCRIPT_NAME='/cgi-bin/pcs'
SERVER_ADDR='192.168.1.1'
SERVER_NAME='192.168.1.1'
SERVER_PORT='80'
SERVER_PROTOCOL='HTTP/1.1'
SERVER_SOFTWARE='uhttpd'
SHLVL='1'

请问有解吗?

文件上传限速

作者你好,请问有没有上传文件限制速度的选项,我看到了有下载的限速,但是没有找到。能不能支持一下上传限速(ubuntu版本)

Error: Can't create the temp file (For large file only - i.e. > 2GB)

Version info

pcs version
pcs v0.2.1 (API v1.1.1)pcs

Listing for the size of /tv/jurassic.mkv (2.7GB)

pcs list /tv/
PAGE#1

D Size Modify Date Time File Name

d 0 2015-07-13 17:09:14 /tv/Jurassic.World.2015.1080p.HDRip.KORSUB.x264.AAC2.0-RARBG
d 0 2015-07-13 17:11:50 /tv/Jurassic.World.2015.720p.HC.HDRip.X264.AC3-EVO
d 0 2015-07-11 18:35:46 /tv/taxi

  • 2749372028 2015-07-13 17:16:40 /tv/jurassic.mkv

- 1807641558 2015-06-30 11:08:25 /tv/majong.mp4

Total: 4.24GB, File Count: 2, Directory Count: 3

Download /tv/jurassic.mkv and get the error

pcs download /tv/jurassic.mkv jurassic.mkv
Error: Can't create the temp file: jurassic.mkv.0deb2d970640a1bd8dedec8b92b7fd55.pcs_temp, maybe have no disk space.

百度云登录失败

Login Failed: Can't parse the response as object. Response: bd__cbs__pwxtn7({"errInfo":{ "no": "0" }, "data": { "rememberedUserName" : "", "codeString" : "", "token" : "219c1e732b1f961a2512f4f6c53d899c", "cookie" : "1", "usernametype":"", "spLogin" : "rate", "disable":"", "loginrecord":{ 'email':[ ], 'phone':[ ] } }}

上传大文件后,md5文件不一致的可能解决方法

我看了下 bypy 的 解决方法,里面有提到这个问题, 希望可以作为参考
https://github.com/houtianze/bypy
简单说就是:大文件分片上传合并后,百度会返回错误的MD5值。这会导致文件比较失败(本地和远程同样的大文件被认为是不同的文件,因为拿到MD5不一样),进而导致syncup / syncdown重复上传下载。
曲线解决方法:syncup两次。(第二次大文件算是秒传,很快的;小文件不会再传。然后百度云端返回的MD5值都是正确的了)

Openwrt SDK无法编译

按步骤执行之后会
/home/ljkgpxs/src/openwrt/trunk/sdk/OpenWrt-SDK-ramips-mt7620_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/scripts/download.pl "/home/ljkgpxs/src/openwrt/trunk/sdk/OpenWrt-SDK-ramips-mt7620_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/dl" "0.2.0.tar.gz" "unknown" "https://github.com/GangZhuo/BaiduPCS/archive"
然后一直尝试下载0.2.0.tar.gz,直到失败。。。

Login Failed

你好!

今天下載了最新的 source code 去編譯。之後執行:
pcs login --username=myUsername --password=myPassword
就出現了:
Login Failed:

在百度盘可以看到是曾經有登入的:
15:12 香港香港 203.80.. Chrome 35.0 邮箱名登录 百度云
15:09 香港香港 203.80.. Chrome 35.0 邮箱名登录 百度云
15:07 香港香港 203.80.. Chrome 35.0 邮箱名登录 百度云

有其它地方要注意嗎?

OpenWRT编译版无法安装

# ipkg install BaiduPCS_0.2.0_x86.ipk
Clearing state_want and state_flag for pkg=BaiduPCS (arch_priority=0 flag=16 want=2)
Nothing to be done
An error ocurred, return value: 4.
Collected errors:
Cannot find package BaiduPCS.
Check the spelling or perhaps run 'ipkg update'

为什么取得验证码的url,没有参数?

pcs -uUSER_NAME quota --urlc
COOKIE FILE: /root/.baidupcs/default.cookie
Password:
Login Failed: Can't get captch image from the server : https://passport.baidu.com/cgi-bin/genimage?

我发现报错以后, 简单改了一下代码,

url = pcs_utils_sprintf(URL_CAPTCHA "%s", code_string);
img = pcs_http_get_raw(pcs->http, url, PcsTrue, &imgsz); pcs_free(url);
if (!img) {
pcs_set_errmsg(handle, "Can't get captch image from the server : %s",url);
return PCS_NETWORK_ERROR;
}

想看看为什么会出错, 但是 url 是没有参数的, 请问如何修正, 谢谢

上传文件的时候,一定要指定远程文件名

这个不一定是issue. 但是用起来不方便. 比如我要上传一个文件到远程的 / 目录下, 非要指定远程的文件名才行. 是否可以更新下, 如果远程为目录, 则默认用本地的文件名. 这样更方便一些.

无法使用手机号登录

用手机号码注册百度云帐号,使用手机号登录,验证码连续刷新3次后登录失败。
同一个帐号,添加用户名后,使用用户名登录可以成功。

怎么已经毫无反应了?

pcs who ,pcs login什么的,都是完全没输出了,这是怎么啦,
git pull亦提示是最新版本,大家的都怎么了?

同步的不完美实现方式

新增一个功能:“同步上传”:本地文件上传网盘后,验证md5值,通过touch命令修改本地文件的时间与百度网盘中的一致。

无法Login !

  1. cent os系统 和 Ubuntu 系统
  2. 输入验证码之后,没有反应。
  3. 怎么回事?

长的的文件名会提示错误

当下载的文件名是zh-hans_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-74070.iso的时候会提示Error: The remote file not exist, or have error: The folder can not be moved, Error:2
但是当名字改成Windows_XP.iso就可以了。

Unable to make on El Capitan

Wills-MacBook-Pro:BaiduPCS will$ brew info openssl
openssl: stable 1.0.2d (bottled)
OpenSSL SSL/TLS cryptography library
https://openssl.org/

This formula is keg-only.
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

/usr/local/Cellar/openssl/1.0.2d_1 (464 files, 18M)
  Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/openssl.rb
==> Dependencies
Build: makedepend ✔
==> Options
--universal
    Build a universal binary
--without-check
    Skip build-time tests (not recommended)
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

Wills-MacBook-Pro:BaiduPCS will$ make
makefile:23: "Use 'make ver=debug' to build for gdb debug."
mkdir -p bin/
cc -o bin/pcs.o -c -fPIC -D_FILE_OFFSET_BITS=64 pcs/pcs.c
pcs/pcs.c:10:11: fatal error: 'openssl/md5.h' file not found
# include <openssl/md5.h>
          ^
1 error generated.
make: *** [bin/pcs.o] Error 1

python调用后出现错误

首先感谢作者,真的非常强大,我申请不大百度的PCS的接口权限,用这个非常方便。

下面是用的问题,我在树莓派上使用flask和python commends模块做了一个web gui,我的操作是:
1、首先安装成功了baidupcs,命令行下登录、列表、目录改名完成OK!命令行提示非常完美,新手友好;
2、我的flask下第一次使用 ret , data = commends.getstatusoutput("pcs list")
之后print data 列表完整,非常OK;
我ctrl c之后改成了 print ret \n return data问题就出现了。
3、现在不管是web还是cli,都出现:
pcs who
Wrong file size: Size=0, /home/pi/.pcs/pcs.context
Error: Can't read the context file (/home/pi/.pcs/pcs.context).
You are not logon or your session is time out. You can login by 'login' command.
————————————
事实上login命令也不行:
pcs login
Wrong file size: Size=0, /home/pi/.pcs/pcs.context
Error: Can't read the context file (/home/pi/.pcs/pcs.context).
——————————
提示pcs.context是空白文件;

我不知道是哪里卡住了,请求高手帮助。谢谢

登陆正确 但是提示失败

➜  playground pcs login
User Name: mask_mask
Password: 
Login Failed: Success
  • 登录失败
  • 其实用户名密码正确
  • 怀疑是百度passport的返回码改了 后面的Success应该是表示登陆成功, 但是代码改了

大文件上传,经常出现超时的错误.

前 99% 的速度, 上传的速度有异常的稳定, 如果中途有超时情况, 重试就可以过去. 但是每次到了99% 以后, 就很容易出现如下的错误提示. 然后就一直卡着不动.一直不停的重试.

Upload slice failed, retry delay 10 second, tid: 0x7f21b123d700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***

如上, 如果上传超过12G或者更大的文件. 上传完成以后,就会出现这个错误. 而且重试了很多次,一直都提示同样的错误.

其实已经上传了99.99%.

重复出现如下错误.


Upload slice failed, retry delay 10 second, tid: 0x7f21b123d700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***
Upload slice failed, retry delay 10 second, tid: 0x7f2166301700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***
Upload slice failed, retry delay 10 second, tid: 0x7f21a0909700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***
Upload slice failed, retry delay 10 second, tid: 0x7f21b123d700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***
Upload slice failed, retry delay 10 second, tid: 0x7f2166301700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***
Upload slice failed, retry delay 10 second, tid: 0x7f21a0909700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***
Upload slice failed, retry delay 10 second, tid: 0x7f21b123d700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***
Upload slice failed, retry delay 10 second, tid: 0x7f2166301700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***
Upload slice failed, retry delay 10 second, tid: 0x7f21a0909700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***
Upload slice failed, retry delay 10 second, tid: 0x7f21b123d700. message: Timeout was reached: http://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&type=tmpfile&app_id=250528&BDUSS=***


不能上传目录

我觉得这个工具很好,下载没问题,可是目录上传不行.

pcs synch -u localdir /
Scanning local file system...
Completed
Fetching net disk file list...
Fetch 9
Completed
Comparing...

Completed

Download: off, Upload: on, Confuse: off, Equal: off
Printing|Synching...
Completed

Local File OP Net Disk File

Statistic:

Need Download: 9, Need Upload: 0
Confuse: 0, Equal: 0, Other: 0
Total: 9, Fail: 0

Notes:
<- means the right file will download into
the local file system.
-> means the left file will upload into the disk.
== means left file same as right file.

< means confuse, don't known how to.

还是我的用法有问题, 正常情况下,应该是可以的啊

Can't read response codestring, but login successful anyways

Running ./pcs login displays an error, but afterwards running ./pcs who shows that I am logged in, and I can access my files with ./pcs ls. It seems that there was no captcha?

User Name: crossbowffs
Password: 
Login Failed: Can't read the codestring from the response. Response: <!DOCTYPE html><html><head><meta http-equiv=Content-Type content="text/html; charset=UTF-8"></head><body><script>


    var href = decodeURIComponent("http:\/\/pan.baidu.com\/res\/static\/thirdparty\/pass_v3_jump.html")+"?"

var accounts = '&accounts='

href += "err_no=18&callback=parent.bd__pcbs__msdlhs&codeString=&userName=crossbowffs&phoneNumber=&mail=&hao123Param=[...]&u=http://pan.baidu.com/&tpl=&secstate=&gotourl=&authtoken=&loginproxy=&resetpwd=&vcodetype=&lstr=&ltoken=&bckv=&bcsync=&bcchecksum=&code=&bdToken=&realnameswitch=0&bctime="+accounts;

if(window.location){
    window.location.replace(href);
}else{
   document.location.replace(href); 
}
</script>

如果将文件加密上传,然后用普通的方式下载

如果将文件加密上传,然后用普通的方式下载,请问该用什么方式进行解密?
这个问题主要是考虑到这种情况. 我需要把爱情电影进行加密上传到百度云, 然后下载的时候,用百度云管家下载. 这个下载速度比较快. 因为上传是经过加密的.需要解密, 请问有没有相关的方法进行解密?

另外一个问题, 如果百度云网盘的网站接口发生了改变, 是不是需要重新编译源代码?

建议上传文件的时候,增加命令行参数进行加密上传的功能.

感谢开发者的努力. 我一直在测试这个,感觉很好用. 但是我觉得有点需要改进下.就是在上传文件的时候, 可以通过命令行指定加密方式.
比如很多人有这种需求, 上传A文件的时候, 不加密上传. 上传B文件的时候, 又需要加密上传. 如果不能在命令行参数中控制, 每次上传完毕,都需要修改一次配置文件. 比较麻烦.
建议在上传文件的时候, 可以通过参数,手动指定是否加密上传

因为经常需要批量上传文件和文件夹. 每次都需要修改配置文件, 改来改去很麻烦

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.