valkjsaaa / auto-bilibili-recorder

Automatically record, burn danmaku, and transcode Bilibili live streams
GNU General Public License v3.0
326 stars 40 forks source link

视频上传反复失败,提示:'视频上传失败' #19

Closed GNEFNEHCUIQ closed 1 year ago

GNEFNEHCUIQ commented 2 years ago

系统是Ubuntu16.04 LTS,腾讯云6Mbps带宽。

昨天下午(在其他人的房间)试录一小段能成功上传。但是在晚上录制一段长直播时,虽然能正常产生文件,也能发起上传,但是上传会失败。

失败案例的recorder_config.yaml跟成功案例的配置文件比只改了房间号,其他都是相同,以下是recorder_config.yaml

accounts:
  bot:                                     # 录播账号 ID 用来在房间里对应
    name: 哔咔兔の真爱粉                             # 录播账号的名字,可以用于模版
    # sessdata 和 bili_jct 获取见:https://bili.moyu.moe/#/get-credential
    sessdata: "xxx"                         # SESSDATA cookie
    bili_jct: "xxx"                         # bili_jct cookie
rooms:
  - id: 22150788                                   # 需要上传的直播间 ID,请填写完整号码,而不是短号,否则可能不会上传
    uploader: bot                           # 上传所应使用的账号 ID
    tags: "虚拟UP主,录播,Vtuber"              # 上传视频所使用的 tag
    channel_id: 21                               # 上传视频所用的分区 ID,参考:https://github.com/greats3an/bilibili-toolman#分区表
    title: 【哔咔兔】$yy年$mm月$dd日 $title         # 视频标题,可以使用模版
    source: "https://live.bilibili.com/22150788"      # 转载来源,建议填写直播间短号(如果有的话)链接
    description: >-                              # 视频描述,可以使用模版
      由 $uploader_name 录播脚本上传
      脚本来自 @熊卡录播bot

在失败案例中,系统能正常产生.flv文件、.ass文件、.srt文件,也能正常压制.mp4文件。但是上传时失败了三次,于是中止系统并排查。 文件大小上,22150788-20220402-200531-096.all.flv的大小为1.57GB,22150788-20220402-200531-096.all.bar.mp4的大小为4.33GB。 以下是docker logs auto-bilibili-recorder得到的部分内容:

{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 30, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 29, 'chunks': 162, 'start': 304087040, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 28, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 27, 'chunks': 162, 'start': 283115520, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 27, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 26, 'chunks': 162, 'start': 272629760, '
[Errno 32] Broken pipe
{'event': 'UPLOAD_CHUNK', 'ok': False, 'data': {'partNumber': 29, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 28, 'chunks': 162, 'start': 293601280,
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 26, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 25, 'chunks': 162, 'start': 262144000, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 49, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 48, 'chunks': 162, 'start': 503316480, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 24, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 23, 'chunks': 162, 'start': 241172480, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 25, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 24, 'chunks': 162, 'start': 251658240, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 43, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 42, 'chunks': 162, 'start': 440401920, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 22, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 21, 'chunks': 162, 'start': 220200960, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 23, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 22, 'chunks': 162, 'start': 230686720, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 19, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 18, 'chunks': 162, 'start': 188743680, '
error code: 502
{'event': 'UPLOAD_CHUNK', 'ok': False, 'data': {'partNumber': 21, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 20, 'chunks': 162, 'start': 209715200,
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 17, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 16, 'chunks': 162, 'start': 167772160, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 20, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 19, 'chunks': 162, 'start': 199229440, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 18, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 17, 'chunks': 162, 'start': 178257920, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 15, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 14, 'chunks': 162, 'start': 146800640, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 12, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 11, 'chunks': 162, 'start': 115343360, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 11, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 10, 'chunks': 162, 'start': 104857600, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 10, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 9, 'chunks': 162, 'start': 94371840, 'en
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 14, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 13, 'chunks': 162, 'start': 136314880, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 9, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 8, 'chunks': 162, 'start': 83886080, 'end
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 8, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 7, 'chunks': 162, 'start': 73400320, 'end
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 7, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 6, 'chunks': 162, 'start': 62914560, 'end
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 5, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 4, 'chunks': 162, 'start': 41943040, 'end
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 13, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 12, 'chunks': 162, 'start': 125829120, '
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 6, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 5, 'chunks': 162, 'start': 52428800, 'end
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 4, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 3, 'chunks': 162, 'start': 31457280, 'end
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 3, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 2, 'chunks': 162, 'start': 20971520, 'end
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 2, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 1, 'chunks': 162, 'start': 10485760, 'end
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 1, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 0, 'chunks': 162, 'start': 0, 'end': 1048
[Errno 32] Broken pipe
{'event': 'UPLOAD_CHUNK', 'ok': False, 'data': {'partNumber': 16, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 15, 'chunks': 162, 'start': 157286400,
[Errno 110] Connection timed out
{'event': 'UPLOAD_CHUNK', 'ok': False, 'data': {'partNumber': 33, 'uploadId': '37365392d2b94085d4377457b61747d5', 'chunk': 32, 'chunks': 162, 'start': 335544320,
{'event': 'VERIFY', 'ok': False, 'data': None}
Upload failed: 【哔咔兔】2022年04月02日 努力画画, retrying
Traceback (most recent call last):
  File "/webhook/record_upload_manager.py", line 68, in video_uploader
    bv_id = upload_task.upload(self.save.session_id_map)
  File "/webhook/upload_task.py", line 34, in upload
    filename = video_upload(self.video_path, verify=self.verify, on_progress=on_progress)
  File "/usr/local/lib/python3.8/dist-packages/bilibili_api/video.py", line 1367, in video_upload
    r = asyncio.get_event_loop().run_until_complete(main())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/dist-packages/bilibili_api/video.py", line 1365, in main
    raise exceptions.UploadException('视频上传失败')
bilibili_api.exceptions.UploadException: 视频上传失败

另外这几份文件也许有有用的信息 22150788-20220402-200531-096.all.video.log

bilirec20220402.txt

neko886 commented 2 years ago

B站上传最大文件不是不能超过4G吗

valkjsaaa commented 2 years ago

网页版是 8G

silite commented 2 years ago

我也遇到了同样的问题,您这边解决了嘛

neko886 commented 2 years ago

我也遇到了同样的问题,您的问题解决了

我也是..以为之前录制一小段可以用就成功了,结果长直播一直上传失败

valkjsaaa commented 2 years ago

修好啦。 pull 最新的 master 再试试 🥳