Stream API gives multiple media entities when multiple pictures are attached

extended-tweet

#1
{
  "created_at": "Sat Sep 24 04:47:04 +0000 2016",
  "id": 779542645110485000,
  "id_str": "779542645110484992",
  "text": "RT @13_11_26_: 고대 대숲 이 글 두개 못 본 사람은 없었으면 좋겠다 특히 남자분 필력 정말....마지막 문단 진짜 울컥했음. 특히 중간에 김칫국 마신다는 흔한 관용 표현을 어떻게 저렇게 표현하지 아 너무 좋다 두분 잘됐으면 좋겠어 htt…",
  "source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client</a>",
  "truncated": false,
  "in_reply_to_status_id": null,
  "in_reply_to_status_id_str": null,
  "in_reply_to_user_id": null,
  "in_reply_to_user_id_str": null,
  "in_reply_to_screen_name": null,
  "user": {
    "id": 174828497,
    "id_str": "174828497",
    "name": "카가미 사샤 로지라이트",
    "screen_name": "SaschaNaz",
    "location": "나조타마",
    "url": "http://saschanaz.wordpress.com/",
    "description": "마법소녀 마도카 마기카 @SaschaAkemi / IT @SaschaFlav / 아이마스 / 데레스테 / 마비노기 / 엘소드 / 클로저스 / TypeScript / Windows Insider / Windows Mobile / 짧은 인생 보고 싶지 않은 건 그때그때 언팔 합시다",
    "protected": false,
    "verified": false,
    "followers_count": 1224,
    "friends_count": 1002,
    "listed_count": 74,
    "favourites_count": 18331,
    "statuses_count": 390310,
    "created_at": "Wed Aug 04 22:56:27 +0000 2010",
    "utc_offset": 32400,
    "time_zone": "Seoul",
    "geo_enabled": true,
    "lang": "en",
    "contributors_enabled": false,
    "is_translator": false,
    "profile_background_color": "131516",
    "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/309950202/BlackRockShooter.jpg",
    "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/309950202/BlackRockShooter.jpg",
    "profile_background_tile": true,
    "profile_link_color": "E81C4F",
    "profile_sidebar_border_color": "FFFFFF",
    "profile_sidebar_fill_color": "EEC2FF",
    "profile_text_color": "333333",
    "profile_use_background_image": false,
    "profile_image_url": "http://pbs.twimg.com/profile_images/477887874549837824/xbTwK3Ns_normal.png",
    "profile_image_url_https": "https://pbs.twimg.com/profile_images/477887874549837824/xbTwK3Ns_normal.png",
    "profile_banner_url": "https://pbs.twimg.com/profile_banners/174828497/1348328149",
    "default_profile": false,
    "default_profile_image": false,
    "following": null,
    "follow_request_sent": null,
    "notifications": null
  },
  "geo": null,
  "coordinates": null,
  "place": null,
  "contributors": null,
  "retweeted_status": {
    "created_at": "Thu Sep 22 14:23:53 +0000 2016",
    "id": 778963030323236900,
    "id_str": "778963030323236868",
    "text": "고대 대숲 이 글 두개 못 본 사람은 없었으면 좋겠다 특히 남자분 필력 정말....마지막 문단 진짜 울컥했음. 특히 중간에 김칫국 마신다는 흔한 관용 표현을 어떻게 저렇게 표현하지 아 너무 좋다 두분 잘됐으… https://t.co/FbYHSqfuDE",
    "source": "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>",
    "truncated": true,
    "in_reply_to_status_id": null,
    "in_reply_to_status_id_str": null,
    "in_reply_to_user_id": null,
    "in_reply_to_user_id_str": null,
    "in_reply_to_screen_name": null,
    "user": {
      "id": 719523290872565700,
      "id_str": "719523290872565760",
      "name": ".",
      "screen_name": "13_11_26_",
      "location": null,
      "url": null,
      "description": null,
      "protected": false,
      "verified": false,
      "followers_count": 92,
      "friends_count": 64,
      "listed_count": 1,
      "favourites_count": 7,
      "statuses_count": 2836,
      "created_at": "Mon Apr 11 13:51:35 +0000 2016",
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": false,
      "lang": "ko",
      "contributors_enabled": false,
      "is_translator": false,
      "profile_background_color": "F5F8FA",
      "profile_background_image_url": "",
      "profile_background_image_url_https": "",
      "profile_background_tile": false,
      "profile_link_color": "2B7BB9",
      "profile_sidebar_border_color": "C0DEED",
      "profile_sidebar_fill_color": "DDEEF6",
      "profile_text_color": "333333",
      "profile_use_background_image": true,
      "profile_image_url": "http://pbs.twimg.com/profile_images/774300803834060800/0IefJMOa_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/774300803834060800/0IefJMOa_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/719523290872565760/1469844749",
      "default_profile": true,
      "default_profile_image": false,
      "following": null,
      "follow_request_sent": null,
      "notifications": null
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "extended_tweet": {
      "full_text": "고대 대숲 이 글 두개 못 본 사람은 없었으면 좋겠다 특히 남자분 필력 정말....마지막 문단 진짜 울컥했음. 특히 중간에 김칫국 마신다는 흔한 관용 표현을 어떻게 저렇게 표현하지 아 너무 좋다 두분 잘됐으면 좋겠어 https://t.co/kuWVNO6CoH",
      "display_text_range": [
        0,
        120
      ],
      "entities": {
        "hashtags": [],
        "urls": [],
        "user_mentions": [],
        "symbols": [],
        "media": [
          {
            "id": 778962984609591300,
            "id_str": "778962984609591297",
            "indices": [
              121,
              144
            ],
            "media_url": "http://pbs.twimg.com/media/Cs9utRbVMAE8OK3.jpg",
            "media_url_https": "https://pbs.twimg.com/media/Cs9utRbVMAE8OK3.jpg",
            "url": "https://t.co/kuWVNO6CoH",
            "display_url": "pic.twitter.com/kuWVNO6CoH",
            "expanded_url": "https://twitter.com/13_11_26_/status/778963030323236868/photo/1",
            "type": "photo",
            "sizes": {
              "large": {
                "w": 509,
                "h": 2048,
                "resize": "fit"
              },
              "medium": {
                "w": 298,
                "h": 1200,
                "resize": "fit"
              },
              "thumb": {
                "w": 150,
                "h": 150,
                "resize": "crop"
              },
              "small": {
                "w": 169,
                "h": 680,
                "resize": "fit"
              }
            }
          },
          {
            "id": 778963007028072400,
            "id_str": "778963007028072448",
            "indices": [
              121,
              144
            ],
            "media_url": "http://pbs.twimg.com/media/Cs9uuk8UEAAFgc4.jpg",
            "media_url_https": "https://pbs.twimg.com/media/Cs9uuk8UEAAFgc4.jpg",
            "url": "https://t.co/kuWVNO6CoH",
            "display_url": "pic.twitter.com/kuWVNO6CoH",
            "expanded_url": "https://twitter.com/13_11_26_/status/778963030323236868/photo/1",
            "type": "photo",
            "sizes": {
              "medium": {
                "w": 763,
                "h": 1200,
                "resize": "fit"
              },
              "large": {
                "w": 1080,
                "h": 1698,
                "resize": "fit"
              },
              "thumb": {
                "w": 150,
                "h": 150,
                "resize": "crop"
              },
              "small": {
                "w": 433,
                "h": 680,
                "resize": "fit"
              }
            }
          }
        ]
      }
    },
    "retweet_count": 8977,
    "favorite_count": 4125,
    "entities": {
      "hashtags": [],
      "urls": [
        {
          "url": "https://t.co/FbYHSqfuDE",
          "expanded_url": "https://twitter.com/i/web/status/778963030323236868",
          "display_url": "twitter.com/i/web/status/7…",
          "indices": [
            117,
            140
          ]
        }
      ],
      "user_mentions": [],
      "symbols": []
    },
    "favorited": false,
    "retweeted": false,
    "possibly_sensitive": false,
    "filter_level": "low",
    "lang": "ko"
  },
  "is_quote_status": false,
  "retweet_count": 0,
  "favorite_count": 0,
  "entities": {
    "hashtags": [],
    "urls": [],
    "user_mentions": [
      {
        "screen_name": "13_11_26_",
        "name": ".",
        "id": 719523290872565700,
        "id_str": "719523290872565760",
        "indices": [
          3,
          13
        ]
      }
    ],
    "symbols": []
  },
  "favorited": false,
  "retweeted": false,
  "filter_level": "low",
  "lang": "ko",
  "timestamp_ms": "1474692424453"
}

This data contains two same media entities of which indices are [121, 144]. Is this intended behavior? I’m not using display_text_range and waiting official implementation, so this makes my app show two duplicated URLs.

This only happens from Stream API, not REST API.


#2

Ah…

Never mind, REST API also returns two entities and I was just using normal entities rather than extended_entities.


#3