Skip to content

Commit

Permalink
[twitter] add 'protected' metadata field (#5327)
Browse files Browse the repository at this point in the history
for 'author' and 'user'
  • Loading branch information
mikf committed Mar 13, 2024
1 parent dde822e commit 108abab
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions gallery_dl/extractor/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ def _transform_user(self, user):
"date" : text.parse_datetime(
uget("created_at"), "%a %b %d %H:%M:%S %z %Y"),
"verified" : uget("verified", False),
"protected" : uget("protected", False),
"profile_banner" : uget("profile_banner_url", ""),
"profile_image" : uget(
"profile_image_url_https", "").replace("_normal.", "."),
Expand Down
53 changes: 53 additions & 0 deletions test/results/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,59 @@
"#class" : twitter.TwitterTimelineExtractor,
"#range" : "1-40",
"#sha1_url": "c570ac1aae38ed1463be726cc46f31cac3d82a40",

"author": {
"date" : "dt:2015-01-12 10:25:22",
"description" : "The very best nature pictures.",
"favourites_count": int,
"followers_count" : int,
"friends_count" : int,
"listed_count" : int,
"media_count" : int,
"statuses_count" : int,
"id" : 2976459548,
"location" : "Earth",
"name" : "supernaturepics",
"nick" : "Nature Pictures",
"profile_banner" : "https://pbs.twimg.com/profile_banners/2976459548/1421058583",
"profile_image" : "https://pbs.twimg.com/profile_images/554585280938659841/FLVAlX18.jpeg",
"protected" : False,
"verified" : False,
},
"user": {
"date" : "dt:2015-01-12 10:25:22",
"description" : "The very best nature pictures.",
"favourites_count": int,
"followers_count" : int,
"friends_count" : int,
"listed_count" : int,
"media_count" : int,
"statuses_count" : int,
"id" : 2976459548,
"location" : "Earth",
"name" : "supernaturepics",
"nick" : "Nature Pictures",
"profile_banner" : "https://pbs.twimg.com/profile_banners/2976459548/1421058583",
"profile_image" : "https://pbs.twimg.com/profile_images/554585280938659841/FLVAlX18.jpeg",
"protected" : False,
"verified" : False,
},
"tweet_id" : range(400000000000000000, 800000000000000000),
"conversation_id": range(400000000000000000, 800000000000000000),
"quote_id" : 0,
"reply_id" : 0,
"retweet_id" : 0,
"count" : range(1, 4),
"num" : range(1, 4),
"favorite_count" : int,
"quote_count" : int,
"reply_count" : int,
"retweet_count" : int,
"content" : str,
"lang" : str,
"date" : "type:datetime",
"sensitive" : False,
"source" : "nature_pics",
},

{
Expand Down

0 comments on commit 108abab

Please sign in to comment.