vincelwt / RaspberryCast

:tv: Transform your Raspberry Pi into a streaming device. Videos can be sent from mobile devices or computers (Chrome extension).
MIT License
871 stars 138 forks source link

Unable to play video from Bilibili.com #68

Open jiahaoliang opened 6 years ago

jiahaoliang commented 6 years ago

RaspberryCast version: c2873f76848189d027e76cc77ae60c4377318573 youtube-dl version: 2018.06.18

I am able to download video via youtube-dl from bilibili, example:

# youtube-dl "https://www.bilibili.com/video/av12168252" [BiliBili] 12168252: Downloading webpage [BiliBili] 12168252: Downloading video info page [download] Downloading playlist: 【纪录片/空难】空中浩劫(共116集/中文字幕) [BiliBili] playlist 【纪录片/空难】空中浩劫(共116集/中文字幕): Collected 11 video ids (downloading 11 of them) [download] Downloading video 1 of 11 [download] Destination: 【纪录片_空难】空中浩劫(共116集_中文字幕)-12168252_part1.flv [download] 17.8% of 22.46MiB at 2.63MiB/s ETA 00:07

However I am unable to play the same link in raspberryCast. Logs:

06-19 21:21:28 - DEBUG - Received URL to cast: https://www.bilibili.com/video/av12168252 06-19 21:21:28 - DEBUG - Received URL to cast: https://www.bilibili.com/video/av12168252 06-19 21:21:28 - DEBUG - No subtitles for this stream 06-19 21:21:28 - INFO - Extracting source video URL... 06-19 21:21:28 - DEBUG - Parsing source url for https://www.bilibili.com/video/av12168252 with subs :False 06-19 21:21:28 - DEBUG - [BiliBili] 12168252: Downloading webpage 06-19 21:21:29 - DEBUG - [BiliBili] 12168252: Downloading video info page 06-19 21:21:29 - DEBUG - [download] Downloading playlist: 【纪录片/空难】空中浩劫(共116集/中文字幕) 06-19 21:21:29 - DEBUG - [BiliBili] playlist 【纪录片/空难】空中浩劫(共116集/中文字幕): Collected 11 video ids (downloading 11 of them) 06-19 21:21:29 - DEBUG - [download] Downloading video 1 of 11 06-19 21:21:29 - DEBUG - [download] Downloading video 2 of 11 06-19 21:21:29 - DEBUG - [download] Downloading video 3 of 11 06-19 21:21:29 - DEBUG - [download] Downloading video 4 of 11 06-19 21:21:29 - DEBUG - [download] Downloading video 5 of 11 06-19 21:21:29 - DEBUG - [download] Downloading video 6 of 11 06-19 21:21:29 - DEBUG - [download] Downloading video 7 of 11 06-19 21:21:29 - DEBUG - [download] Downloading video 8 of 11 06-19 21:21:29 - DEBUG - [download] Downloading video 9 of 11 06-19 21:21:29 - DEBUG - [download] Downloading video 10 of 11 06-19 21:21:29 - DEBUG - [download] Downloading video 11 of 11 06-19 21:21:29 - DEBUG - [download] Finished downloading playlist: 【纪录片/空难】空中浩劫(共116集/中文字幕) 06-19 21:21:29 - DEBUG - Video not from Youtube or Vimeo. Extracting url in maximal quality. 06-19 21:21:29 - DEBUG - Full video URL fetched. 06-19 21:21:29 - INFO - Starting OMXPlayer now. 06-19 21:21:29 - INFO - Attempting to read resolution from configuration file. 06-19 21:21:30 - INFO - Playlist empty, skipping.

After that OMXPlayer just exits with message "have a nice day".

I did some debugging and find the full URL youtube-dl provided was http://upos-hz-mirrorcos.acgvideo.com/upgcxcode/10/16/20061610/20061610-1-80.flv?um_deadline=1529475687&platform=pc&rate=221000&oi=1134627469&um_sign=261c9b3eb981eea6ea4ad952b6e39ef0&gen=playurl&os=cos&trid=b88d82ee9ec44b138374ebe0dac25b7e

And if I run wget for that url, it returns HTTP ERROR 453 (no description),

I believe there might be some trick youtube-dl uses to download the real video.

I am pretty familiar with python but quite a rookie on how youtube-dl and all these video streaming works.

Is there any insight or guideline you could kindly provide?

*Edit: typo