From 92aa9388fea57cfd7152241853785a38bdb002db Mon Sep 17 00:00:00 2001 From: Vincent Cloutier Date: Fri, 13 May 2022 18:58:31 -0400 Subject: [PATCH] fix getTweet 3 --- src/BirdsiteLive.Twitter/TwitterTweetsService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/BirdsiteLive.Twitter/TwitterTweetsService.cs b/src/BirdsiteLive.Twitter/TwitterTweetsService.cs index 0a74296..e0eb3d3 100644 --- a/src/BirdsiteLive.Twitter/TwitterTweetsService.cs +++ b/src/BirdsiteLive.Twitter/TwitterTweetsService.cs @@ -172,8 +172,12 @@ namespace BirdsiteLive.Twitter foreach (JsonElement m in attachments.GetProperty("media_keys").EnumerateArray()) { var mediaInfo = media.EnumerateArray().Where(x => x.GetProperty("media_key").GetString() == m.GetString()).First(); - var url = mediaInfo.GetProperty("url").GetString(); var mediaType = mediaInfo.GetProperty("type").GetString(); + if (mediaType != "photo") + { + continue; + } + var url = mediaInfo.GetProperty("url").GetString(); extractedMedia.Append( new ExtractedMedia {