[tenor] fix 'title' metadata

remove the trailing 4 characters only when they are ' GIF'
This commit is contained in:
Mike Fährmann
2025-12-16 10:15:46 +01:00
parent 3536816d51
commit 7804f70f02
2 changed files with 67 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ __tests__ = (
"embed" : r"re:<div class=.+",
"extension": "gif",
"filename" : "moving",
"h1_title" : "Moving Sticker",
"!h1_title": "Moving Sticker",
"hasaudio" : False,
"format" : "gif",
"width" : 467,
@@ -34,9 +34,9 @@ __tests__ = (
"long_title": "Moving Sticker - Moving Stickers",
"media_formats": dict,
"policy_status": "POLICY_STATUS_UNSPECIFIED",
"shares" : range(40000, 60000),
"shares" : range(70_000, 200_000),
"source_id": "",
"title" : "Moving Sti",
"title" : "Moving Sticker",
"url" : "https://tenor.com/kjYh53rdMGt.gif",
"flags" : [
"static",
@@ -94,6 +94,66 @@ __tests__ = (
"#class": tenor.TenorImageExtractor,
},
{
"#url" : "https://tenor.com/view/dance-dancing-rhythm-music-party-gif-10174070686436479501",
"#class" : tenor.TenorImageExtractor,
"#results" : "https://media1.tenor.com/m/jTGPYoDC0g0AAAAC/dance-dancing.gif",
"bg_color" : "",
"created" : 1761968378.53755,
"date" : "dt:2025-11-01 03:39:38",
"description" : "a blue and white penguin with the word pengu written below it",
"duration" : 1.4,
"embed" : """<div class="tenor-gif-embed" data-postid="10174070686436479501" data-share-method="host" data-aspect-ratio="1" data-width="100%"><a href="https://tenor.com/view/dance-dancing-rhythm-music-party-gif-10174070686436479501">Dance Dancing Sticker</a>from <a href="https://tenor.com/search/dance-stickers">Dance Stickers</a></div> <script type="text/javascript" async src="https://tenor.com/embed.js"></script>""",
"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,