[instagram:user] Truncate title to 80 characters (#5919)
authorYen Chi Hsuan <yan12125@gmail.com>
Sun, 7 Jun 2015 17:46:33 +0000 (01:46 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sun, 7 Jun 2015 17:46:33 +0000 (01:46 +0800)
This is a workaround. Currently YoutubeDL.process_info() truncates
info_dict['title'] to 200 characters, but the implementation can't
handle wide characters.

youtube_dl/extractor/instagram.py

index b92367a9d7ba6f708a8780d645336fb8cda37418..3d78f78c46d1ad004339bc33ebcb09d1286e5092 100644 (file)
@@ -3,7 +3,10 @@ from __future__ import unicode_literals
 import re
 
 from .common import InfoExtractor
-from ..utils import int_or_none
+from ..utils import (
+    int_or_none,
+    limit_length,
+)
 
 
 class InstagramIE(InfoExtractor):
@@ -106,7 +109,7 @@ class InstagramUserIE(InfoExtractor):
 
                 entries.append({
                     'id': it['id'],
-                    'title': title,
+                    'title': limit_length(title, 80),
                     'formats': formats,
                     'thumbnail': thumbnail,
                     'webpage_url': it.get('link'),