[facebook] Fix support for untitled videos (Fixes #3757)

This commit is contained in:
Philipp Hagemeister 2014-09-15 15:10:24 +02:00
parent b04c8f7358
commit a020a0dc20
3 changed files with 28 additions and 3 deletions

View file

@ -1571,3 +1571,13 @@ except AttributeError:
if ret:
raise subprocess.CalledProcessError(ret, p.args, output=output)
return output
def limit_length(s, length):
""" Add ellipses to overly long strings """
if s is None:
return None
ELLIPSES = '...'
if len(s) > length:
return s[:length - len(ELLIPSES)] + ELLIPSES
return s