Giter VIP home page Giter VIP logo

baiduphoto's People

Contributors

hengyueli avatar muyangren907 avatar wszl 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

Watchers

 avatar  avatar

baiduphoto's Issues

上传的创建时间不正确

上传的创建时间(shoot_time)不正确,我发现信息包含在media_info中,media_info的加密方式照着js我写出来了,有空讨论下

ERROR:root:unknow return_type =2 @upload_1file_directly

当上传文件的时候,有时候会报错。 实际上是上传成功了,但没在对应相册内。

我猜测是因为上传文件文件名 在服务器上已经存在了,服务器会自动重命名一次。

所以upload_1file 上传文件的时候,能不能指定自定义名字;不然本地改名就只能去改文件名,就很麻烦,我只想临时给个时间戳,保证服务器没重名就行,本地文件名不想改动

batch download

选择多个图片批量下载可以直接得到一个zip包,这是相当方便的。但是在下载的时候需要生成一个sign的值。生成这个值的必要信息已经拿到了,但是看不懂生成过程。下面是一个例子,不知道有没有人可以尝试猜猜答案。

Input

{
  "sign1": "a2c0154f9bc90880a8fdcafb130fc86344fffac0",
  "sign2": "function s(j,r){var a=[];var p=[];var o=\"\";var v=j.length;for(var q=0;q<256;q++){a[q]=j.substr((q%v),1).charCodeAt(0);p[q]=q}for(var u=q=0;q<256;q++){u=(u+p[q]+a[q])%256;var t=p[q];p[q]=p[u];p[u]=t}for(var i=u=q=0;q<r.length;q++){i=(i+1)%256;u=(u+p[i])%256;var t=p[i];p[i]=p[u];p[u]=t;k=p[((p[i]+p[u])%256)];o+=String.fromCharCode(r.charCodeAt(q)^k)}return o};",
  "sign3": "d76e889b6aafd3087ac3bd56f4d4053a",
  "timestamp": 1651220609
}

Output

I1ItEHuIvfBeuJEx2pb4/iLQ62yrf5XdalQoa5g5sRRMBCEL/l7jYg==

develop downloader

对于打包下载,现在可以生成下载地址。对于这个现成的下载地址,希望可以做一个花里胡哨的下载器。

贡献代码请打开pybaiduphoto/contribution.py找到downLoader类,补充函数getDownloadZip即可。

class downLoader():

    def __init__(self,req):
        self.req = req

    def getDownloadZip(self,url,dirPath,fileName):
        pass

Notes

  • 请不要更改除了contribution .py以外的任何文件
  • 可以直接pr到master
  • 通过url下载文件,文件存储到路径下
  • 希望这是一个支持断点续传功能的(还不确定支持不支持,不支持就算了)
  • 希望这是一个带进度条的 (推荐使用rich,https://pypi.org/project/rich/,以后还想统一用rich做其他的事情)
  • 网路参数请从self.req中取出,最好直接用self.req。可以参考Requests.py中的说明
  • 完成局部册书后可以通过api.g.getDownloadZip(items,dirPath,zipname)函数尝试下载几个图片,能成功则完成全局测试

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.