Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

可以解析出爱奇艺m3u8地址,但下载失败 #44

Closed
macdavis opened this issue Feb 4, 2018 · 8 comments · Fixed by #45 or #47
Closed

可以解析出爱奇艺m3u8地址,但下载失败 #44

macdavis opened this issue Feb 4, 2018 · 8 comments · Fixed by #45 or #47
Assignees
Labels
bug Something isn't working FFmpeg iqiyi

Comments

@macdavis
Copy link

macdavis commented Feb 4, 2018

lulu -d -o /Volumes/New\ Volume http://www.iqiyi.com/v_19rr7p0jss.html
[DEBUG] get_content: http://www.iqiyi.com/v_19rr7p0jss.html
[DEBUG] get_content: http://mixer.video.iqiyi.com/jp/mixin/videos/733048400
[DEBUG] get_content: http://www.iqiyi.com/v_19rr7p0jss.html
[DEBUG] get_content: http://cache.m.iqiyi.com/tmts/733048400/1e8c0a3d961aabd073d2d70d5380621e/?t=1517735288774&sc=b0b188768c2e5f6efa08c8dc96e8a871&src=76f90cbd92f94a2e925d83e8ccd22cb7
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --extra-cflags='-Ofast -march=native -m64 -finline-functions -funroll-loops -ffunction-sections -fdata-sections -ffp-contract=fast' --arch=x86_64 --cpu=haswell --disable-ffplay --disable-runtime-cpudetect --disable-debug --disable-opencl --disable-avdevice --enable-libfdk-aac --disable-doc --enable-hardcoded-tables
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
[http @ 0x7fe052e04d40] Stream ends prematurely at 363275, should be 18446744073709551615
Last message repeated 1 times
[hls,applehttp @ 0x7fe054800000] Opening 'http://dx.data.video.qiyi.com/videos/v0/20170818/7d/ba/b2c573a69eab68851ec51b59b93403df.dbts?qdv=1&qypid=733048400_04022000001000000000_14&start=0&end=582988&contentlength=582988&sd=1400&durr=6333&qd_uid=&qd_vip=0&qd_src=3_31_312&qd_tm=1517735387964&qd_ip=7bce0710&qd_p=7bce0710&qd_k=b0b188768c2e5f6efa08c8dc96e8a871&sgti=&qd_sc=ed1b75f4fc69fca0600ab3dc416c9076' for reading
Input #0, hls,applehttp, from 'http://cache.m.iqiyi.com/mus/733048400/1bd1e524c5475037f7fd66591c2bc862/afbe8fd3d73448c9//20170818/7d/ba/c78f50b8dc10b54e095484de956972fd.m3u8?qd_originate=tmts_py&tvid=733048400&bossStatus=0&qd_vip=0&px=&qd_src=3_31_312&prv=&previewType=&previewTime=&from=&qd_time=1517735380789&qd_p=7bce0710&qd_asc=0ca6a288c380db7b4679680673fea818&qypid=733048400_04022000001000000000_14&qd_k=b0b188768c2e5f6efa08c8dc96e8a871&isdol=1&code=2&qd_s=otv&vf=059eb205e6b7f4d85e134a4945514073&np_tag=nginx_part_tag':
Duration: 02:02:51.00, start: 1.400333, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 0
Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1280x536, 24 fps, 24 tbr, 90k tbn, 48 tbc
Metadata:
variant_bitrate : 0
Stream #0:1: Audio: eac3 ([135][0][0][0] / 0x0087), 48000 Hz, stereo, fltp, 96 kb/s
Metadata:
variant_bitrate : 0
[AVBSFContext @ 0x7fe052c21420] Codec 'eac3' (86057) is not supported by the bitstream filter 'aac_adtstoasc'. Supported codecs are: aac (86018)
Error initializing bitstream filter: aac_adtstoasc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Last message repeated 1 times
site: 爱奇艺 iqiyi.com
title: 悟空传
stream:
- format: TD
container: m3u8
video-profile: 720p
m3u8_url: http://cache.m.iqiyi.com/mus/733048400/1bd1e524c5475037f7fd66591c2bc862/afbe8fd3d73448c9//20170818/7d/ba/c78f50b8dc10b54e095484de956972fd.m3u8?qd_originate=tmts_py&tvid=733048400&bossStatus=0&qd_vip=0&px=&qd_src=3_31_312&prv=&previewType=&previewTime=&from=&qd_time=1517735380789&qd_p=7bce0710&qd_asc=0ca6a288c380db7b4679680673fea818&qypid=733048400_04022000001000000000_14&qd_k=b0b188768c2e5f6efa08c8dc96e8a871&isdol=1&code=2&qd_s=otv&vf=059eb205e6b7f4d85e134a4945514073&np_tag=nginx_part_tag
# download-with: lulu --format=TD [URL]
Downloading streaming content with FFmpeg, press q to stop recording...
ffmpeg -y -i http://cache.m.iqiyi.com/mus/733048400/1bd1e524c5475037f7fd66591c2bc862/afbe8fd3d73448c9//20170818/7d/ba/c78f50b8dc10b54e095484de956972fd.m3u8?qd_originate=tmts_py&tvid=733048400&bossStatus=0&qd_vip=0&px=&qd_src=3_31_312&prv=&previewType=&previewTime=&from=&qd_time=1517735380789&qd_p=7bce0710&qd_asc=0ca6a288c380db7b4679680673fea818&qypid=733048400_04022000001000000000_14&qd_k=b0b188768c2e5f6efa08c8dc96e8a871&isdol=1&code=2&qd_s=otv&vf=059eb205e6b7f4d85e134a4945514073&np_tag=nginx_part_tag -c copy -bsf:a aac_adtstoasc /Volumes/New Volume/悟空传.mp4

lulu虽然写了Downloading streaming content with FFmpeg, press q to stop recording...,但实际没有在下载,直接结束了进程。

解析出来的m3u8将近有1000片,而且貌似m3u8有时间等各种限制,比如同一个解析出来的m3u8不能同时用mpv播放/ffmpeg下载/livestreamer下载,否则就会失效。

使用livestreamer下载不多时就会遇到Failed to read data from stream: Read timeout
使用ffmpeg下载在00:06:07.97就会停滞不前。

@iawia002
Copy link
Owner

iawia002 commented Feb 4, 2018

hi @macdavis 更新一下 0.3.1,亲测有效,如果你还有问题的话 reopen 这个 issue

@macdavis
Copy link
Author

macdavis commented Feb 4, 2018

谢谢您的更新,确实可以调用ffmpeg了。可是速度慢的问题依旧没有解决。最严重的是ffmpeg到了00:06:07.97出出现大量类似

Non-monotonous DTS in output stream 0:0; previous: 33112564, current: 356220; changing to 33112565. This may result in incorrect timestamps in the output file.

的警告,最后timestamp似乎也有问题。不知您是否可以测试下载到00:06:07.97处及以后。

另外,不知是否可以做到自动从m3u8里获取片段下载地址并使用多线程下载,最后交由ffmpeg合并。这样效率可以提高很多。

@iawia002
Copy link
Owner

iawia002 commented Feb 5, 2018

爱奇艺的下载地址要特殊一些,它是全部交给 ffmpeg 来下载合并的,至于下载速度和警告的问题可以看看 ffmpeg 有没有什么参数可以增强。只要最后下载完成后的视频是正常的就行了。我试过一些小视频是完全没有问题的,完整的电影我倒是没试过

@iawia002
Copy link
Owner

iawia002 commented Feb 5, 2018

Non-monotonous DTS in output stream 0:0; previous: 33112564, current: 356220; changing to 33112565. This may result in incorrect timestamps in the output file.

这个可能是 ffmpeg 的问题或者我参数用错了,我先下载完来试一下视频文件有没有问题

@iawia002
Copy link
Owner

iawia002 commented Feb 5, 2018

@macdavis 更新一下 0.3.2,解决了出现大量警告的问题(爱奇艺的 m3u8 url 拿错了)

@macdavis
Copy link
Author

macdavis commented Feb 5, 2018

确实可以下载,感谢更新!

不过音频由之前的eac3变成了aac,比如这部:http://www.iqiyi.com/v_19rra8tjv0.html#vfrm=2-4-0-1,原先可以抓到5.1声道的eac3,现在只有2声道aac了。

@iawia002
Copy link
Owner

iawia002 commented Feb 5, 2018

你是说最开始的要报错的那个 url 是 eac3 的?那个 url 的文件确实哪里不对,它只有开头大概 6 分钟是正常的,以后都不对

@macdavis
Copy link
Author

macdavis commented Feb 5, 2018

是的,之前版本解析出720p的音轨是eac3,看ffmpeg 这里:
Stream #0:1: Audio: eac3 ([135][0][0][0] / 0x0087), 48000 Hz, stereo, fltp, 96 kb/s.

没记错的话,之前版本解析http://www.iqiyi.com/v_19rra8tjv0.html#vfrm=2-4-0-1得到的是256kbps的5.1声道eac3。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working FFmpeg iqiyi
Projects
None yet
2 participants