# auto convert
tudou.com links to player by quasimo
def tudou(value):
videos = re.findall('(
http://www.tudou.com/programs/view/[a-zA-Z0-9\-\_\/]+)\s?', value)
if (len(videos) > 0):
for video in videos:
video_id = re.findall('
http://www.tudou.com/programs/view/([a-zA-Z0-9\-\_\/]+)', video)
value = value.replace('
http://www.tudou.com/programs/view/' + video_id[0], '<embed src="
http://www.tudou.com/v/' + video_id[0] + '/v.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="opaque" width="480" height="400"></embed>')
return value
else:
return value
register.filter(tudou)