iqiyi changes encrypt key

This commit is contained in:
jackyzy823 2015-05-12 22:58:17 +08:00
parent e22fb5269d
commit 87868db444

View File

@ -9,6 +9,15 @@ import json
from math import floor
import hashlib
'''
Changelog:
-> http://www.iqiyi.com/common/flashplayer/20150506/MainPlayer_5_2_21_c3_2_6_1.swf
In this version iqiyi player, it changes enc key from 'ts56gh' to 'aw6UWGtp'
'''
'''
com.qiyi.player.core.model.def.DefinitonEnum
bid meaning for quality
@ -24,6 +33,9 @@ bid meaning for quality
'''
ENC_KEY = 'aw6UWGtp'
def getVRSXORCode(arg1,arg2):
loc3=arg2 %3
if loc3 == 1:
@ -53,7 +65,7 @@ def getVMS(tvid,vid,uid):
tm=randint(100,1000)
vmsreq='http://cache.video.qiyi.com/vms?key=fvip&src=1702633101b340d8917a69cf8a4b8c7' +\
"&tvId="+tvid+"&vid="+vid+"&vinfo=1&tm="+str(tm)+\
"&enc="+hashlib.new('md5',bytes('ts56gh'+str(tm)+tvid,"utf-8")).hexdigest()+\
"&enc="+hashlib.new('md5',bytes(ENC_KEY+str(tm)+tvid,"utf-8")).hexdigest()+\
"&qyid="+uid+"&tn="+str(random()) +"&um=0" +\
"&authkey="+hashlib.new('md5',bytes(''+str(tm)+tvid,'utf-8')).hexdigest()
return json.loads(get_content(vmsreq))
@ -76,6 +88,7 @@ def iqiyi_download(url, output_dir = '.', merge = True, info_only = False):
assert videoid
info = getVMS(tvid,videoid,gen_uid)
print(info)
assert info["code"] == "A000000"
title = info["data"]["vi"]["vn"]