diff --git a/gallery_dl/extractor/tenor.py b/gallery_dl/extractor/tenor.py index c3e4276c..3e4bab08 100644 --- a/gallery_dl/extractor/tenor.py +++ b/gallery_dl/extractor/tenor.py @@ -40,13 +40,14 @@ class TenorExtractor(Extractor): continue url = fmt["url"] + title = gif.pop("h1_title", "") + gif["title"] = title[:-4] if title.endswith(" GIF") else title + gif["width"], gif["height"] = fmt.pop("dims") or (0, 0) + gif["description"] = gif.pop("content_description", "") gif["id_format"] = url.rsplit("/", 2)[1] gif["format"] = fmt["name"] - gif["width"], gif["height"] = fmt["dims"] gif["duration"] = fmt["duration"] gif["size"] = fmt["size"] - gif["title"] = gif["h1_title"][:-4] - gif["description"] = gif.pop("content_description", "") gif["date"] = self.parse_timestamp(gif["created"]) yield Message.Directory, "", gif diff --git a/test/results/tenor.py b/test/results/tenor.py index c002c2a6..7f00ce13 100644 --- a/test/results/tenor.py +++ b/test/results/tenor.py @@ -20,7 +20,7 @@ __tests__ = ( "embed" : r"re:
Dance Dancing Stickerfrom Dance Stickers
""", + "extension" : "gif", + "filename" : "dance-dancing", + "flags" : ["sticker"], + "format" : "gif", + "hasaudio" : False, + "height" : 498, + "id" : "10174070686436479501", + "id_format" : "jTGPYoDC0g0AAAAC", + "index" : 0, + "itemurl" : "https://tenor.com/view/dance-dancing-rhythm-music-party-gif-10174070686436479501", + "legacy_info" : {"post_id": "0"}, + "long_title" : "Dance Dancing Sticker - Dance Dancing Rhythm Stickers", + "policy_status": "POLICY_STATUS_UNSPECIFIED", + "shares" : range(20_000, 200_000), + "size" : 379845, + "source_id" : "", + "title" : "Dance Dancing Sticker", + "url" : "https://tenor.com/mhJvX13UBsL.gif", + "width" : 498, + "media_formats": dict, + "tags" : [ + "dance", + "dancing", + "rhythm", + "music", + "party", + "happy", + "meme", + "funny", + "dancer", + "cute", + "excited", + "pengu", + "pudgy", + "penguin", + "pudgypenguins", + ], + "user" : { + "flags" : ["partner"], + "partnername" : "Pudgy Penguins", + "profile_id" : "7220590138123212970", + "tagline" : "Pudgy Penguins supplying the internet with good vibes", + "url" : "https://tenor.com/official/PudgyPenguins", + "userid" : "12680456", + "username" : "PudgyPenguins", + "usertype" : "partner", + }, +}, + { "#url" : "https://tenor.com/search/trees-gifs", "#class" : tenor.TenorSearchExtractor,