question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bilibili Live Error] Unable to run on Linux server

See original GitHub issue

Plugin Issue

  • This is a plugin issue and I have read the contribution guidelines.

Description

There are always errors running on the Linux server, but there is nothing wrong with running on the PC side and on my raspberrypi 3B. I also checked the network connection and the python version and updated to the latest version. I also tried to install streamlink on different servers, but I got the same result.

Reproduction steps / Explicit stream URLs to test

  1. https://live.bilibili.com/13946381
  2. https://live.bilibili.com/631
  3. https://live.bilibili.com/4895312

Log output

streamlink https://live.bilibili.com/13946381 -o test.mp4
[cli][info] streamlink is running as root! Be careful!
[cli][info] Found matching plugin bilibili for URL live.bilibili.com/13946381
error: Unable to validate JSON: Unable to validate key 'data': {'current_quality': 0, 'accept_quality': None, 'current_qn': 0} does not equal None or Key 'durl' not found in {'current_quality': 0, 'accept_quality': None, 'current_qn': 0}

Additional comments, screenshots, etc.

Love Streamlink? Please consider supporting our collective. Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
See-Nightcommented, Nov 25, 2019

I tested the get request part of the plug-in and found that the server-side Response is different from the client-side Response when get requests API_URL. I tried to add headers, but the result hasn’t changed.

#plugins/bilibili.py
res = self.session.http.get(API_URL.format(room_id), headers=_headers_API)       <-here
room = self.session.http.json(res, schema=_room_stream_list_schema)

PC and raspberryPI Response:

{"code":0,"message":"0","ttl":1,"data":{"current_quality":4,"accept_quality":["4","3"],"current_qn":10000,"quality_description":[{"qn":10000,"desc":"原画"},{"qn":150,"desc":"高清"}],"durl":[{"url":"https://txy.live-play.acgvideo.com/live-txy/977137/live_1998535_9286339.flv?wsSecret=cf04cb0c568d78e6fc0e92b4d5857ee7\u0026wsTime=1574651712\u0026trid=b35b2a3172fe49a8976684bb3a814ef6\u0026pt=web\u0026oi=2031895901\u0026order=1\u0026sig=no","length":0,"order":1,"stream_type":0},{"url":"https://bvc.live-play.acgvideo.com/live-bvc/885573/live_1998535_9286339.flv?wsSecret=cd25e1e8cb8ffcdccc689a7ca7f21a8c\u0026wsTime=1574651712\u0026trid=b35b2a3172fe49a8976684bb3a814ef6\u0026pt=web\u0026oi=2031895901\u0026order=2\u0026sig=no","length":0,"order":1,"stream_type":0},{"url":"https://txy.live-play.acgvideo.com/live-txy/870240/live_1998535_9286339.flv?wsSecret=01a914bbe2bc48b3ef2f7f062b3e33f2\u0026wsTime=1574651712\u0026trid=b35b2a3172fe49a8976684bb3a814ef6\u0026pt=web\u0026oi=2031895901\u0026order=3\u0026sig=no","length":0,"order":1,"stream_type":0},{"url":"https://txy.live-play.acgvideo.com/live-txy/149797/live_1998535_9286339.flv?wsSecret=94e9a7f39194aecd7e5056d2f4fcb31f\u0026wsTime=1574651712\u0026trid=b35b2a3172fe49a8976684bb3a814ef6\u0026pt=web\u0026oi=2031895901\u0026order=4\u0026sig=no","length":0,"order":1,"stream_type":0}]}}

Ubuntu Server Response:

{"code":19001012,"message":"调用bvc-play-url-one出错","ttl":1,"data":{"current_quality":0,"accept_quality":null,"current_qn":0}}

it means Error calling bvc-play-url-one That could be the site’s own problem… But I still want to find a solution.

I’ve looked up a lot of information, but I still haven’t solved the problem.

0reactions
ilharpcommented, Dec 15, 2019

Not only linux server has this problem. –loglevel debug

C:\windows\system32>streamlink https://live.bilibili.com/21449083 best --loglevel debug
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.6.6
[cli][debug] Streamlink: 1.3.0
[cli][debug] Requests(2.22.0), Socks(1.7.1), Websocket(0.56.0)
[cli][info] Found matching plugin bilibili for URL https://live.bilibili.com/21449083
[cli][info] Available streams: source_alt, source_alt2, source (worst, best)
[cli][info] Opening stream: source (http)
[cli][error] Try 1/1: Could not open stream <HTTPStream('https://cn-zjnb-cmcc-live-01.bilivideo.com/live-bvc/237236/live_434565011_49442057.flv?cdn=cn-gotcha01&expires=1576378152&len=0&oi=3086357766&pt=web&qn=10000&trid=8763d73bfb364f0ca29c3912087e383d&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=c65b79bc0490e6ea783bb0f1ed1ece71&ptype=0')> (Could not open stream: Unable to open URL: https://cn-zjnb-cmcc-live-01.bilivideo.com/live-bvc/237236/live_434565011_49442057.flv?cdn=cn-gotcha01&expires=1576378152&len=0&oi=3086357766&pt=web&qn=10000&trid=8763d73bfb364f0ca29c3912087e383d&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=c65b79bc0490e6ea783bb0f1ed1ece71&ptype=0 (475 Client Error:  for url: https://cn-zjnb-cmcc-live-01.bilivideo.com/live-bvc/237236/live_434565011_49442057.flv?cdn=cn-gotcha01&expires=1576378152&len=0&oi=3086357766&pt=web&qn=10000&trid=8763d73bfb364f0ca29c3912087e383d&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=c65b79bc0490e6ea783bb0f1ed1ece71&ptype=0))
error: Could not open stream <HTTPStream('https://cn-zjnb-cmcc-live-01.bilivideo.com/live-bvc/237236/live_434565011_49442057.flv?cdn=cn-gotcha01&expires=1576378152&len=0&oi=3086357766&pt=web&qn=10000&trid=8763d73bfb364f0ca29c3912087e383d&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=c65b79bc0490e6ea783bb0f1ed1ece71&ptype=0')>, tried 1 times, exiting
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Unblock Bilibili Overseas Tried &Tested - Updated 2022
Wondering how to unblock Bilibili overseas? Use these simple steps and watch your desired content with these best Bilibili VPNs.
Read more >
292 Can fix the compatibility issue of the channel of bilibili?
[Translated by Google] Hello, when I tested on Linux lite (an Ubuntu derivative), the channel of mihoyo (channel=1 in config.ini) was working fine,...
Read more >
How to Watch Bilibili Outside China (The Easiest Way In 2022)
It's almost impossible to watch Bilibili outside China due to their many internet laws. With a VPN, all that is history. See how...
Read more >
How To Troubleshoot Common Site Issues on a Linux Server
Everybody runs into issues with their website at one point or another. This guide will help you troubleshoot some common issues and get...
Read more >
How To Watch Bilibili In UK In 2022? [Complete Updated]
ExpressVPN is our recommended choice. Download and install the VPN client app on your device. Run the VPN app and connect to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found