提交 a0079905 编写于 作者: H Hsury

更新登录组件

上级 2518097b
if: 'tag IS blank'
env:
global:
- TRAVIS_TAG=v1.7
- TRAVIS_TAG=v1.8
jobs:
include:
-
......
......@@ -7,4 +7,4 @@ https://github.com/Hsury/BiliDrive"""
__author__ = "Hsury"
__email__ = "i@hsury.com"
__license__ = "SATA"
__version__ = "2019.12.16"
__version__ = "2019.12.22"
......@@ -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 (bbcallen@gmail.com)"})
self.get_cookies = lambda: self._session.cookies.get_dict(domain=".bilibili.com")
self.get_uid = lambda: self.get_cookies().get("DedeUserID", "")
self.username = ""
......@@ -82,7 +82,7 @@ class Bilibili:
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"}
......
......@@ -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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册