GithubHelp home page GithubHelp logo

Comments (3)

z0z0r4 avatar z0z0r4 commented on May 26, 2024

有谁遇到过的吗?

示例
pip install bilibili-api-python

from bilibili_api import Credential, sync
sync(Credential(sessdata="", bili_jct="", ac_time_value="").refresh())

这太大坨了,我实在抠不出来

from bilibili-api-collect.

My-Responsitories avatar My-Responsitories commented on May 26, 2024

没有, 这边依然正常刷新, 试试检查你的本地时间是否正确
示例:

import re
import time
import requests
from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey.RSA import RsaKey
from Crypto.Hash import SHA256

public_key = RsaKey(
    n=int('cb81dd8e02470656da04dd38544446e2a3412051cfe9adc6a330a5ef90228509684960970b91c3360ca29c49e1690ff8fa068cb9dfc6179d1e9585cb9424e847db1ef59f33e37dd4dca8ccfb7631ee9b4a92640d00c8204300152a0ab7cd802889d3445aec69918fe6022b534912e7b095be3424dad1ba81145e969b533181f1', 16),
    e=65537
)

def getCorrespondUrl(timestamp:int):
    data = f"refresh_{timestamp}".encode()
    encrypted = PKCS1_OAEP.new(public_key, hashAlgo=SHA256).encrypt(data)
    return f"https://www.bilibili.com/correspond/1/{encrypted.hex()}"


url = getCorrespondUrl(int(time.time() * 1000))
response = requests.get(url, headers={'user-agent': 'Mozilla/5.0'}, cookies={'SESSDATA': sess})
response.raise_for_status()
refresh_csrf = re.search(r'<div id="1-name">([0-9a-f]+)</div>', response.text).group(1)
print(refresh_csrf, len(refresh_csrf))
# *** 32

from bilibili-api-collect.

z0z0r4 avatar z0z0r4 commented on May 26, 2024

我现在也复现不出了...暂时搁置,看看我那边发 issue 的怎么说

from bilibili-api-collect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.