return None if ID is not numeric

This commit is contained in:
Christophe Benz 2010-05-20 16:28:35 +02:00
commit 746e9fcbb7

View file

@ -29,4 +29,7 @@ class YoupornVideo(BaseVideo):
@classmethod
def id2url(cls, _id):
return 'http://www.youporn.com/watch/%d' % int(_id)
if _id.isdigit():
return 'http://www.youporn.com/watch/%d' % int(_id)
else:
return None