ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.41k stars 9.96k forks source link

[douyutv] unable to download video data #13419

Open stevencsc opened 7 years ago

stevencsc commented 7 years ago

[DouyuTV] : Downloading video URL info Traceback (most recent call last): File "main.py", line 19, in File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpkyaecyzu\build\youtube_dl__init__.py", line 465, in main File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpkyaecyzu\build\youtube_dl__init__.py", line 455, in _real_main File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpkyaecyzu\build\youtube_dl\YoutubeDL.py", line 1919, in download File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpkyaecyzu\build\youtube_dl\YoutubeDL.py", line 762, in extract_info File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpkyaecyzu\build\youtube_dl\extractor\common.py", line 433, in extract File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpkyaecyzu\build\youtube_dl\extractor\douyutv.py", line 106, in _real_extract TypeError: list indices must be integers, not str

unable to download the video from douyutv. I am using the latest version 2017.06.18

chacha1024 commented 7 years ago

It seems that douyu have used new api interface.

yan12125 commented 7 years ago

https://github.com/streamlink/streamlink/pull/1015 may help. I didn't test it by myself.

kira1928 commented 7 years ago

It seems that streamlink/streamlink#1015 using urls which can only work for less than 10 minutes, then the server will close the connection.

lbcake commented 7 years ago

可以试试 GO 语言, China 有些人 就是用go 语言写的 可以录。(现在的是用go语言写的 以前的是C#)

yan12125 commented 7 years ago

@lbcake Could you point out a link to the Douyu downloader in Go?

lbcake commented 7 years ago

U try this。链接: https://pan.baidu.com/s/1o8dVgNo 密码: snjt This Go language。 and i dislike go。

eg:https://www.douyu.com/206858

https://www.douyu.com/bianlive

huxuan commented 7 years ago

confirmed that streamlink should have solved the problem as @kira1928 mentioned above.

yan12125 commented 7 years ago

Thanks @lbcake. As a reference: https://github.com/Baozisoftware/luzhibo/blob/master/api/getters/douyu.go

yan12125 commented 7 years ago

Thanks @lbcake. As a reference: https://github.com/Baozisoftware/luzhibo/blob/master/api/getters/douyu.go

kira1928 commented 7 years ago

@rosynirvana proposed a way to fix the 10 minutes download limit of streamlink/streamlink#1015 in this commit. The communication detail about that commit can be found here.

Now I can download douyu live stream by rosynirvana/douyu_cli for a long enough time.

I think youtube-dl can port that fixed method.

yan12125 commented 7 years ago

Thanks for the hint. rosynirvana's version is from debugzxcv, which is in turn created by spacemeowx2 (https://github.com/spacemeowx2/DouyuHTML5Player). To port that code, we'll need to ask for explicit permission (change the upstream license or add an exception for youtube-dl) from spacemeowx2.

kira1928 commented 7 years ago

His whole project is based on debugzxcv, but I think rosynirvana made that exact commit which fixed the 10 minutes limitation. Any way, the license is a problem for youtube-dl. Is it possible to rewrite the logic to avoid license? (I'm totally new about license problem, if that's a bad idea, I'm sorry :p)

rosynirvana commented 7 years ago

First part of douyu's private cipher, dyprvt in douyu_cli or black box in DouyuHTML5Player is a modified version of md5. But the second part is much harder to figure out.

yan12125 commented 7 years ago

@kira1928: I know clean room reverse engineering is legal (someone writes down how Douyu extracts a video and another turns the flow into Python). I'm not sure about rewriting,

brlala commented 7 years ago

Hi, sorry for bringing up this post, are there any updates on this? Not able to download the offline video https://v.douyu.com/show/o8KxjMdxGNOMVLwb nor download any of the streams on douyu.com. Thank you

brlala commented 6 years ago
youtube-dl https://www.douyu.com/t/shengdian10m67373
[DouyuTV] shengdian10m67373: Downloading webpage
ERROR: Unable to extract room id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Got this error when downloading from douyu. Can you kindly look into this? Thank you

yan12125 commented 6 years ago

See: #14692

zizhengwu commented 6 years ago

Is there any progress on this? AFAIK, streamlink is able to stream Douyu properly.

jiahaoliang commented 6 years ago

Reraise this issue: youtube-dl https://www.douyu.com/timelessX [DouyuTV] timelessX: Downloading webpage [DouyuTV] timelessX: Downloading room info [DouyuTV] timelessX: Downloading video URL info Traceback (most recent call last): File "/usr/local/bin/youtube-dl", line 11, in sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/youtube_dl/init.py", line 472, in main _real_main(argv) File "/usr/local/lib/python2.7/dist-packages/youtube_dl/init.py", line 462, in _real_main retcode = ydl.download(all_urls) File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 2001, in download url, force_generic_extractor=self.params.get('force_generic_extractor', False)) File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 792, in extract_info ie_result = ie.extract(url) File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 500, in extract ie_result = self._real_extract(url) File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/douyutv.py", line 106, in _real_extract })['data']['live_url'] TypeError: list indices must be integers, not unicode

Confirmed on 2018.6.4

Apparently, streamlink is able to stream Douyu. # streamlink.exe https://www.douyu.com/timelessX source_http (Video plays...) # streamlink.exe --version streamlink-script.py 0.10.0