quvi: fix crashes on calls to quvi functions

When a function returns a char*, it is necessary to tell it to ctypes,
instead it returns an integer. On a 64 bits CPU, pointers can overflow the
integer, and result to an unvalid pointer given to c_char_p.
This commit is contained in:
Romain Bignon 2013-09-08 19:09:32 +02:00
commit d961459349
2 changed files with 8 additions and 3 deletions

View file

@ -103,6 +103,9 @@ class QuviVideo(BaseVideo):
if _id.startswith('http'):
return _id
if not '.' in _id:
raise UserError('Please give an ID in form WEBSITE.ID (for example youtube.BaW_jenozKc). Supported websites are: %s' % ', '.join(cls.BACKENDS.keys()))
sub_backend, sub_id = _id.split('.', 1)
try:
return cls.BACKENDS[sub_backend] % sub_id