Skip to content

Commit e3b6170

Browse files
committed
Version 0.1.1
bugfix : Session object not being correctly specified with the following API calls: `LoginViaCellphone, LoginViaEmail, LoginViaAnonymousAccount,SetUploadObject` (#55)
1 parent b5ecef3 commit e3b6170

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pyncm_async/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""PyNCM-Async 网易云音乐 Python 异步 API / 下载工具"""
33
__VERSION_MAJOR__ = 0
44
__VERSION_MINOR__ = 1
5-
__VERSION_PATCH__ = 0
5+
__VERSION_PATCH__ = 1
66

77
__version__ = '%s.%s.%s' % (__VERSION_MAJOR__,__VERSION_MINOR__,__VERSION_PATCH__)
88

pyncm_async/apis/cloud.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def GetNosToken(
7373

7474

7575
async def SetUploadObject(
76-
stream, md5, fileSize, objectKey, token, offset=0, compete=True, bucket=BUCKET
76+
stream, md5, fileSize, objectKey, token, offset=0, compete=True, bucket=BUCKET, session=None
7777
):
7878
"""移动端 - 上传内容
7979
@@ -88,7 +88,7 @@ async def SetUploadObject(
8888
Returns:
8989
dict
9090
"""
91-
r = await GetCurrentSession().post(
91+
r = await (session or GetCurrentSession()).post(
9292
"http://45.127.129.8/%s/" % bucket + objectKey.replace("/", "%2F"),
9393
data=stream,
9494
params={"version": "1.0", "offset": offset, "complete": str(compete).lower()},

pyncm_async/apis/login.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async def LoginViaCellphone(phone="", password="",passwordHash="",captcha="", ct
145145
**auth_token
146146
},
147147
)
148-
)()
148+
)(session=session)
149149

150150
WriteLoginInfo(login_status, session)
151151
return {'code':200,'result':session.login_info}
@@ -189,7 +189,7 @@ async def LoginViaEmail(email="", password="",passwordHash="", remeberLogin=True
189189
**auth_token
190190
},
191191
)
192-
)()
192+
)(session=session)
193193

194194
WriteLoginInfo(login_status,session)
195195
return {'code':200,'result':session.login_info}
@@ -218,7 +218,7 @@ async def LoginViaAnonymousAccount(deviceId=None, session=None):
218218
).decode()
219219
}
220220
)
221-
)()
221+
)(session=session)
222222
assert login_status['code'] == 200,"匿名登陆失败"
223223
WriteLoginInfo({
224224
**login_status,

0 commit comments

Comments
 (0)