- 'url': 'http://www.iqiyi.com/v_19rrojlavg.html',
- 'md5': '2cb594dc2781e6c941a110d8f358118b',
- 'info_dict': {
- 'id': '9c1fb1b99d192b21c559e5a1a2cb3c73',
- 'title': '美国德州空中惊现奇异云团 酷似UFO',
- 'ext': 'f4v',
- }
+ 'url': 'http://www.iqiyi.com/v_19rrojlavg.html',
+ 'md5': '2cb594dc2781e6c941a110d8f358118b',
+ 'info_dict': {
+ 'id': '9c1fb1b99d192b21c559e5a1a2cb3c73',
+ 'title': '美国德州空中惊现奇异云团 酷似UFO',
+ 'ext': 'f4v',
+ }
- def construct_video_urls(self, data, video_id, _uuid, bid):
+ def construct_video_urls(self, data, video_id, _uuid):
mg = ')(*&^flash@#$%a'
tm = self._download_json(
'http://data.video.qiyi.com/t?tn=' + str(random.random()), video_id)['t']
mg = ')(*&^flash@#$%a'
tm = self._download_json(
'http://data.video.qiyi.com/t?tn=' + str(random.random()), video_id)['t']
- t = str(int(math.floor(int(tm)/(600.0))))
- return hashlib.md5(
- (t+mg+x).encode('utf8')).hexdigest()
-
- # get accept format
- # getting all format will spend minutes for a big video.
- if bid == 'best':
- bids = [int(i['bid']) for i in data['vp']['tkl'][0]['vs'] \
- if 0 < int(i['bid']) <= 10]
- bid = str(max(bids))
+ t = str(int(math.floor(int(tm) / (600.0))))
+ return hashlib.md5((t + mg + x).encode('utf8')).hexdigest()
}
return _dict.get(str(bid), None)
def get_bid(self, format_id):
_dict = {
}
return _dict.get(str(bid), None)
def get_bid(self, format_id):
_dict = {
webpage = self._download_webpage(
url, 'temp_id', note='download video page')
tvid = self._search_regex(
webpage = self._download_webpage(
url, 'temp_id', note='download video page')
tvid = self._search_regex(
- r'tvId ?= ?(\'|\")(?P<tvid>\d+)', webpage, 'tvid', flags=re.I, group='tvid')
+ r'data-player-tvid\s*=\s*[\'"](\d+)', webpage, 'tvid')
- r'videoId ?= ?(\'|\")(?P<video_id>[a-z\d]+)',
- webpage, 'video_id', flags=re.I, group='video_id')
+ r'data-player-videoid\s*=\s*[\'"]([a-f\d]+)', webpage, 'video_id')
_uuid = uuid.uuid4().hex
enc_key = self.get_enc_key(swf_url, video_id)
raw_data = self.get_raw_data(tvid, video_id, enc_key, _uuid)
_uuid = uuid.uuid4().hex
enc_key = self.get_enc_key(swf_url, video_id)
raw_data = self.get_raw_data(tvid, video_id, enc_key, _uuid)
# construct info
entries = []
for format_id in video_urls_dict:
video_urls = video_urls_dict[format_id]
for i, video_url_info in enumerate(video_urls):
# construct info
entries = []
for format_id in video_urls_dict:
video_urls = video_urls_dict[format_id]
for i, video_url_info in enumerate(video_urls):