Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

爱奇艺,视频解析出错 #19

Closed
mengmo opened this Issue Sep 25, 2016 · 22 comments

Comments

Projects
None yet
10 participants
@mengmo
Copy link
Collaborator

mengmo commented Sep 25, 2016

ykdl -i http://www.iqiyi.com/v_19rr9h0t5g.html
site:                爱奇艺 (Iqiyi)
title:               广告宣传片
artist:              None
streams:
    - format:        HD
      container:     mp4
      video-profile: 540p
      size:          0.0 MiB (0 bytes)
    # download-with: ykdl --format=HD [URL]
Real urls:
http://60.210.17.241/videos/other/20160811/87/7a/52990d1c3b72ab7191e39934ff67c3d9.mp4?key=0f348cd8944b99660c02b3c13fbe8e8ad&src=iqiyi.com&uuid=ca6c0ef0-57ac2095-7a
    - format:        SD
      container:     mp4
      video-profile: 360p
      size:          0.0 MiB (0 bytes)
    # download-with: ykdl --format=SD [URL]
Real urls:
http://60.210.17.241/videos/other/20160811/87/7a/52990d1c3b72ab7191e39934ff67c3d9.mp4?key=0f348cd8944b99660c02b3c13fbe8e8ad&src=iqiyi.com&uuid=ca6c0ef0-57ac2095-7a

我试了试,其他视频正常。只有这儿的会解析出来广告

@zhangn1985 zhangn1985 self-assigned this Sep 25, 2016

@zhangn1985

This comment has been minimized.

Copy link
Owner

zhangn1985 commented Sep 25, 2016

iqiyi修改了html5的算法,所以部分使用html5算法解析的视频失效了。

@zhangn1985

This comment has been minimized.

Copy link
Owner

zhangn1985 commented Oct 22, 2016

vmsreq= 'http://cache.m.iqiyi.com/jp/tmts/{}/{}/?uid=&cupid=qc_100001_100102&platForm=h5&qyid=ml69v09a2p7qkt20rt4a7xr4&agenttype=12&type=m3u8&rate=1&qdv=1&qdx=n&qds=0&__jsT=sijsc&t={}&src=02020031010000000000&vf={}&callback=tmtsCallback'.format(tvid, vid, '1477093995657', '7db2dbada11a2a6bd14cd577c62e76f6')

这个请求里面的vf算不出来。

@zhangn1985

This comment has been minimized.

Copy link
Owner

zhangn1985 commented Oct 22, 2016

vf的算法:
http://static.qiyi.com/js/html5/js/page/playMovie/c42f5e2c!app_movie.js

函数:

getTmtsVf: function (a, b, c) {
var d = window.cmd5xtmts ? window.cmd5xtmts()  : {
},
e = '02020031010000000000';
$.extend(c || {
}, d, {
src: e
});
var f = '/jp/tmts/' + a + '/' + b + '/?' + $.param(c) + '&callback=tmtsCallback';
return c.vf = window.cmd5x ? window.cmd5x(f)  : '',
c
},```
@junges521

This comment has been minimized.

Copy link

junges521 commented Nov 7, 2016

爱奇艺的直播解析怎么破,谁知道啊

@zhangn1985

This comment has been minimized.

Copy link
Owner

zhangn1985 commented Nov 7, 2016

爱奇艺也有直播呀?

@iwakaka

This comment has been minimized.

Copy link

iwakaka commented Jan 2, 2017

厉害了 我的歌,破解爱奇艺,搜到你这来了

@zhangn1985

This comment has been minimized.

Copy link
Owner

zhangn1985 commented Jan 2, 2017

只能播放部分爱奇艺视频。

@zhangn1985

This comment has been minimized.

@denobisipsis

This comment has been minimized.

Copy link

denobisipsis commented Jan 17, 2017

vf is cmd5x of

'/vms?key=fvip&src=01010031010010000000&tvId=542711800&vid=498ea80a002b233de6e46745b68aaf60&vinfo=1&tm=506&qyid=&puid=&authKey=882e904467c71b4ada72a3326116e6a7&um=0&pf=b6c13e26323c537d&thdk=&thdt=&rs=1&k_tag=1&qdv=2'

results in

d537d221543854ffdfbfcf1d5d1ace70

Trying the sample video http://www.iqiyi.com/v_19rr9h0t5g.html with normal cache call (needed proxy)

http://cache.video.qiyi.com/vms?key=fvip&src=01010031010010000000&tvId=542711800&vid=498ea80a002b233de6e46745b68aaf60&vinfo=1&tm=506&qyid=&puid=&authKey=882e904467c71b4ada72a3326116e6a7&um=0&pf=b6c13e26323c537d&thdk=&thdt=&rs=1&k_tag=1&qdv=2&vf=d537d221543854ffdfbfcf1d5d1ace70

try it with https://github.com/denobisipsis/adownloader/blob/master/iqiyi_vf_ibt.php

@ShekBoy

This comment has been minimized.

Copy link

ShekBoy commented Feb 4, 2017

请问楼上的方法能用吗,我看不懂怎么用23333

@zhangn1985

This comment has been minimized.

Copy link
Owner

zhangn1985 commented Feb 5, 2017

我也是看不懂。

@gooyie

This comment has been minimized.

Copy link

gooyie commented Feb 20, 2017

http://static.iqiyi.com/js/player_v1/pcweb.wonder.js 里的一个module里,eval执行一段解密后的字符串,这个解密后的字符串就是cmd5x的js。(c/c++写后用emscripten转成js的)

cmd5x使用方法:

白箱第1集	http://www.iqiyi.com/v_19rrn5fkjw.html

从浏览器开发工具抓的,vf是flash里的xcalc计算出来的:
http://cache.video.qiyi.com/vms?key=fvip&src=1702633101b340d8917a69cf8a4b8c7c&tvId=319095200&vid=7f3791481e31a308c43d2f129c584ded&vinfo=1&tm=2914&qyid=770dafb8792c04d211d071c7b847ba19&puid=&authKey=462d88235a4c21ffd6ac878806a7e660&um=0&pf=b6c13e26323c537d&thdk=&thdt=&rs=1&k_tag=1&qdv=2&vf=eb6ce7c7192ad9c1a4270505f1a730ef


把src替换成 01010031010010000000 ,用cmd5x计算出vf:
http://cache.video.qiyi.com/vms?key=fvip&src=01010031010010000000&tvId=319095200&vid=7f3791481e31a308c43d2f129c584ded&vinfo=1&tm=2914&qyid=770dafb8792c04d211d071c7b847ba19&puid=&authKey=462d88235a4c21ffd6ac878806a7e660&um=0&pf=b6c13e26323c537d&thdk=&thdt=&rs=1&k_tag=1&qdv=2&vf=e60e041d6f27fc5bc3b78f4ea4d339f8

iqiyi_vf_ibt.php是用 https://github.com/sstur/js2php 转成php的?

不知道能否用这个 https://github.com/PiotrDabkowski/Js2Py 把cmd5x js 转成python?

@denobisipsis

This comment has been minimized.

Copy link

denobisipsis commented Feb 20, 2017

@zhangn1985 @gooyie maybe you can try with this compiled

http://www.mediafire.com/file/7ri1b8arf87zyha/cm5xuacmd.exe

under windows. Run it with /vms string.

@zhangn1985

This comment has been minimized.

Copy link
Owner

zhangn1985 commented Feb 21, 2017

@denobisipsis @gooyie i will try

@gooyie

This comment has been minimized.

Copy link

gooyie commented Feb 21, 2017

@denobisipsis @zhangn1985
如果不能转成python,可以考虑下效仿爬虫用 https://github.com/doloopwhile/PyExecJS 执行js。

@mengmo

This comment has been minimized.

Copy link
Collaborator Author

mengmo commented Feb 21, 2017

@xyuanmu 可有兴趣看看?如有打扰,还请见谅。

@mengmo

This comment has been minimized.

Copy link
Collaborator Author

mengmo commented Mar 3, 2017

@zhangn1985
找到了一个能下载的
https://github.com/tuling56/Python/blob/master/Projects/down_video/iqiyi_video_download.py
基于 Python 2 写的,不知道能不能拿来参考

@zhangn1985

This comment has been minimized.

Copy link
Owner

zhangn1985 commented Mar 3, 2017

应该可以,看起来他的代码还蛮新的。

@zhangn1985 zhangn1985 closed this in 0bfd0a0 Mar 5, 2017

@xiayyu xiayyu referenced this issue Mar 23, 2017

Open

[iQIYI] Fix VIP support #9839

4 of 8 tasks complete
@Shadesss

This comment has been minimized.

Copy link

Shadesss commented May 16, 2017

This would be amazing!

@ssswang

This comment has been minimized.

Copy link

ssswang commented Jun 16, 2017

ykdl http://www.iqiyi.com/v_19rr6ywm1c.html --debug -i
DEBUG:common:video_host> www.iqiyi.com
DEBUG:common:short_name> iqiyi
DEBUG:html:get_content> URL: http://www.iqiyi.com/v_19rr6ywm1c.html
DEBUG:html:get_content> Charset: utf-8
DEBUG:html:get_content> URL: http://cache.video.qiyi.com/vps?tvid=693339900&vid=93ea0fe4d5b683fb667134e6f16ed9f6&v=0&qypid=693339900_12&src=01012001010000000000&t=1497574414730&k_tag=1&k_uid=bp4jru5xsvdeoobmaxtt2f1us5fc44uy&rs=1&vf=5bf7f4ddaffd9a19e6461c04af9daaf7
DEBUG:html:get_content> Charset: utf-8
DEBUG:html:get_content> URL: http://data.video.qiyi.com/videos/v0/20170614/02/c9/123768e895588b21a219b235ebf52703.f4v?qd_tvid=693339900&qd_vipres=2&qd_index=1&qd_aid=693339900&qd_stert=0&qd_scc=c4c53d23d69f855e82aa306337318afb&qd_sc=ae3f4aa48986d72dc8f6a7279fafa44b&qd_p=c4342605&qd_ip=c4342605&qd_k=5bf7f4ddaffd9a19e6461c04af9daaf7&qd_src=01012001010000000000&qd_vipdyn=2&qd_uid=0&qd_tm=1497574417236&qd_vip=0
Traceback (most recent call last):
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\Scripts\ykdl-script.py", line 11, in
load_entry_point('ykdl==1.4.11', 'console_scripts', 'ykdl')()
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\lib\site-packages\ykdl-1.4.11-py3.6.egg\cykdl_main_.py", line 149, in main
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\lib\site-packages\ykdl-1.4.11-py3.6.egg\ykdl\extractor.py", line 24, in parser
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\lib\site-packages\ykdl-1.4.11-py3.6.egg\ykdl\extractors\iqiyi.py", line 83, in prepare
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\lib\site-packages\ykdl-1.4.11-py3.6.egg\ykdl\util\html.py", line 65, in get_content
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\lib\urllib\request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\lib\urllib\request.py", line 532, in open
response = meth(req, response)
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\lib\urllib\request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\lib\urllib\request.py", line 570, in error
return self._call_chain(*args)
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "C:\Users\ssssssss\AppData\Local\Programs\Python\Python36-32\lib\urllib\request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 405: Not Allowed

@zhangn1985

This comment has been minimized.

Copy link
Owner

zhangn1985 commented Jun 16, 2017

VIP 应该是不支持的。

@rosynirvana

This comment has been minimized.

Copy link
Collaborator

rosynirvana commented Jun 16, 2017

爱奇艺电影的接口应该有点不一样

zhangn1985 added a commit that referenced this issue Apr 27, 2018

iqiyi: use new algorithm
old algo is from TV app, some of video can't download.
new algo is from:
https://github.com/tuling56/Python/blob/master/Projects/down_video/iqiyi_video_download.py

close #19

Signed-off-by: ykdl <zhangn1985@gmail.com>

zhangn1985 added a commit that referenced this issue Apr 27, 2018

iqiyi: use new algorithm
old algo is from TV app, some of video can't download.
new algo is from:
https://github.com/tuling56/Python/blob/master/Projects/down_video/iqiyi_video_download.py

close #19

Signed-off-by: ykdl <zhangn1985@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.