comwrg / bilibiliupload

This project is not maintained anymore.
MIT License
140 stars 35 forks source link

接口 504 然后程序崩溃了 #44

Closed kaidiren closed 4 years ago

kaidiren commented 4 years ago

Describe the bug A clear and concise description of what the bug is.

Your code

# Paste your code here.

Debug log If no any log print, please add

import logging
logging.basicConfig(level=logging.DEBUG)
# Paste debug log here.
DEBUG:bilibiliupload.bilibili:MULTIPART_PUT_SUCCESS
INFO:bilibiliupload.bilibili:upload part 127/128
DEBUG:urllib3.connectionpool:https://upos-sz-upcdnws.bilivideo.com:443 "POST /ugc/m191218ws3rkum7d70666viavehw9ngq.mp4?output=json&name=20191217_213500_%E4%BB%A5%E6%92%92%E7%9A%84%E7%BB%93%E5%90%88.mp4&profile=ugcupos%2Fyb&uploadId=523e2f7df95de1e7a5ac1c8f7ca3b6cf&biz_id=136372576 HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Resetting dropped connection: member.bilibili.com
DEBUG:urllib3.connectionpool:https://member.bilibili.com:443 "GET /preupload?os=upos&upcdn=ws&name=20191217_220244_%E4%BB%A5%E6%92%92%E7%9A%84%E7%BB%93%E5%90%88.mp4&size=1073529478&r=upos&profile=ugcupos%2Fyb&ssl=0 HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://upos-sz-upcdnws.bilivideo.com:443 "POST /ugc/m191218ws1sc257imrkqxs1xuymqmcyl.mp4?uploads&output=json HTTP/1.1" 504 2991
ERROR:root:Traceback (most recent call last):
  File "upload.py", line 88, in <module>
    b.upload(parts, title, tid, tag, desc, source='', cover='', no_reprint=1, dtime=dtime, open_elec=0)
  File "/usr/local/lib/python3.6/dist-packages/bilibiliupload/bilibili.py", line 256, in upload
    json = r.json()
  File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Video uploaded If possible please upload video to cloud disk and paste URL here.

Error message

# Paste error message here if has.

不知道怎么复现,日志是因为传的时候DEBUG模式一直开着的。

comwrg commented 4 years ago

更新包至最新版本,重新上传既可。不是经常出现的话,就不用管了。

kaidiren commented 4 years ago

不行唉,最新版本传了还是抱这个错。

kaidiren commented 4 years ago

又试了试可以了。貌似B站的服务有问题。(:з」∠)

kaidiren commented 4 years ago
DEBUG:urllib3.connectionpool:https://upos-sz-upcdnws.bilivideo.com:443 "PUT /ugc/m191219ws3u6acklayxtge2vc2uwfco2.mp4?partNumber=125       &uploadId=e2d4113e1a478278f93d63d22bfba7c1&chunk=124&chunks=128&size=8388608&start=1040187392&end=1048576000&total=1072673994 HTTP/1       .1" 200 None
708073 DEBUG:bilibiliupload.bilibili:MULTIPART_PUT_SUCCESS
708074 INFO:bilibiliupload.bilibili:upload part 124/128
708075 DEBUG:urllib3.connectionpool:https://upos-sz-upcdnws.bilivideo.com:443 "PUT /ugc/m191219ws3u6acklayxtge2vc2uwfco2.mp4?partNumber=126       &uploadId=e2d4113e1a478278f93d63d22bfba7c1&chunk=125&chunks=128&size=8388608&start=1048576000&end=1056964608&total=1072673994 HTTP/1       .1" 200 None
708076 DEBUG:bilibiliupload.bilibili:MULTIPART_PUT_SUCCESS
708077 INFO:bilibiliupload.bilibili:upload part 125/128
708078 DEBUG:urllib3.connectionpool:https://upos-sz-upcdnws.bilivideo.com:443 "PUT /ugc/m191219ws3u6acklayxtge2vc2uwfco2.mp4?partNumber=127       &uploadId=e2d4113e1a478278f93d63d22bfba7c1&chunk=126&chunks=128&size=8388608&start=1056964608&end=1065353216&total=1072673994 HTTP/1       .1" 200 None
708079 DEBUG:bilibiliupload.bilibili:MULTIPART_PUT_SUCCESS
708080 INFO:bilibiliupload.bilibili:upload part 126/128
708081 DEBUG:urllib3.connectionpool:https://upos-sz-upcdnws.bilivideo.com:443 "PUT /ugc/m191219ws3u6acklayxtge2vc2uwfco2.mp4?partNumber=128       &uploadId=e2d4113e1a478278f93d63d22bfba7c1&chunk=127&chunks=128&size=7320778&start=1065353216&end=1072673994&total=1072673994 HTTP/1       .1" 200 None
708082 DEBUG:bilibiliupload.bilibili:MULTIPART_PUT_SUCCESS
708083 INFO:bilibiliupload.bilibili:upload part 127/128
708084 DEBUG:urllib3.connectionpool:https://upos-sz-upcdnws.bilivideo.com:443 "POST /ugc/m191219ws3u6acklayxtge2vc2uwfco2.mp4?output=json&n       ame=20191218_164851_%E6%96%B0%E4%BA%BA%E7%89%A9%E6%96%B0%E5%9C%B0%E5%9B%BE%E6%96%B0%E9%81%93%E5%85%B7.mp4&profile=ugcupos%2Fyb&uploa       dId=e2d4113e1a478278f93d63d22bfba7c1&biz_id=136563901 HTTP/1.1" 200 None
708085 DEBUG:urllib3.connectionpool:Resetting dropped connection: member.bilibili.com
708086 DEBUG:urllib3.connectionpool:https://member.bilibili.com:443 "GET /preupload?os=upos&upcdn=ws&name=20191218_171625_%E6%96%B0%E4%BA%B       A%E7%89%A9%E6%96%B0%E5%9C%B0%E5%9B%BE%E6%96%B0%E9%81%93%E5%85%B7.mp4&size=1073524642&r=upos&profile=ugcupos%2Fyb&ssl=0 HTTP/1.1" 200        None
708087 DEBUG:urllib3.connectionpool:https://upos-sz-upcdnws.bilivideo.com:443 "POST /ugc/m191219ws2dyl2e0g37srd1bedn6yku6.mp4?uploads&outpu       t=json HTTP/1.1" 504 2991
708088 ERROR:root:Traceback (most recent call last):
708089   File "upload.py", line 88, in <module>
708090     b.upload(parts, title, tid, tag, desc, source='', cover='', no_reprint=1, dynamic='', dtime=dtime)
708091   File "/usr/local/lib/python3.6/dist-packages/bilibiliupload/bilibili.py", line 256, in upload
708092     json = r.json()
708093   File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 897, in json
708094     return complexjson.loads(self.text, **kwargs)
708095   File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
708096     return _default_decoder.decode(s)
708097   File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
708098     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
708099   File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
708100     raise JSONDecodeError("Expecting value", s, err.value) from None
708101 json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

又出现了。。。

comwrg commented 4 years ago

估计B站抽风,再次上传试试。

kaidiren commented 4 years ago

能把这个请求加入重试套餐么?上传量有点大每次10G左右,从头再开始要好久的说。(:з」∠)

kaidiren commented 4 years ago

今天早上又遇到一次。又得重新传了。(:з」∠)

comwrg commented 4 years ago

try v0.2.1.

kaidiren commented 4 years ago

thanks