[tenor] support '/official/' user URLs (#6075)

This commit is contained in:
Mike Fährmann
2025-03-07 11:34:33 +01:00
parent 639ddc95e7
commit 8582af3483
2 changed files with 26 additions and 1 deletions

View File

@@ -140,7 +140,7 @@ class TenorSearchExtractor(TenorExtractor):
class TenorUserExtractor(TenorExtractor):
subcategory = "user"
directory_fmt = ("{category}", "@{user[username]}")
pattern = BASE_PATTERN + r"users/([^/?#]+)"
pattern = BASE_PATTERN + r"(?:users|official)/([^/?#]+)"
example = "https://tenor.com/users/USER"
def gifs(self):

View File

@@ -126,4 +126,29 @@ __tests__ = (
},
},
{
"#url" : "https://tenor.com/official/rwrbonprime",
"#class": tenor.TenorUserExtractor,
"#range": "1",
"user": {
"avatars" : dict,
"flags" : ["partner"],
"partnerbanner": dict,
"partnercategories": [],
"partnercta" : {
"text": "Learn More",
"url" : "https://www.amazon.com/dp/B0BYSWHGB9",
},
"partnerlinks" : list,
"partnername" : "Red, White & Royal Blue",
"profile_id" : "9116468280322048077",
"tagline" : "Love is about to get royally complicated",
"url" : "https://tenor.com/official/RWRBonPrime",
"userid" : "0",
"username" : "RWRBonPrime",
"usertype" : "partner",
},
},
)