- part_info = part_str.split('|')
-
- video_url = sanitize_url_path_consecutive_slashes(
- '%s%s?key=%s' % (part_info[0], su[i], part_info[3]))
+ # URLs starts with http://newflv.sohu.ccgslb.net/ is not usable
+ # so retry until got a working URL
+ video_url = 'newflv.sohu.ccgslb.net'
+ retries = 0
+ while 'newflv.sohu.ccgslb.net' in video_url and retries < 5:
+ download_note = 'Download information from CDN gateway for format ' + format_id
+ if retries > 0:
+ download_note += ' (retry #%d)' % retries
+ retries += 1
+ cdn_info = self._download_json(
+ 'http://data.vod.itc.cn/cdnList?new=' + data['su'][i],
+ video_id, download_note)
+ video_url = cdn_info['url']