summary refs log tree commit diff
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2017-07-11 16:05:15 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2017-07-11 16:05:15 +0800
commite8f20ffa032a791548a66bb7b694c424673537e6 (patch)
treeaddef2672ca2777faff3107fc22006f5d956565d
parent9be31e771cd9481ea690c01eed398645deadc1de (diff)
downloadyoutube-dl-e8f20ffa032a791548a66bb7b694c424673537e6.tar.gz
youtube-dl-e8f20ffa032a791548a66bb7b694c424673537e6.tar.xz
youtube-dl-e8f20ffa032a791548a66bb7b694c424673537e6.zip
[vine] Make sure the title won't be empty
And fix a relevant TwitterCard test case
-rw-r--r--ChangeLog1
-rw-r--r--youtube_dl/extractor/twitter.py1
-rw-r--r--youtube_dl/extractor/vine.py6
3 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e6451144..a5de3c232 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 version <unreleased>
 
 Extractors
+* [vine] Make sure the title won't be empty
 + [twitter] Support HLS streams in vmap URLs
 + [periscope] Support pscp.tv URLs in embedded frames
 * [niconico] Fix authentication error handling (#12486)
diff --git a/youtube_dl/extractor/twitter.py b/youtube_dl/extractor/twitter.py
index 89eabe77e..2ff55412b 100644
--- a/youtube_dl/extractor/twitter.py
+++ b/youtube_dl/extractor/twitter.py
@@ -91,6 +91,7 @@ class TwitterCardIE(TwitterBaseIE):
                 'uploader_id': '1189339351084113920',
                 'uploader': 'ArsenalTerje',
                 'title': 'Vine by ArsenalTerje',
+                'timestamp': 1447451307,
             },
             'add_ie': ['Vine'],
         }, {
diff --git a/youtube_dl/extractor/vine.py b/youtube_dl/extractor/vine.py
index 4957a07f7..46950d3a1 100644
--- a/youtube_dl/extractor/vine.py
+++ b/youtube_dl/extractor/vine.py
@@ -92,10 +92,12 @@ class VineIE(InfoExtractor):
 
         username = data.get('username')
 
+        alt_title = 'Vine by %s' % username if username else None
+
         return {
             'id': video_id,
-            'title': data.get('description'),
-            'alt_title': 'Vine by %s' % username if username else None,
+            'title': data.get('description') or alt_title or 'Vine video',
+            'alt_title': alt_title,
             'thumbnail': data.get('thumbnailUrl'),
             'timestamp': unified_timestamp(data.get('created')),
             'uploader': username,