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

Improve youku extraction #15092

Open
CoXier opened this issue Dec 27, 2017 · 2 comments
Open

Improve youku extraction #15092

CoXier opened this issue Dec 27, 2017 · 2 comments

Comments

@CoXier
Copy link
Contributor

@CoXier CoXier commented Dec 27, 2017

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.12.23. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.12.23

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Recently I am working on extraction for youku website for a week. I find there are two bugs in current extraction.

Yesterday I found a new api from Chrome when I visit youku.com. Here is the api : http://acs.youku.com/h5/mtop.youku.play.ups.appinfo.get/1.1/

I want to implement this algo but I failed (This is why I create this issue). I put my test code from Chrome here. I have remove redundant query params.

#!/usr/bin/python
# -*- coding: UTF-8 -*-

import re
import time
import random
import hashlib
import requests

data = '{' \
       '"steal_params":"{\"ccode\":\"0502\",\"client_ip\":\"192.168.1.1\",\"utid\":\"73KtEl7ZR0QCAdNFwkGIJtN9\",\"client_ts\":1514387235,\"ckey\":\"099#KAFEHYEKExdEIETLEEEEE6twSciqQ6NFSryoS6tqS9lMC6f3SXLEa6gTSc3on6fFN7FETcZdt91lE7EFL2xhGQoTEK5E8yKK/qYWcTZB95lWYsXWPyUt+O/kNar/roC6UQCSqedbToXHb2o+eK4HiRXhKscXvLnqUqSZ6wUWa4wsDRrsrAXcLylpHshnPvZcbfEVbix/iGCGDyXBrpls3rh4vKI084K1doc2vK+x3/ujzKI08eEwuuyiUT8xh9dwQo708gGyuasgZ1hxh0UwllJw8zGg4LslN2STE1LP/3iSlllP/cZddmJlluuWsyaA59llsLLP/3HjlllrSXZddmJlluQQOGFETrudt/B5CTSTEELP/3kmBYeC1W4TEHRE45amihKMnH4IcroWoD4fB0ANtkj2LEABiC8KfwwqL7SB9r5aMQGBB7GQPaffB7aqkhWKfwwqkqGB9r5a6V+I1DN7VmGt+IYRkmwgBwSq1VA3TGFETrZSt3illAdTEE7EERpC#82\"}",' \
       '"biz_params":"{\"vid\":\"XMTQ4ODQ3Mjc1Ng==\"}",' \
       '"ad_params":"{\"site\":1,\"wintype\":\"interior\",\"p\":1,\"fu\":0,\"vs\":\"1.0\",\"rst\":\"mp4\",\"dq\":\"hd2\",\"os\":\"mac\",\"osv\":\"\",\"d\":\"0\",\"bt\":\"pc\",\"aw\":\"w\",\"needbf\":1}"}'

param = {
    'appKey': '23536927',
    't': ts,
    'sign': '8311888fc9fee1814e8add4800c31ff3',
    'data': data
}
a = requests.get("http://acs.youku.com/h5/mtop.youku.play.ups.appinfo.get/1.1/", params=param)
print a.text

I received below result.

{"api":"mtop.youku.play.ups.appinfo.get","data":{},"ret":["FAIL_SYS_TOKEN_EMPTY::令牌为空"],"v":"1.1"}

Now I have two question.

  • First : how to cal sign .
  • Second: how to get ckey
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 27, 2017

This may be useful for sign: https://www.sslcvm.com/2017/12/07/68.html

And I remember the content of ckey is embedded in a Javascript file

@q228209
Copy link

@q228209 q228209 commented Jan 2, 2018

hello
http://v.youku.com/v_show/id_XMzIwNzAyMjQyNA==.html
this url can not download with ccode 0507 ,
please solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.