bilibili用户信息查询
bilibili用户信息查询
http://space.bilibili.com/ajax/member/GetInfo?mid=
后缀为用户mid号
# -*- coding:utf-8 -*-
# !python3
import requests
import json
url = 'http://space.bilibili.com/ajax/member/GetInfo?mid=423895'
head = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,'
' like Gecko) Chrome/52.0.2743.82 Safari/537.36'
}
jscontent = requests.get(url, headers=head, verify=False).content.decode()
jsDict = json.loads(jscontent)
with open("bilibili.json", "w+") as f:
f.write(json.dumps(jsDict, indent=4, ensure_ascii=False))
返回json的用户信息:
{"status":true,"data":{"mid":"423895","name":"\u6015\u4e0a\u706b\u66b4\u738b\u8001\u83ca","approve":false,"sex":"\u4fdd\u5bc6","rank":"10000","face":"http://i1.hdslb.com/bfs/face/b55e96895608e03c3435d018b708a705ccc2bda4.gif","coins":0,"DisplayRank":"1043","regtime":1339205465,"spacesta":0,"birthday":"1949-03-22","place":"","description":"","article":0,"attentions":[43536,244842,88358,569636,420876,201434,673816,374377,100691,920713,397435,35680,375375,12994,891124,15810,379803,33696,585267,12018,168598,356776,1344144,1734728,295641,2276820,145716,3307964,2825112,546195,104884,1276787,6159663,433715,365031,2019740,315834,684169,7349735,288239,389088,97126,17380425,3882203,1605721,275981,20416199,193584,508727,1526035,2821930],"fans":787311,"friend":51,"attention":51,"sign":"weibo.com/573244552","level_info":{"current_level":6,"current_min":28800,"current_exp":683814,"next_exp":"-"},"pendant":{"pid":0,"name":"","image":"","expire":0},"nameplate":{"nid":1,"name":"\u9ec4\u91d1\u6bbf\u5802","image":"http://i1.hdslb.com/bfs/face/82896ff40fcb4e7c7259cb98056975830cb55695.png","image_small":"http://i1.hdslb.com/bfs/face/627e342851dfda6fe7380c2fa0cbd7fae2e61533.png","level":"\u7a00\u6709\u52cb\u7ae0","condition":"\u5355\u4e2a\u81ea\u5236\u89c6\u9891\u603b\u64ad\u653e\u6570>=100\u4e07"},"toutu":"group1/M00/F8/78/oYYBAFalncSAEKmvAABOHh0VmYQ216.jpg","theme":"default","theme_preview":"","im9_sign":"84f3315e94daa8fd4a32a774e570c608","playNum":97019723}}
编码为Unicode编码方式
json包含信息:
{
"status": true,
"data": {
"place": "",
"spacesta": 0,
"nameplate": {
"image_small": "http://i1.hdslb.com/bfs/face/627e342851dfda6fe7380c2fa0cbd7fae2e61533.png",
"level": "稀有勋章",
"image": "http://i1.hdslb.com/bfs/face/82896ff40fcb4e7c7259cb98056975830cb55695.png",
"nid": 1,
"name": "黄金殿堂",
"condition": "单个自制视频总播放数>=100万"
},
"im9_sign": "96e2e2e72b8db3411c157d1001f8e948",
"friend": 51,
"toutu": "group1/M00/F8/78/oYYBAFalncSAEKmvAABOHh0VmYQ216.jpg",
"pendant": {
"name": "",
"expire": 0,
"pid": 0,
"image": ""
},
"attentions": [
43536,
244842,
88358,
569636,
420876,
201434,
673816,
374377,
100691,
920713,
397435,
35680,
375375,
12994,
891124,
15810,
379803,
33696,
585267,
12018,
168598,
356776,
1344144,
1734728,
295641,
2276820,
145716,
3307964,
2825112,
546195,
104884,
1276787,
6159663,
433715,
365031,
2019740,
315834,
684169,
7349735,
288239,
389088,
97126,
17380425,
3882203,
1605721,
275981,
20416199,
193584,
508727,
1526035,
2821930
],
"name": "怕上火暴王老菊",
"coins": 0,
"face": "http://i1.hdslb.com/bfs/face/b55e96895608e03c3435d018b708a705ccc2bda4.gif",
"theme": "default",
"fans": 789300,
"article": 0,
"regtime": 1339205465,
"approve": false,
"rank": "10000",
"theme_preview": "",
"birthday": "1949-03-22",
"playNum": 97095510,
"sex": "保密",
"attention": 51,
"mid": "423895",
"description": "",
"DisplayRank": "1043",
"level_info": {
"current_level": 6,
"current_exp": 685387,
"next_exp": "-",
"current_min": 28800
},
"sign": "weibo.com/573244552"
}
}
个人空间:http://space.bilibili.com/0/#!/index
登录状态下mid为0时会跳转到当前用户的个人空间
非登录状态下会转到登录界面
找到了一只站长,bishi(bilibili创始人)
站长大人独占了两个号
mid=1
mid=2