Skip to content

Commit

Permalink
更新登录组件
Browse files Browse the repository at this point in the history
  • Loading branch information
Hsury committed Dec 22, 2019
1 parent 2518097 commit a007990
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if: 'tag IS blank'
env:
global:
- TRAVIS_TAG=v1.7
- TRAVIS_TAG=v1.8
jobs:
include:
-
Expand Down
2 changes: 1 addition & 1 deletion BiliDrive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
__author__ = "Hsury"
__email__ = "[email protected]"
__license__ = "SATA"
__version__ = "2019.12.16"
__version__ = "2019.12.22"
4 changes: 2 additions & 2 deletions BiliDrive/bilibili.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Bilibili:

def __init__(self):
self._session = requests.Session()
self._session.headers.update({'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36"})
self._session.headers.update({'User-Agent': "Mozilla/5.0 BiliDroid/5.51.1 ([email protected])"})
self.get_cookies = lambda: self._session.cookies.get_dict(domain=".bilibili.com")
self.get_uid = lambda: self.get_cookies().get("DedeUserID", "")
self.username = ""
Expand Down Expand Up @@ -82,7 +82,7 @@ def get_key():
while True:
key = get_key()
key_hash, pub_key = key['key_hash'], key['pub_key']
url = f"https://passport.bilibili.com/api/v3/oauth2/login"
url = f"https://passport.bilibili.com/api/v2/oauth2/login"
param = f"appkey={Bilibili.app_key}&password={parse.quote_plus(base64.b64encode(rsa.encrypt(f'{key_hash}{self.password}'.encode(), pub_key)))}&username={parse.quote_plus(self.username)}"
payload = f"{param}&sign={self.calc_sign(param)}"
headers = {'Content-type': "application/x-www-form-urlencoded"}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h4 align="center">☁️ 哔哩哔哩云,支持任意文件的全速上传与下载 ☁️</h4>

<p align="center">
<img src="https://img.shields.io/badge/version-2019.12.16-green.svg?longCache=true&style=for-the-badge">
<img src="https://img.shields.io/badge/version-2019.12.22-green.svg?longCache=true&style=for-the-badge">
<img src="https://img.shields.io/badge/license-SATA-blue.svg?longCache=true&style=for-the-badge">
<img src="https://img.shields.io/travis/com/Hsury/BiliDrive?style=for-the-badge">
</p>
Expand Down

0 comments on commit a007990

Please sign in to comment.