hengyueli / baiduphoto Goto Github PK
View Code? Open in Web Editor NEW一刻相册 API
License: MIT License
一刻相册 API
License: MIT License
选择多个图片批量下载可以直接得到一个zip包,这是相当方便的。但是在下载的时候需要生成一个sign的值。生成这个值的必要信息已经拿到了,但是看不懂生成过程。下面是一个例子,不知道有没有人可以尝试猜猜答案。
{
"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
}
I1ItEHuIvfBeuJEx2pb4/iLQ62yrf5XdalQoa5g5sRRMBCEL/l7jYg==
相册名可以重复,新建之前先查询下会比较方便。
而搜索也是很常用的功能
当上传文件的时候,有时候会报错。 实际上是上传成功了,但没在对应相册内。
我猜测是因为上传文件文件名 在服务器上已经存在了,服务器会自动重命名一次。
所以upload_1file
上传文件的时候,能不能指定自定义名字;不然本地改名就只能去改文件名,就很麻烦,我只想临时给个时间戳,保证服务器没重名就行,本地文件名不想改动
希望通过api下载上传的原图,而不是压缩后的
上传的创建时间(shoot_time)不正确,我发现信息包含在media_info中,media_info的加密方式照着js我写出来了,有空讨论下
对于打包下载,现在可以生成下载地址。对于这个现成的下载地址,希望可以做一个花里胡哨的下载器。
贡献代码请打开pybaiduphoto/contribution.py
找到downLoader
类,补充函数getDownloadZip
即可。
class downLoader():
def __init__(self,req):
self.req = req
def getDownloadZip(self,url,dirPath,fileName):
pass
contribution .py
以外的任何文件api.g.getDownloadZip(items,dirPath,zipname)
函数尝试下载几个图片,能成功则完成全局测试A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.