[tiktok] add 'avatar' option
This commit is contained in:
@@ -4336,6 +4336,16 @@ Description
|
||||
Download videos using |ytdl|.
|
||||
|
||||
|
||||
extractor.tiktok.user.avatar
|
||||
----------------------------
|
||||
Type
|
||||
``bool``
|
||||
Default
|
||||
``true``
|
||||
Description
|
||||
Download user avatars.
|
||||
|
||||
|
||||
extractor.tiktok.user.module
|
||||
----------------------------
|
||||
Type
|
||||
|
||||
@@ -599,6 +599,7 @@
|
||||
"videos": true,
|
||||
|
||||
"user": {
|
||||
"avatar": true,
|
||||
"module": null,
|
||||
"tiktok-range": null
|
||||
}
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user