1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-12-17 22:55:42 +07:00

[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 @@ def subprocess_check_output(*args, **kwargs):
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