相关文章推荐
乖乖的钱包  ·  java - ByteBuddy ...·  1 年前    · 
温柔的椰子  ·  android ...·  1 年前    · 
傻傻的茴香  ·  springboot2.1.3整合webso ...·  1 年前    · 

群晖的NAS一直口碑都不错,主要是安全性和功能都比较完善,可玩性比较高。最近在学Python,就想着拿PhotoStation的API来练练手,看看能不能捣鼓出一些新的功能来。

结果上网这么一查,没想到群晖竟然没有提供官方的API文档(倒是提供了File Station API Guide)真是让人大跌眼镜,是担心被玩坏呢还是怎么想。好不容易从其他地方找到了一些资料,这里给大家做下分享,也是抛砖引玉,如果有人找到官方的API,也请留言,多谢。

1、API接口

接口API主要由以下5个基本要素组成

  • API name : Name of the API requested
  • version : Version of the API requested
  • path : path of the API. The path information can be retrieved by requesting SYNO.API.Info
  • method : Method of the API requested
  • _sid : Authorized session ID. Each API request should pass it, which is retrieved from the response of /webapi/auth.cgi, via either HTTP/HTTPS GET/POST method with “_sid” argument. Otherwise, if you pass it within “id” value of cookie of HTTP/HTTPS header, this parameter can be ignored.

GET /webapi/<CGI_PATH>?api=<API_NAME>&version=&method=[&][&_sid=]

myds.com :port/webapi/query.cgi? api=SYNO.API.Info &version=1&method=query&query=all

API name : SYNO.API.Info version : 1 path : query.cgi method : query params : query=all

"maxVersion" : 1, "methods" : { "1" : [ "list" , "getinfo" , "create" , "edit" , "delete" , "arrangeitem" , "move" , "cleararrangeitem" , "cancel" ] "SYNO.PhotoStation.Permission" : { "path" : "permission.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "getalbum" , "editalbum" , "editgroup" , "list_public_share" , "edit_public_share" ] "SYNO.PhotoStation.Photo" : { "path" : "photo.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "listexif" , "listfeatureditem" , "listgpsgroup" , "listgpsgroupeditem" , "getinfo" , "getexif" , "edit" , "delete" , "copy" , "cancel" ] "SYNO.PhotoStation.Thumb" : { "path" : "thumb.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "get" , "get_dsm_thumb" ] "SYNO.PhotoStation.Cover" : { "path" : "cover.php" , "minVersion" : 1, "maxVersion" : 2, "methods" : { "1" : [ "set" ], "2" : [ "set" , "setsmart" ] "SYNO.PhotoStation.SmartAlbum" : { "path" : "smart_album.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "getinfo" , "create" , "edit" , "delete" ] "SYNO.PhotoStation.File" : { "path" : "file.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "uploadphoto" , "uploadvideo" ] "SYNO.PhotoStation.Download" : { "path" : "download.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "getphoto" , "getvideo" , "getitem" ] "SYNO.PhotoStation.Category" : { "path" : "category.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "getinfo" , "create" , "edit" , "delete" , "arrangecategory" , "listitem" , "additem" , "removeitem" , "arrangeitem" ] "SYNO.PhotoStation.About" : { "path" : "about.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "get" , "set" , "set_visibility" ] "SYNO.PhotoStation.Tag" : { "path" : "tag.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "getinfo" , "create" , "edit" , "delete" , "searchplace" , "delete_unconfirmed_tag" ] "SYNO.PhotoStation.PhotoTag" : { "path" : "photo_tag.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "people_tag" , "geo_tag" , "desc_tag" , "delete" , "people_tag_confirm" ] "SYNO.PhotoStation.Comment" : { "path" : "comment.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "create" , "delete" ] "SYNO.PhotoStation.Timeline" : { "path" : "timeline.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "getindex" ] "SYNO.PhotoStation.Group" : { "path" : "group.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "get" , "get_dsm_group" , "getmember" , "create" , "edit" , "editmember" , "delete" ] "SYNO.PhotoStation.Rotate" : { "path" : "rotate.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "set" ] "SYNO.PhotoStation.SlideshowMusic" : { "path" : "slideshow_music.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "get" , "add" , "edit" , "delete" ] "SYNO.PhotoStation.DsmShare" : { "path" : "dsm_share.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "copy" , "copymusic" ] "SYNO.PhotoStation.SharedAlbum" : { "path" : "shared_album.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "getinfo" , "getinfo_public" , "create" , "edit" , "delete" , "add_items" , "remove_items" , "edit_public_share" , "get_single_item" , "set_single_item" ] "SYNO.PhotoStation.PhotoLog" : { "path" : "log.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" , "clear" , "export" ] "SYNO.PhotoStation.Path" : { "path" : "path.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "getpath" , "checkpath" ] "SYNO.PhotoStation.Watermark" : { "path" : "watermark.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "getshare" , "listshare" , "upload" , "copy" , "delete" , "remove" ] "SYNO.PhotoStation.Public" : { "path" : "public.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "list" ] "SYNO.PhotoStation.Migration" : { "path" : "migration.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "export_blog" ] "SYNO.PhotoStation.ACL" : { "path" : "acl.php" , "minVersion" : 1, "maxVersion" : 1, "methods" : { "1" : [ "get" , "set" ]
2、开源Python 项目(一个芬兰人写的)

github.com/skarppi/pyt… pypi.org/project/pho… 用法也很简单,不过作者实现的功能也不多,主要就是对照片的元数据进行修改之类。 具体就不多说了,大家可以上github上下代码看看

3、API 可以用来做什么
  • 给照片或者视频批量打标签、评分、修改日期等等
  • 批量上传图片和视频
  • 其他还可以做什么,需要开下脑洞
4、参考资料

论坛 官方文档下载地址

转载于:https://juejin.im/post/5c440ed3518825253315f85e

原文链接: https://juejin.im/post/5c440ed3518825253315f85e 文件集中服务器管理,解决应用端为了负载均衡多机部署带来文件存储问题,集中文件IO 协议:文件上传使用html表单上传协议 上传:web可以flash跨域直接上传文件,后台可以通过SDK上传文件 文件存储:服务端没有Name Server,上传文件都会重命名随机字符,两层文件夹结构,客户端直接 GET 文件,无需调用任何接口 ,客户端要自行维护上传的真实文件名的关系。可通过配置Nginx 加http头实现 下载同时自动重命名 单点故障:异步队列自动同步集中文件服务器的文件备份服务器 Synology 群晖 (以下简称 群晖 )的NAS是个好东西,在个人、工作室、企业内都可能会有使用场景。针对企业内的使用场景,本文介绍,如何通过CLI和 API 实现对 群晖 NAS内文件夹的权限管理。 此方法落地后可以实现通过上层ERP或者OA系统向 群晖 NAS下发文件夹权限配置,实现流程申请-自动授权的效果。 一、 群晖 SynoCLI命令行 群晖 NAS使用的Disk Stat ion Management(NAS管理操作系统,以下简称DSM)操作系统基于Linux开发,其中除了常见的Linux操作命令以外,还有一套独特的S 返回码规范: 统一六位 000000 表示成功! 参数相关返回码预留100000-199999;系统相关返回码预留200000-299999;数据中心310000-319999后续项目以此类推,后续根据业务扩展情况新增操作码需要提前备案! module =系统码  optCode=操作码  optDesc = 操作描述  resultCode =结果码  resultDesc... 我的手机端下载ds photo app 软件,自动备份的时候,选择dicm目录,下面有微信的目录,还有截图的目录,但是就是没有camera 这个目录,折腾了很久,查了不少 资料 ,就是无法解决, 最后在摸索的各种尝试下,终于解决了,解决如下: 用手机端文件管理,找到目录camera,然后修改名字(my photo ),修改之后,再建一个Camera,防止相机无法使用。 然后清除一下缓存(这个可以做也可以不做),这时候,再去查看备份的目录,点击自定义,就可以找到my photo 这个目录了。 如果有不明白的,可 MyNAS一个 群晖 Photo Stat ion 的替代品,采用VUE前端+Flask后端实现,数据库采用PostgreSQL。如果你和我一样恰好有很多"人脸识别"的“素材”需要管理,恰好有很多"压缩包"形态或者文件夹形态的"图片集"需要管理查看,图片总数是百万级别的话,那么不妨继续看下去。对于常规(100W)以下图片的“看图”需求,有以下几个项目建议使用:PLEX/emby,商业版软件,NAS必备软... ​ 群晖 本身是一个文件系统,用于存储,但是他本身是armbain还是什么忘了,内核都可以算是Linux吧,那么就可以开搞了,当成服务器搞,当然你的黑/白 群晖 硬件不会拖后腿的话…一张思维导图可以大概概括一下。。。 Android Studio集成云视讯SDK在云视讯的开发者中心内有集成开发文档,但有一些问题我是在自己集成的过程中发现的,还询问了云视讯相关的工作人员得以解决。 我集成的是云视讯的多媒体业务,提交的是 《测试环境证书-SDK API 联调管理》,在sdk测试过程(APP运行过程)中,InitActivity需要选中"测试环境"的checkbox。企业开发应该是有相应的《生产环境证书-SDK API 联调管理》。 先说一下让SDK正常运行的操作步骤(要直接集成SDK的请直接在下边找集成SDK过程): 官网:http