diff --git a/.travis.yml b/.travis.yml index ec89b43..03d0c4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ if: 'tag IS blank' env: global: - - TRAVIS_TAG=v1.7 + - TRAVIS_TAG=v1.8 jobs: include: - diff --git a/BiliDrive/__init__.py b/BiliDrive/__init__.py index 5e81a5e..cef505e 100644 --- a/BiliDrive/__init__.py +++ b/BiliDrive/__init__.py @@ -7,4 +7,4 @@ __author__ = "Hsury" __email__ = "i@hsury.com" __license__ = "SATA" -__version__ = "2019.12.16" +__version__ = "2019.12.22" diff --git a/BiliDrive/bilibili.py b/BiliDrive/bilibili.py index dc52225..e8e9bec 100644 --- a/BiliDrive/bilibili.py +++ b/BiliDrive/bilibili.py @@ -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 @@ 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"} diff --git a/README.md b/README.md index 38f330b..c093281 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@
- +