[tiktok] add 'avatar' option

This commit is contained in:
Mike Fährmann
2025-02-26 21:09:57 +01:00
parent 5e87aee32d
commit afde4ad343
3 changed files with 16 additions and 3 deletions

View File

@@ -25,9 +25,8 @@ class TiktokExtractor(Extractor):
def _init(self):
self.audio = self.config("audio", True)
self.videos = self.config("videos", True)
def avatar(self):
return ""
if not self.config("avatar", True):
self.avatar = util.false
def items(self):
# We assume that all of the URLs served by urls() come from the same
@@ -123,6 +122,9 @@ class TiktokExtractor(Extractor):
yield Message.Directory, avatar
yield Message.Url, avatar_url, avatar
def avatar(self):
return False
def _generate_avatar(self, avatar_url, data, user_name, user_id):
avatar = text.nameext_from_url(avatar_url, data.copy())
avatar.update({