mirror of
https://github.com/soimort/you-get.git
synced 2025-01-24 05:55:02 +03:00
[youku]cna hacks
This commit is contained in:
parent
1a3752781a
commit
525f052332
@ -23,10 +23,17 @@ def fetch_cna():
|
||||
if cookie.name == 'cna' and cookie.domain == '.youku.com':
|
||||
log.i('Found cna in imported cookies. Use it')
|
||||
return quote_cna(cookie.value)
|
||||
url = 'http://gm.mmstat.com/yt/ykcomment.play.commentInit?cna='
|
||||
url = 'http://log.mmstat.com/eg.js'
|
||||
req = urllib.request.urlopen(url)
|
||||
cna = req.info()['Set-Cookie'].split(';')[0].split('=')[1]
|
||||
return quote_cna(cna)
|
||||
headers = req.getheaders()
|
||||
for header in headers:
|
||||
if header[0].lower() == 'set-cookie':
|
||||
n_v = header[1].split(';')[0]
|
||||
name, value = n_v.split('=')
|
||||
if name == 'cna':
|
||||
return quote_cna(value)
|
||||
log.w('It seems that the client failed to fetch a cna cookie. Please load your own cookie if possible')
|
||||
return quote_cna('DOG4EdW4qzsCAbZyXbU+t7Jt')
|
||||
|
||||
def youku_ups(vid, ccode='0401'):
|
||||
url = 'https://ups.youku.com/ups/get.json?vid={}&ccode={}'.format(vid, ccode)
|
||||
|
Loading…
Reference in New Issue
Block a user