Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BVID Validate
import requests
import json
import random
Back_URL = 'https://api.bilibili.com/x/web-interface/archive/stat?aid='
headers = {
'Cookie': "Replace Me With REAL COOKIE" ,
'Pragma': 'no-cache',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36'
}
table='fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF'
tr={}
for i in range(58):
tr[table[i]]=i
s=[11,10,3,8,4,6]
xor=177451812
add=8728348608
def dec(x):
r=0
for i in range(6):
r+=tr[x[s[i]]]*58**i
return (r-add)^xor
def enc(x):
x=(x^xor)+add
r=list('BV1 4 1 7 ')
for i in range(6):
r[s[i]]=table[x//58**i%58]
return ''.join(r)
def checkv(x,y):
if str(enc(int(x))) == str(y):
return "Vaild √"
else:
return "Not Vaild ×"
for i in range(0,50000):
n = random.randint(100,9999999)
resp = requests.get(Back_URL+str(n),headers=headers)
#print(resp.text)
res = json.loads(resp.text)
if int(res["code"]==0):
print("{} {} {}".format(res["data"]["aid"],res["data"]["bvid"],str(checkv(res["data"]["aid"],res["data"]["bvid"]))))
@Revincx

This comment has been minimized.

Copy link

@Revincx Revincx commented Mar 24, 2020

围观,竟然没有评论~
溜了溜了

@elegantYU

This comment has been minimized.

Copy link

@elegantYU elegantYU commented Mar 24, 2020

溜了溜了

@QiuYuMiao

This comment has been minimized.

Copy link

@QiuYuMiao QiuYuMiao commented Mar 24, 2020

溜了溜了

@e101406

This comment has been minimized.

Copy link

@e101406 e101406 commented Mar 24, 2020

溜了溜了

@githubhappynewyear

This comment has been minimized.

Copy link

@githubhappynewyear githubhappynewyear commented Mar 24, 2020

溜了溜了

@hui-shao

This comment has been minimized.

Copy link

@hui-shao hui-shao commented Mar 24, 2020

留个爪印

@CberYellowstone

This comment has been minimized.

Copy link

@CberYellowstone CberYellowstone commented Mar 24, 2020

留个爪印

怎么感觉你有些眼熟???

@hui-shao

This comment has been minimized.

Copy link

@hui-shao hui-shao commented Mar 24, 2020

留个爪印

怎么感觉你有些眼熟???

aha 被发现了

@Xzonn

This comment has been minimized.

Copy link

@Xzonn Xzonn commented Mar 24, 2020

valid是不是打错成vaild了……

@FBshtml

This comment has been minimized.

Copy link

@FBshtml FBshtml commented Mar 25, 2020

没人?

@qinlili23333

This comment has been minimized.

Copy link

@qinlili23333 qinlili23333 commented Mar 26, 2020

围观

@Canscx

This comment has been minimized.

Copy link

@Canscx Canscx commented Mar 26, 2020

举个爪

@LittleBlacklb

This comment has been minimized.

Copy link

@LittleBlacklb LittleBlacklb commented Mar 26, 2020

溜了溜了~

@SunHIAhia

This comment has been minimized.

Copy link

@SunHIAhia SunHIAhia commented Mar 26, 2020

溜了溜了

@sparrowhe

This comment has been minimized.

Copy link

@sparrowhe sparrowhe commented Mar 30, 2020

溜了溜了

@FutureApple

This comment has been minimized.

Copy link

@FutureApple FutureApple commented Apr 3, 2020

吃瓜

@zwzheng45

This comment has been minimized.

Copy link

@zwzheng45 zwzheng45 commented Apr 6, 2020

溜了溜了

@dxl1236

This comment has been minimized.

Copy link

@dxl1236 dxl1236 commented Apr 6, 2020

溜了溜了

@Joe2030

This comment has been minimized.

Copy link

@Joe2030 Joe2030 commented Apr 8, 2020

溜了溜了

@heklmbbsna

This comment has been minimized.

Copy link

@heklmbbsna heklmbbsna commented Apr 8, 2020

tql

@Misaka17032

This comment has been minimized.

Copy link

@Misaka17032 Misaka17032 commented Apr 9, 2020

留名

@acodegod

This comment has been minimized.

Copy link

@acodegod acodegod commented May 12, 2021

溜了溜了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment