mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +03:00
[youku]api endpoint now checks referer
This commit is contained in:
parent
9b32634088
commit
6c0e4b7963
@ -35,13 +35,13 @@ def fetch_cna():
|
||||
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', password=None):
|
||||
def youku_ups(vid, ccode='0401', password=None, referer='http://v.youku.com'):
|
||||
url = 'https://ups.youku.com/ups/get.json?vid={}&ccode={}'.format(vid, ccode)
|
||||
url += '&client_ip=192.168.1.1'
|
||||
url += '&utid=' + fetch_cna()
|
||||
url += '&client_ts=' + str(int(time.time()))
|
||||
if password is not None: url += '&password=' + password
|
||||
return json.loads(get_content(url))
|
||||
return json.loads(get_content(url, headers=dict(Referer=referer)))
|
||||
|
||||
class Youku(VideoExtractor):
|
||||
name = "优酷 (Youku)"
|
||||
|
Loading…
Reference in New Issue
Block a user