From 4bae4f711b811f7dcbb40616608652df2bd0afc1 Mon Sep 17 00:00:00 2001 From: jemygraw Date: Thu, 27 Apr 2017 16:33:45 +0800 Subject: [PATCH 1/2] remove old files --- examples/pfop_ vframe.py | 29 ----------------------------- examples/pfop_ watermark.py | 32 -------------------------------- 2 files changed, 61 deletions(-) delete mode 100644 examples/pfop_ vframe.py delete mode 100644 examples/pfop_ watermark.py diff --git a/examples/pfop_ vframe.py b/examples/pfop_ vframe.py deleted file mode 100644 index 6c1c2ba5..00000000 --- a/examples/pfop_ vframe.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# flake8: noqa -from qiniu import Auth, PersistentFop, build_op, op_save, urlsafe_base64_encode - -#对已经上传到七牛的视频发起异步转码操作 -access_key = 'Access_Key' -secret_key = 'Secret_Key' -q = Auth(access_key, secret_key) - -#要转码的文件所在的空间和文件名。 -bucket = 'Bucket_Name' -key = '1.mp4' - -#转码是使用的队列名称。 -pipeline = 'mpsdemo' - -#要进行视频截图操作。 -fops = 'vframe/jpg/offset/1/w/480/h/360/rotate/90' - -#可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当前空间 -saveas_key = urlsafe_base64_encode('目标Bucket_Name:自定义文件key') -fops = fops+'|saveas/'+saveas_key - -pfop = PersistentFop(q, bucket, pipeline) -ops = [] -ops.append(fops) -ret, info = pfop.execute(key, ops, 1) -print(info) -assert ret['persistentId'] is not None \ No newline at end of file diff --git a/examples/pfop_ watermark.py b/examples/pfop_ watermark.py deleted file mode 100644 index dd1a97d4..00000000 --- a/examples/pfop_ watermark.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# flake8: noqa -from qiniu import Auth, PersistentFop, build_op, op_save, urlsafe_base64_encode - -#对已经上传到七牛的视频发起异步转码操作 -access_key = 'Access_Key' -secret_key = 'Secret_Key' -q = Auth(access_key, secret_key) - -#要转码的文件所在的空间和文件名。 -bucket = 'Bucket_Name' -key = '1.mp4' - -#转码是使用的队列名称。 -pipeline = 'mpsdemo' - -#需要添加水印的图片UrlSafeBase64,可以参考http://developer.qiniu.com/code/v6/api/dora-api/av/video-watermark.html -base64URL = urlsafe_base64_encode('http://developer.qiniu.com/resource/logo-2.jpg'); - -#视频水印参数 -fops = 'avthumb/mp4/'+base64URL - -#可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当前空间 -saveas_key = urlsafe_base64_encode('目标Bucket_Name:自定义文件key') -fops = fops+'|saveas/'+saveas_key - -pfop = PersistentFop(q, bucket, pipeline) -ops = [] -ops.append(fops) -ret, info = pfop.execute(key, ops, 1) -print(info) -assert ret['persistentId'] \ No newline at end of file From 1bb4cd74a403b681ce6fdaa9ec6df3b78765c831 Mon Sep 17 00:00:00 2001 From: jemygraw Date: Mon, 5 Jun 2017 10:07:03 +0800 Subject: [PATCH 2/2] publish 7.1.3 --- CHANGELOG.md | 6 +++++- qiniu/__init__.py | 2 +- qiniu/auth.py | 14 +++----------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f7721c8..a7884879 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -#Changelog +# Changelog + +## 7.1.3 (2017-06-05) +### 修正 +* cdn功能中获取域名日志列表的参数错误 ## 7.1.2 (2017-03-24) ### 增加 diff --git a/qiniu/__init__.py b/qiniu/__init__.py index 870e3857..fac846cb 100644 --- a/qiniu/__init__.py +++ b/qiniu/__init__.py @@ -9,7 +9,7 @@ # flake8: noqa -__version__ = '7.1.2' +__version__ = '7.1.3' from .auth import Auth, QiniuMacAuth diff --git a/qiniu/auth.py b/qiniu/auth.py index feef3bcc..a5d8c86b 100644 --- a/qiniu/auth.py +++ b/qiniu/auth.py @@ -11,7 +11,7 @@ # 上传策略,参数规格详见 -# http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html +# https://developer.qiniu.com/kodo/manual/1206/put-policy _policy_fields = set([ 'callbackUrl', # 回调URL 'callbackBody', # 回调Body @@ -37,19 +37,14 @@ 'deleteAfterDays', # 文件多少天后自动删除 ]) -_deprecated_policy_fields = set([ - 'asyncOps' -]) - - class Auth(object): """七牛安全机制类 该类主要内容是七牛上传凭证、下载凭证、管理凭证三种凭证的签名接口的实现,以及回调验证。 Attributes: - __access_key: 账号密钥对中的accessKey,详见 https://portal.qiniu.com/setting/key - __secret_key: 账号密钥对重的secretKey,详见 https://portal.qiniu.com/setting/key + __access_key: 账号密钥对中的accessKey,详见 https://portal.qiniu.com/user/key + __secret_key: 账号密钥对重的secretKey,详见 https://portal.qiniu.com/user/key """ def __init__(self, access_key, secret_key): @@ -178,8 +173,6 @@ def verify_callback(self, origin_authorization, url, body, content_type='applica @staticmethod def __copy_policy(policy, to, strict_policy): for k, v in policy.items(): - if k in _deprecated_policy_fields: - raise ValueError(k + ' has deprecated') if (not strict_policy) or k in _policy_fields: to[k] = v @@ -189,7 +182,6 @@ def __init__(self, auth): self.auth = auth def __call__(self, r): - token = None if r.body is not None and r.headers['Content-Type'] == 'application/x-www-form-urlencoded': token = self.auth.token_of_request(r.url, r.body, 'application/x-www-form-urlencoded') else: