support videos on www.ina.fr (in addition to boutique.ina.fr)

This commit is contained in:
Romain Bignon 2011-08-12 15:39:33 +02:00
commit 30026290c8
4 changed files with 74 additions and 31 deletions

View file

@ -27,4 +27,10 @@ __all__ = ['InaVideo']
class InaVideo(BaseVideo):
@classmethod
def id2url(cls, _id):
return 'http://boutique.ina.fr/video/%s.html' % _id
if not '.' in _id:
return None
site, _id = _id.split('.', 1)
if site == 'boutique':
return 'http://boutique.ina.fr/video/%s.html' % _id
if site == 'www':
return 'http://www.ina.fr/%s.html' % _id