
clovanzo
By: a guest on Aug 26th, 2009 | syntax:
Bash | size: 1.43 KB | hits: 679 | expires: Never
if enable_google_cache:
if (host.find('.youtube.com') > -1 or host.find('.youtube.com') > -1 or re.compile('\.youtube\.[a-z][a-z]').search(host) or re.compile('^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$').match(host)) and (path.find('videoplayback') > -1 or path.find('videoplay') > -1 or path.find('get_video') > -1) and path.find('get_video_info') < 0:
type = 'YOUTUBE'
arglist = params.split('&')
dict = {}
for arg in arglist:
try:
dict[arg.split('=')[0]] = arg.split('=')[1]
except:
continue
if dict.has_key('video_id'):
video_id = dict['video_id']
elif dict.has_key('docid'):
video_id = dict['docid']
elif dict.has_key('id'):
video_id = dict['id']
else:
video_id = None
if video_id is not None:
new_url = submit_video(pid, client, type, url, video_id)
else:
log(format%(pid, client, '-', 'URL_ERROR', type, 'docid not found in ' + new_url))