Giter Club home page Giter Club logo

bilibili-api's People

Contributors

cnbeining avatar georgebillion avatar liuchang988 avatar vespa314 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bilibili-api's Issues

求一个发送高级弹幕的api

投两个硬币能发送高级弹幕,有大量的可调参数,但如果想用高级弹幕进行字幕制作等创作活动的话,一条条调整参数发送会非常痛苦,还会有发送频率限制,希望能提供一个发送高级弹幕的api

部分视频获取不到信息的解决

很简单,在getURLContent函数里面加上cookie的header就行了,cookie可以从浏览器复制,也可以通过登录页面获取,貌似cookie有部分参数是不用的,不过这个我没深入研究。
NEW#所以为什么不改代码233333

获取用户动态

路过
这里可以获取用户动态:http://api.bilibili.com/x/feed/pull?type=0&ps=5&pn=1
需要DedeUserIDSESSDATACookie,别的认证方式还不清楚
可以开jsonp:&jsonp=jsonp&callback=
(其实我想问的是,是否已阅是返回值的哪个)

文档里没看到这条,希望有帮助

获取直播间状态的API的地址是否有误?

见api.md

获取开通直播状态

  • URL:【返回json】
    • http://space.bilibili.com/ajax/live/getLive?
  • 输入:
    • mid:用户id
  • 返回格式:
    • status:true or false,是否开通直播
    • data:如果开通,为直播房间号

      API实现:

HasLiving(mid)

当前是否在直播

  • URL:【返回json】
    • http://space.bilibili.com/ajax/live/getLive?
  • 输入:
    • mid:用户id
  • 返回格式:
    • 第一层:data
      • 第二层:
        • url:地址
        • title:房间名
        • cover:封面

API实现:

IsLiving(mid)

这两个API的URL一样?
如果是的话第二个好像不会返回第二层,会返回和第一个API一样的内容= =
是我打开方式不对吗

完整的分区列表

tid name link parent
1 动画 http://www.bilibili.com/video/douga.html null
3 音乐 http://www.bilibili.com/video/music.html null
4 游戏 http://www.bilibili.com/video/game.html null
5 娱乐 http://www.bilibili.com/video/ent.html null
9 意见留言簿 http://www.bilibili.complus/guestbook.php null
11 电视剧 http://www.bilibili.com/video/teleplay.html null
12 公告 http://www.bilibili.com/list.php?tid= null
13 番剧 http://www.bilibili.com/video/bangumi.html null
15 连载剧集 http://www.bilibili.com/video/soap-three-1.html 11
16 flash游戏 http://www.bilibili.com/video/game-flash-1.html 116
17 单机联机 http://www.bilibili.com/video/game-video-1.html 116
18 游戏攻略·解说 http://www.bilibili.com/video/game-ctary-1.html 116
19 Mugen http://www.bilibili.com/video/game-mugen-1.html 116
20 ACG相关舞蹈 http://www.bilibili.com/video/dance-1.html 129
21 生活 http://www.bilibili.com/video/ent-life-1.html 5
22 三次元鬼畜 http://www.bilibili.com/video/ent-Kichiku-1.html 119
23 电影 http://www.bilibili.com/video/movie.html null
24 MAD·AMV http://www.bilibili.com/video/douga-mad-1.html 1
25 MMD·3D http://www.bilibili.com/video/douga-mmd-1.html 1
26 二次元鬼畜 http://www.bilibili.com/video/douga-kichiku-1.html 119
27 综合 http://www.bilibili.com/video/douga-else-1.html 1
28 同人音乐 http://www.bilibili.com/video/music-video-1.html 117
29 三次元音乐 http://www.bilibili.com/video/music-coordinate-1.html 117
30 VOCALOID·UTAU http://www.bilibili.com/video/music-vocaloid-1.html 117
31 翻唱 http://www.bilibili.com/video/music-Cover-1.html 117
32 完结动画 http://www.bilibili.com/video/part-twoelement-1.html 13
33 连载动画 http://www.bilibili.com/video/bangumi-two-1.html 13
34 完结剧集 http://www.bilibili.com/video/tv-drama-1.html 11
36 科技 http://www.bilibili.com/video/technology.html null
37 纪录片 http://www.bilibili.com/video/tech-popular-science-1.html 36
39 演讲•公开课 http://www.bilibili.com/video/speech-course-1.html 36
40 技术宅 http://www.bilibili.com/video/tech-otaku-1.html 122
41 暂置区 http://www.bilibili.comvideo/index.html 12
43 舞蹈MMD http://www.bilibili.com/video/mmd-dance-1.html 25
44 剧情MMD http://www.bilibili.com/video/mmd-story-1.html 25
45 原创模型 http://www.bilibili.com/video/mmd-original-1.html 25
46 其他 http://www.bilibili.com/video/index.html 25
47 动画短片 http://www.bilibili.com/video/douga-voice-1.html 1
48 原创动画 http://www.bilibili.com/video/douga-voice-original-1.html 47
49 ACG配音 http://www.bilibili.com/video/douga-voice-translate-1.html 27
50 手书 http://www.bilibili.com/video/douga-else-handwriting-1.html 27
51 资讯 http://www.bilibili.com/video/douga-else-information-1.html 13
52 动漫杂谈 http://www.bilibili.com/video/douga-else-tattle-1.html 27
53 其他 http://www.bilibili.com/video/douga-else-other-1.html 27
54 OP/ED/OST http://www.bilibili.com/video/music-oped-1.html 117
55 其他 http://www.bilibili.com/video/music-video-other-1.html 28
56 VOCALOID http://www.bilibili.com/video/music-vocaloid-vocaloid-1.html 30
57 UTAU http://www.bilibili.com/video/music-vocaloid-utau-1.html 30
58 VOCALOID中文曲 http://www.bilibili.com/video/music-vocaloid-chinese-1.html 30
59 演奏 http://www.bilibili.com/video/music-perform-1.html 117
60 电子竞技 http://www.bilibili.com/video/game-fight-1.html 116
61 预告资讯 http://www.bilibili.com/video/game-presentation-1.html 17
63 实况解说 http://www.bilibili.com/video/game-video-other-1.html 17
64 游戏杂谈 http://www.bilibili.com/video/game-ctary-standalone-1.html 17
65 网络游戏 http://www.bilibili.com/video/game-ctary-network-1.html 116
66 游戏集锦 http://www.bilibili.com/video/game-ctary-handheld-1.html 17
67 其他 http://www.bilibili.com/video/game-ctary-other-1.html 17
68 电竞赛事 http://www.bilibili.com/video/game-fight-matches-1.html 60
69 实况解说 http://www.bilibili.com/video/game-fight-explain-1.html 60
70 游戏集锦 http://www.bilibili.com/video/game-fight-other-1.html 60
71 综艺 http://www.bilibili.com/video/ent-variety-1.html 5
72 运动 http://www.bilibili.com/video/ent-sports-1.html 21
73 影视剪影 http://www.bilibili.com/video/ent-silhouette-1.html 128
74 日常 http://www.bilibili.com/video/ent-life-other-1.html 21
75 动物圈 http://www.bilibili.com/video/ent-animal-1.html 5
76 美食圈 http://www.bilibili.com/video/ent-food-1.html 5
77 喵星人 http://www.bilibili.com/video/ent-animal-cat-1.html 75
78 汪星人 http://www.bilibili.com/video/ent-animal-dog-1.html 75
79 其他 http://www.bilibili.com/video/ent-animal-other-1.html 75
80 美食视频 http://www.bilibili.com/video/ent-food-video-1.html 76
81 料理制作 http://www.bilibili.com/video/ent-food-course-1.html 76
82 电影相关 http://www.bilibili.com/video/movie-presentation-1.html 23
83 其他国家 http://www.bilibili.com/video/movie-movie-1.html 23
85 短片 http://www.bilibili.com/video/tv-micromovie-1.html 23
86 特摄·布袋 http://www.bilibili.com/video/tv-sfx-1.html 11
87 国产 http://www.bilibili.com/video/tv-drama-cn-1.html 34
88 日剧 http://www.bilibili.com/video/tv-drama-jp-1.html 34
89 美剧 http://www.bilibili.com/video/tv-drama-us-1.html 34
90 其他 http://www.bilibili.com/video/tv-drama-other-1.html 34
91 特摄 http://www.bilibili.com/video/tv-sfx-sfx-1.html 86
92 布袋戏 http://www.bilibili.com/video/tv-sfx-pili-1.html 86
94 剧场版 http://www.bilibili.com/video/bangumi-ova-1.html 32
95 数码 http://www.bilibili.com/video/tech-future-digital-1.html 36
96 军事 http://www.bilibili.com/video/tech-future-military-1.html 36
97 手机评测 http://www.bilibili.com/video/tech-future-mobile-1.html 95
98 机械 http://www.bilibili.com/video/tech-future-other-1.html 36
99 BBC纪录片 http://www.bilibili.com/video/tech-geo-bbc-1.html 37
100 探索频道 http://www.bilibili.com/video/tech-geo-discovery-1.html 37
101 国家地理 http://www.bilibili.com/video/tech-geo-national-1.html 37
102 NHK http://www.bilibili.com/video/tech-geo-nhk-1.html 37
103 演讲 http://www.bilibili.com/video/speech-1.html 39
104 公开课 http://www.bilibili.com/video/course-1.html 39
105 演示 http://www.bilibili.com/video/tech-geo-course-1.html 122
107 科技人文 http://www.bilibili.com/video/tech-humanity-1.html 124
108 趣味短片 http://www.bilibili.com/video/tech-funvideo-1.html 124
110 国产 http://www.bilibili.com/video/soap-three-cn-1.html 15
111 日剧 http://www.bilibili.com/video/soap-three-jp-1.html 15
112 美剧 http://www.bilibili.com/video/soap-three-us-1.html 15
113 其他 http://www.bilibili.com/video/soap-three-oth-1.html 15
114 国内综艺 http://www.bilibili.com/video/index.html 71
115 国外综艺 http://www.bilibili.com/video/index.html 71
116 游戏 http://www.bilibili.comvideo/index.html 12
117 音乐 http://www.bilibili.comvideo/index.html 12
118 其他 http://www.bilibili.comvideo/index.html 12
119 鬼畜 http://www.bilibili.com/video/kichiku.html null
120 剧场版 http://www.bilibili.com/video/newbangumi-ova-1.html 33
121 GMV http://www.bilibili.com/video/gmv-1.html 116
122 野生技术协会 http://www.bilibili.com/video/tech-wild-1.html 36
123 手办模型 http://www.bilibili.com/video/figure-1.html 122
124 趣味科普人文 http://www.bilibili.com/video/tech-fun-1.html 36
125 其他 http://www.bilibili.com/video/tech-geo-other-1.html 37
126 人力VOCALOID http://www.bilibili.com/video/kichiku-manual_vocaloid-1.html 119
127 教程演示 http://www.bilibili.com/video/kichiku-course-1.html 119
128 电视剧相关 http://www.bilibili.com/video/tv-presentation-1.html 11
129 舞蹈 http://www.bilibili.com/video/dance.html null
130 音乐选集 http://www.bilibili.com/video/music-collection-1.html 117
131 Korea相关 http://www.bilibili.com/video/ent-korea-1.html 5
132 Korea音乐舞蹈 http://www.bilibili.com/video/ent-korea-music-dance-1.html 131
133 Korea综艺 http://www.bilibili.com/video/ent-korea-variety-1.html 131
134 其他 http://www.bilibili.com/video/ent-korea-other-1.html 131
135 活动 http://www.bilibili.com/video/video/activities.html null
136 音游 http://www.bilibili.com/video/music-game-1.html 116
137 娱乐圈 http://www.bilibili.com/video/ent-circle-1.html 5
138 搞笑 http://www.bilibili.com/video/ent_funny_1.html 5
139 实况解说 http://www.bilibili.com/video/list__1.html 65
140 游戏杂谈 http://www.bilibili.com/video/list__1.html 65
141 游戏集锦 http://www.bilibili.com/video/list__1.html 65
142 漫展 http://www.bilibili.com/video/list__1.html 21
143 COSPLAY http://www.bilibili.com/video/list__1.html 21
144 综艺剪辑 http://www.bilibili.com/video/list__1.html 71
145 欧美电影 http://www.bilibili.com/video/movie_west_1.html 23
146 日本电影 http://www.bilibili.com/video/movie_japan_1.html 23
147 国产电影 http://www.bilibili.com/video/movie_chinese_1.html 23
148 TV动画 http://www.bilibili.com/video/list__1.html 33
149 OVA·OAD http://www.bilibili.com/video/list__1.html 33
150 TV动画 http://www.bilibili.com/video/list__1.html 32
151 OVA·OAD http://www.bilibili.com/video/list__1.html 32
152 官方延伸 http://www.bilibili.com/video/bagumi_offical_1.html 13
153 国产动画 http://www.bilibili.com/video/bangumi_chinese_1.html 13
154 三次元舞蹈 http://www.bilibili.com/video/three-dimension-dance-1.html 129

bilibili.py 获取评论失效

python首先给我报了个错告诉我bilibili.py 184行的ver未定义然后看了看api.md…………漏改了代码?
于是去掉了GetComment()的ver=ver,嗯,能用了(why?)
随后发现最新的视频并不能抓到评论数据
不严格的二分法发现avid=3280075之后的评论不能直接抓取
举例
http://api.bilibili.cn/feedback?aid=3280082 ← {"totalResult":0,"pages":0}
http://api.bilibili.cn/feedback?aid=3280082&ver=3 ← ver=3后能返回数据

然后往后试了下其他avid
http://api.bilibili.cn/feedback?aid=4232083 ← No
http://api.bilibili.cn/feedback?aid=4232083&ver=3 ← Yes

再往前试了下
http://api.bilibili.cn/feedback?aid=2053 ← Yes
http://api.bilibili.cn/feedback?aid=2053&ver=3 ← Yes

看来世界需要ver=3 (:3」∠)

另一个获取原始地址的办法

https://github.com/cnbeining/Biligrab/blob/master/biligrab.py#L265

然后跳到

https://github.com/cnbeining/Biligrab/blob/master/biligrab.py#L471

(是的,这个是Biligrab的本体。。。)

至于解析,

https://github.com/cnbeining/Biligrab/blob/master/biligrab.py#L157

我不厚道了。但是好使。

(如果你对于非API比较吃心,Flvxz有个漂亮的API。但是我觉得没有意义,就不弄了。)

这个适用于原始源是sina的,但是被二压备份的情况。可以保证更好的画质。

评论抓取中:IndexError: list index out of range

本来以为是评论的多少问题,但是试了很少的评论好像也有问题诶。

报错信息:
请输入要拽取评论视频的av号
8037147
Traceback (most recent call last):
File "/Users/XieHong/Google Drive/Python/Bili_Com_Grab/spitcomments.py", line 212, in
allComment = GetAllComment(videoaid)
File "/Users/XieHong/Google Drive/Python/Bili_Com_Grab/spitcomments.py", line 202, in GetAllComment
while cl.comments[len(cl.comments) - 1].lv == None:
IndexError: list index out of range

源代码在这里:

-- coding: utf-8 --

SPIT_LV = True
SPIT_NAME = False
SPIT_MID = True
SPIT_MSG = True

-- coding: utf-8 --

"""
Created on Mon May 26 23:59:09 2014

@author: Vespa
"""
import urllib2
import urllib
import re
import json
import zlib
import gzip
import xml.dom.minidom
import hashlib
import time
import sys
import os
import codecs
import workerpool

class User():
def init(self,m_mid=None,m_name=None):
if m_mid:
self.mid = m_mid
if m_name:
if isinstance(m_name,unicode):
m_name = m_name.encode('utf8')
self.name = m_name

获取空间地址

def GetSpace(self):
    return 'http://space.bilibili.tv/'+str(self.mid)
mid = None
name = None
isApprove = None#是否是认证账号
spaceName = None
sex = None
rank = None
avatar = None
follow = None#关注好友数目
fans = None#粉丝数目
article = None#投稿数
place = None#所在地
description = None#认证用户为认证信息 普通用户为交友宣言
followlist = None#关注的好友列表
friend = None
DisplayRank = None

class Comment():
def init(self):
self.post_user = User()
lv = None#楼层
fbid = None#评论id
msg = None
ad_check = None#状态 (0: 正常 1: UP主隐藏 2: 管理员删除 3: 因举报删除)
post_user = None

class CommentList():
def init(self):
pass
comments = None
commentLen = None
page = None

class JsonInfo():
def init(self,url):
self.info = json.loads(getURLContent(url))
while self.info.has_key('code') and self.info['code'] != 0:
time.sleep(0.01)
self.info = json.loads(getURLContent(url))
print 'Entered!'
if self.info.has_key('message'):
print "【Error】code=%d, msg=%s, url=%s"%(self.info['code'],self.Getvalue('message'),url)
elif self.info.has_key('error'):
print "【Error】code=%d, msg=%s, url=%s"%(self.info['code'],self.Getvalue('error'),url)
error = True
error = False
def Getvalue(self,*keys):
if len(keys) == 0:
return None
if self.info.has_key(keys[0]):
temp = self.info[keys[0]]
else:
return None
if len(keys) > 1:
for key in keys[1:]:
if temp.has_key(key):
temp = temp[key]
else:
return None
if isinstance(temp,unicode):
temp = temp.encode('utf8')
return temp
info = None
error = False

def getURLContent(url):
while True:
flag = 1
try:
headers = {'User-Agent':'Mozilla/5.0 (Windows U Windows NT 6.1 en-US rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'}
req = urllib2.Request(url = url,headers = headers)
content = urllib2.urlopen(req).read()
except:
flag = 0
if flag == 1:
break
return content

def GetString(t):
if type(t) == int:
return str(t)
return t

def GetComment(aid, page = None, pagesize = None, order = None):
"""
输入:
aid:AV号
page:页码
pagesize:单页返回的记录条数,最大不超过300,默认为10。
order:排序方式 默认按发布时间倒序 可选:good 按点赞人数排序 hot 按热门回复排序
返回:
评论列表
"""
url = 'http://api.bilibili.cn/feedback?aid='+GetString(aid)
if page:
url += '&page='+GetString(page)
if pagesize:
url += '&pagesize='+GetString(pagesize)
if order:
url += '&order='+GetString(order)
jsoninfo = JsonInfo(url)
commentList = CommentList()
commentList.comments = [Comment()] * pagesize
commentList.commentLen = jsoninfo.Getvalue('totalResult')
commentList.page = jsoninfo.Getvalue('pages')
idx = 0
while jsoninfo.Getvalue(str(idx)):
liuyan = Comment()
liuyan.lv = jsoninfo.Getvalue(str(idx),'lv')
liuyan.fbid = jsoninfo.Getvalue(str(idx),'fbid')
liuyan.msg = jsoninfo.Getvalue(str(idx),'msg')
liuyan.ad_check = jsoninfo.Getvalue(str(idx),'ad_check')
#liuyan.post_user = GetUserInfoBymid(jsoninfo.Getvalue(str(idx),'mid'))
liuyan.post_user.mid = jsoninfo.Getvalue(str(idx),'mid')
'''
liuyan.post_user.avatar = jsoninfo.Getvalue(str(idx),'face')
liuyan.post_user.rank = jsoninfo.Getvalue(str(idx),'rank')
liuyan.post_user.name = jsoninfo.Getvalue(str(idx),'nick')'''
commentList.comments[idx] = liuyan
idx += 1
return commentList

def GetAllComment(aid, order = None):
"""
获取一个视频全部评论,有可能需要多次爬取,所以会有较大耗时
输入:
aid:AV号
order:排序方式 默认按发布时间倒序 可选:good 按点赞人数排序 hot 按热门回复排序
返回:
评论列表
"""
MaxPageSize = 300
commentLists = [GetComment(aid = aid, page = 1, pagesize = MaxPageSize, order = order)]
totalPage = commentLists[0].page
directory = 'av' + str(aid) + 'Comments'
if not os.path.exists(directory):
os.makedirs(directory)
if totalPage > 1:
#urls = ['http://api.bilibili.cn/feedback?aid=' + str(aid) + '&page=' + str(p) + '&pagesize=' + str(MaxPageSize) for p in range(2, commentList.page + 1)]
# Make a pool
#pool = workerpool.WorkerPool(size = 10)
pool = workerpool.WorkerPool(size = totalPage - 1)
# Build our map parameters
#saveto = [directory + '/' + str(x) for x in range(2, commentList.page + 1)]
# Perform the mapping
#pool.map(urllib.urlretrieve, urls, saveto)
commentLists2 = pool.map(GetComment, [aid] * (totalPage - 1), range(2, totalPage + 1), [MaxPageSize] * (totalPage - 1))
# Send shutdown jobs to all threads, and wait until all the jobs have been completed
pool.shutdown()
pool.wait()
for cl in commentLists2:
commentLists.append(cl)
'''
commentList.comments += [Comment()] * (commentList.page - 1)
for p in range(2, commentList.page + 1):
commentPath = directory + '/' + str(p)
commentList.comments[(p - 1) * MaxPageSize :] = GetCommentLocal(commentPath, MaxPageSize).comments
os.remove(commentPath)
os.rmdir(directory)
#经测试发现,如果视频评论涨幅过快(av2816940)
#那么JSON第一层的totalResult和pages可能不准
#即使每抓一页都重新读取totalResult也无济于事
while commentList.comments[len(commentList.comments) - 1].lv == None:
commentList.comments.pop()
commentList.commentLen = len(commentList.comments)'''
for cl in commentLists:
while cl.comments[len(cl.comments) - 1].lv == None:
cl.comments.pop()
commentLists = sorted(commentLists, key = GetCommentListKey, reverse = True)
return commentLists
def GetCommentListKey(commentList):
return commentList.comments[0].lv
if name == "main":
print u'请输入要拽取评论视频的av号'
videoaid = input()
commentTxt = codecs.open('av' + str(videoaid) + 'comments.txt', encoding = 'utf-8', mode = 'w')
allComment = GetAllComment(videoaid)
x = 0
#commentTxtList = [u''] * len(allComment.comments)
tempStrListSize = SPIT_LV + SPIT_NAME + SPIT_MID
for cl in allComment:
for aComment in cl.comments:
#while x < len(allComment.comments):
#aComment = allComment.comments[x]
tempStrList = [u''] * tempStrListSize
tempStr = u''
i = 0
if SPIT_LV:
tempStrList[i] = unicode(str(aComment.lv)) + u'楼'
i += 1
if SPIT_NAME:
tempStrList[i] = u'昵称: ' + unicode(str(aComment.post_user.name))
i += 1
if SPIT_MID:
tempStrList[i] = u'UID: ' + unicode(str(aComment.post_user.mid))
i += 1
y = 0
if tempStrListSize == 1:
tempStr += tempStrList[0] + u'\n'
if tempStrListSize > 1:
while y < tempStrListSize - 1:
tempStr += tempStrList[y] + u'\t'
y += 1
tempStr += tempStrList[y] + u'\n'
if SPIT_MSG:
tempStr += aComment.msg.decode('utf8')
tempStr += u'\n'
commentTxt.write(tempStr)
commentTxt.close()

关于GetVideoUrl

Hi,

首先感谢作者做出如此出色的项目!

最近想把B站上的某部新番下到本地,刚好发现这个项目,貌似调用这个函数可以直接获取下载链接。

我试了下,确实成功了,下载链接是http://cn-zjcz7-dx.acgvideo.com/xxxx 这种形式的。现在有个小问题:我把链接直接复制到浏览器里下载是没有问题的,为什么在迅雷里下载会一直失败呢?我已经把迅雷设置为只从原始地址下载、单线程了啊。因为浏览器下载一直不太稳定,特来寻求帮助。

BR,

Drizzt

首页文档拼写错误

bilibili-vedio/:爬取B站所有视频信息【已完成,数据暂不公开】
//此处应为video

GetVideoUrl/biliDownLoad.py HTTP Error: 400

貌似 b 站姥爷知道了,修改了接口。

如下为报错提示。

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>D:\用户目录\Desktop\bilibiliUrlDownLoad.py http://www.bil
ibili.com/video/av4061686/
['appkey', 'id', 'page', 'type']
appkey=85eb6835b0a1034e&id=4061686&page=1&type=json&sign=64abb11c3ae20734d8d5f6e
c75ae85be
['appkey', 'cid', 'otype', 'quality', 'type']
appkey=85eb6835b0a1034e&cid=None&otype=json&quality=4&type=mp4&sign=ac49b3ee2239
625143ae70924121a357
Traceback (most recent call last):
  File "D:\用户目录\Desktop\bilibiliUrlDownLoad.py", line 76, in <module>
    media_urls = GetBilibiliUrl(sys.argv[1])
  File "D:\用户目录\Desktop\bilibiliUrlDownLoad.py", line 41, in GetBilibiliUrl
    resp_media = urlfetch(url_get_media+sign_1)
  File "D:\用户目录\Desktop\bilibiliUrlDownLoad.py", line 70, in urlfetch
    return urllib2.urlopen(req).read()
  File "D:\Program Files\Python27\lib\urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "D:\Program Files\Python27\lib\urllib2.py", line 437, in open
    response = meth(req, response)
  File "D:\Program Files\Python27\lib\urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "D:\Program Files\Python27\lib\urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "D:\Program Files\Python27\lib\urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "D:\Program Files\Python27\lib\urllib2.py", line 558, in http_error_defau
lt
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 400: Bad Request

C:\Users\Administrator>

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.