Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[twitter] log region blocked tweets/users #3864

Closed
nisehime opened this issue Apr 2, 2023 · 2 comments
Closed

[twitter] log region blocked tweets/users #3864

nisehime opened this issue Apr 2, 2023 · 2 comments

Comments

@nisehime
Copy link

nisehime commented Apr 2, 2023

Some users appear to be blocked in my country so their tweets don't show in timelines for me. At least I can see that they're blocked, but gallery-dl doesn't show this info to me. Can you make it to log blocked tweets and user please?

Blocked user JSON
{
  "data": {
  	"user": {
  		"result": {
  			"__typename": "User",
  			"id": "VXNlcjo4NjA0MDk0MjE0NTI2MzIwNjQ=",
  			"rest_id": "860409421452632064",
  			"affiliates_highlighted_label": {},
  			"has_graduated_access": true,
  			"is_blue_verified": false,
  			"legacy": {
  				"can_dm": true,
  				"can_media_tag": true,
  				"created_at": "Fri May 05 08:22:46 +0000 2017",
  				"default_profile": false,
  				"default_profile_image": false,
  				"description": "@buta_tsuzumi's account has been withheld in Russia in response to a legal demand. Learn more.",
  				"entities": {
  					"description": {
  						"urls": [
  							{
  								"display_url": "Learn more",
  								"expanded_url": "https://support.twitter.com/articles/20169222",
  								"url": "https://support.twitter.com/articles/20169222",
  								"indices": [
  									83,
  									93
  								]
  							}
  						]
  					}
  				},
  				"fast_followers_count": 0,
  				"favourites_count": 84659,
  				"followers_count": 161969,
  				"friends_count": 2360,
  				"has_custom_timelines": true,
  				"is_translator": false,
  				"listed_count": 1566,
  				"location": "",
  				"media_count": 1156,
  				"name": "",
  				"normal_followers_count": 161969,
  				"pinned_tweet_ids_str": [
  					"1595685080185573376"
  				],
  				"possibly_sensitive": true,
  				"profile_image_url_https": "",
  				"profile_interstitial_type": "sensitive_media",
  				"screen_name": "buta_tsuzumi",
  				"statuses_count": 86278,
  				"translator_type": "none",
  				"verified": false,
  				"want_retweets": false,
  				"withheld_in_countries": [
  					"RU"
  				],
  				"withheld_scope": "user"
  			},
  			"smart_blocked_by": false,
  			"smart_blocking": false,
  			"business_account": {},
  			"legacy_extended_profile": {},
  			"is_profile_translatable": false,
  			"verification_info": {}
  		}
  	}
  }
}
Blocked tweet JSON
				"__typename": "User",
				"timeline_v2": {
					"timeline": {
						"instructions": [
							{
								"type": "TimelineAddEntries",
								"entries": [
									{
										"entryId": "tweet-1642094442982301696",
										"sortIndex": "1642600939003052032",
										"content": {
											"entryType": "TimelineTimelineItem",
											"__typename": "TimelineTimelineItem",
											"itemContent": {
												"itemType": "TimelineTweet",
												"__typename": "TimelineTweet",
												"tweet_results": {
													"result": {
														"__typename": "Tweet",
														"rest_id": "1642094442982301696",
														"core": {
															"user_results": {
																"result": {
																	"__typename": "User",
																	"id": "VXNlcjo4NjA0MDk0MjE0NTI2MzIwNjQ=",
																	"rest_id": "860409421452632064",
																	"affiliates_highlighted_label": {},
																	"has_graduated_access": true,
																	"is_blue_verified": false,
																	"legacy": {
																		"can_dm": true,
																		"can_media_tag": true,
																		"created_at": "Fri May 05 08:22:46 +0000 2017",
																		"default_profile": false,
																		"default_profile_image": false,
																		"description": "@buta_tsuzumi's account has been withheld in Russia in response to a legal demand. Learn more.",
																		"entities": {
																			"description": {
																				"urls": [
																					{
																						"display_url": "Learn more",
																						"expanded_url": "https://support.twitter.com/articles/20169222",
																						"url": "https://support.twitter.com/articles/20169222",
																						"indices": [
																							83,
																							93
																						]
																					}
																				]
																			}
																		},
																		"fast_followers_count": 0,
																		"favourites_count": 84659,
																		"followers_count": 161969,
																		"friends_count": 2360,
																		"has_custom_timelines": true,
																		"is_translator": false,
																		"listed_count": 1566,
																		"location": "",
																		"media_count": 1156,
																		"name": "",
																		"normal_followers_count": 161969,
																		"pinned_tweet_ids_str": [
																			"1595685080185573376"
																		],
																		"possibly_sensitive": true,
																		"profile_image_url_https": "",
																		"profile_interstitial_type": "sensitive_media",
																		"screen_name": "buta_tsuzumi",
																		"statuses_count": 86278,
																		"translator_type": "none",
																		"verified": false,
																		"want_retweets": false,
																		"withheld_in_countries": [
																			"RU"
																		],
																		"withheld_scope": "user"
																	},
																	"business_account": {}
																}
															}
														},
														"unmention_data": {},
														"edit_control": {
															"edit_tweet_ids": [
																"1642094442982301696"
															],
															"editable_until_msecs": "1680342598000",
															"is_edit_eligible": true,
															"edits_remaining": "5"
														},
														"edit_perspective": {
															"favorited": false,
															"retweeted": false
														},
														"is_translatable": false,
														"views": {
															"count": "5474",
															"state": "EnabledWithCount"
														},
														"source": "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>",
														"legacy": {
															"bookmarked": false,
															"created_at": "Sat Apr 01 09:19:58 +0000 2023",
															"conversation_id_str": "1642094442982301696",
															"display_text_range": [
																0,
																94
															],
															"entities": {
																"user_mentions": [],
																"urls": [
																	{
																		"display_url": "Learn more",
																		"expanded_url": "https://support.twitter.com/articles/20169222",
																		"url": "https://support.twitter.com/articles/20169222",
																		"indices": [
																			83,
																			93
																		]
																	}
																],
																"hashtags": [],
																"symbols": []
															},
															"favorite_count": 18,
															"favorited": false,
															"full_text": "@buta_tsuzumi's account has been withheld in Russia in response to a legal demand. Learn more.",
															"is_quote_status": false,
															"lang": "ja",
															"possibly_sensitive": true,
															"possibly_sensitive_editable": false,
															"quote_count": 0,
															"reply_count": 1,
															"retweet_count": 0,
															"retweeted": false,
															"user_id_str": "860409421452632064",
															"withheld_scope": "user",
															"id_str": "1642094442982301696"
														}
													}
												},
												"tweetDisplayType": "Tweet"
											}
										}
									},

Don't forget retweets

@mikf
Copy link
Owner

mikf commented Apr 4, 2023

Should be implemented in dbe06cd, but I couldn't test this code on a real example so I tried it with your examples "spliced" in.

@nisehime
Copy link
Author

nisehime commented Apr 4, 2023

Thanks. So far it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants