Statuses/show doesn't return video content in entities neither extended_entities


#1

Hi there,

I just found some tweets that do have some video that I can see on twitter.com but when I look for statuses/show.json with its ID, I cannot find any reference to the video.

Here’s a few ID’s which you can test :
666575103908515840
666585575542026240

I’m really curious to any suggestion

Thanks in advance

Christophe


#3

Are yout using tweet_mode=extended on the API call?


#4

yes @andypiper I do


#5

@andypiper
this is the tweet url that i’m trying to fetch: https://twitter.com/Moh_d_alkhaldi/status/854316996930002945

and here is my Android code :
(I have my AccessToken abject that contains all correct AccessToken data of the user, also I called Twitter.initialize() in my MainActivity onCreate())

TwitterAuthToken token = new TwitterAuthToken (accessToken.getToken(), accessToken.getTokenSecret());
TwitterSession session = new TwitterSession(token, accessToken.getUserId(), accessToken.getScreenName());
TwitterApiClient client = TwitterCore.getInstance().getApiClient(session);
StatusesService statusesService = client.getStatusesService();
Call<Tweet> tweetCall = statusesService.show(Long.parseLong(params[0]), false, false, true);
Response<Tweet> response = tweetCall.execute();
TweetEntities entities = response.body().extendedEntities;
List<UrlEntity> urls = entities.urls;

I get NullPointerException in this line
List<UrlEntity> urls = entities.urls;
which means that entities is null

is there any error in my code?
thank you for your reply


#6

Using twurl, I took at look at that Tweet and it does not contain an extended_entities structure, just entities. Try changing

TweetEntities entities = response.body().extendedEntities;

to

TweetEntities entities = response.body().entities;


Can't get the media entities of some tweets even with tweet_mode=extended
#7

The media in 666575103908515840 and 666585575542026240 is an amplify video which we don’t support in Twitter Kit and will display as a url.

Looking at twurl results there are extended_entities for Tweet with ID 854316996930002945 but there are no urls.

$> twurl "/1.1/statuses/lookup.json?tweet_mode=extended&id=854316996930002945" | python -m json.tool
[
    {
        "contributors": null,
        "coordinates": null,
        "created_at": "Tue Apr 18 12:53:39 +0000 2017",
        "display_text_range": [
            0,
            139
        ],
        "entities": {
            "hashtags": [],
            "media": [
                {
                    "display_url": "pic.twitter.com/eHsnr1X3C3",
                    "expanded_url": "https://twitter.com/Moh_d_alkhaldi/status/854316996930002945/video/1",
                    "id": 854316037344550912,
                    "id_str": "854316037344550912",
                    "indices": [
                        140,
                        163
                    ],
                    "media_url": "http://pbs.twimg.com/ext_tw_video_thumb/854316037344550912/pu/img/H7FMRS90FqAcKRGV.jpg",
                    "media_url_https": "https://pbs.twimg.com/ext_tw_video_thumb/854316037344550912/pu/img/H7FMRS90FqAcKRGV.jpg",
                    "sizes": {
                        "large": {
                            "h": 736,
                            "resize": "fit",
                            "w": 416
                        },
                        "medium": {
                            "h": 736,
                            "resize": "fit",
                            "w": 416
                        },
                        "small": {
                            "h": 602,
                            "resize": "fit",
                            "w": 340
                        },
                        "thumb": {
                            "h": 150,
                            "resize": "crop",
                            "w": 150
                        }
                    },
                    "type": "photo",
                    "url": "https://t.co/eHsnr1X3C3"
                }
            ],
            "symbols": [],
            "urls": [],
            "user_mentions": []
        },
        "extended_entities": {
            "media": [
                {
                    "additional_media_info": {
                        "monetizable": false
                    },
                    "display_url": "pic.twitter.com/eHsnr1X3C3",
                    "expanded_url": "https://twitter.com/Moh_d_alkhaldi/status/854316996930002945/video/1",
                    "id": 854316037344550912,
                    "id_str": "854316037344550912",
                    "indices": [
                        140,
                        163
                    ],
                    "media_url": "http://pbs.twimg.com/ext_tw_video_thumb/854316037344550912/pu/img/H7FMRS90FqAcKRGV.jpg",
                    "media_url_https": "https://pbs.twimg.com/ext_tw_video_thumb/854316037344550912/pu/img/H7FMRS90FqAcKRGV.jpg",
                    "sizes": {
                        "large": {
                            "h": 736,
                            "resize": "fit",
                            "w": 416
                        },
                        "medium": {
                            "h": 736,
                            "resize": "fit",
                            "w": 416
                        },
                        "small": {
                            "h": 602,
                            "resize": "fit",
                            "w": 340
                        },
                        "thumb": {
                            "h": 150,
                            "resize": "crop",
                            "w": 150
                        }
                    },
                    "type": "video",
                    "url": "https://t.co/eHsnr1X3C3",
                    "video_info": {
                        "aspect_ratio": [
                            13,
                            23
                        ],
                        "duration_millis": 138433,
                        "variants": [
                            {
                                "content_type": "application/x-mpegURL",
                                "url": "https://video.twimg.com/ext_tw_video/854316037344550912/pu/pl/ZSXdbsvqLk3hzCS9.m3u8"
                            },
                            {
                                "bitrate": 320000,
                                "content_type": "video/mp4",
                                "url": "https://video.twimg.com/ext_tw_video/854316037344550912/pu/vid/180x320/5vfrtE1j4RRTSlfC.mp4"
                            },
                            {
                                "bitrate": 832000,
                                "content_type": "video/mp4",
                                "url": "https://video.twimg.com/ext_tw_video/854316037344550912/pu/vid/360x640/_50RnnRefuZcXiMg.mp4"
                            }
                        ]
                    }
                }
            ]
        },
        "favorite_count": 1600,
        "favorited": false,
        "full_text": "\u0645\u0628\u0627\u062f\u0626 \u0627\u0644\u0634\u062e\u0635\u064a\u0629 \u0627\u0644\u063a\u0627\u0645\u0636\u0629:\n1- \u0623\u0646\u0627 \u0644\u0627 \u0623\u0646\u0633\u0649 . . \u0623\u0646\u0627 \u0641\u0642\u0637 \u0623\u062a\u0631\u0643 \u0627\u0644\u0623\u0634\u064a\u0627\u0621\u064e \u062c\u0627\u0646\u0628\u0627\u064b.\n2- \u0623\u0635\u0645\u062a \u0643\u0623\u0646\u064a \u0644\u0645 \u0623\u0641\u0647\u0645 \u060c \u0648\u0623\u062a\u062c\u0627\u0647\u0644 \u0643\u0623\u0646\u064a \u0644\u0627 \u0623\u0631\u0649\n3- \u0627\u0644\u0634\u0639\u0648\u0631 \u0623\u0639\u0645\u0642 \u0645\u0646 \u0627\u0644\u0634\u0631\u062d! https://t.co/eHsnr1X3C3",
        "geo": null,
        "id": 854316996930002945,
        "id_str": "854316996930002945",
        "in_reply_to_screen_name": null,
        "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,
        "is_quote_status": false,
        "lang": "ar",
        "place": null,
        "possibly_sensitive": false,
        "retweet_count": 1105,
        "retweeted": false,
        "source": "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
        "truncated": false,
        "user": {
            "contributors_enabled": false,
            "created_at": "Sat Jul 20 02:16:42 +0000 2013",
            "default_profile": true,
            "default_profile_image": false,
            "description": "\u0645\u0633\u062a\u0634\u0627\u0631 \u062a\u062f\u0631\u064a\u0628\u064a \u0641\u064a \u0627\u0644\u062a\u0646\u0645\u064a\u0647 \u0627\u0644\u0628\u0634\u0631\u064a\u0629 \u060c \u0648\u0645\u062f\u0631\u0628 \u0641\u064a \u0639\u062f\u0629 \u0642\u0637\u0627\u0639\u0627\u062a \u062e\u0644\u064a\u062c\u064a\u0629 \u0648\u062f\u0648\u0644\u064a\u0629 \ud83c\uddec\ud83c\udde7\ud83c\uddf8\ud83c\udde6- \u0645\u0642\u062f\u0645 \u062f\u0648\u0631\u0627\u062a \u0641\u064a \u062a\u062d\u0644\u064a\u0644 \u0627\u0644\u0634\u062e\u0635\u064a\u0627\u062a \u0648\u062a\u0637\u0648\u064a\u0631 \u0627\u0644\u0645\u0647\u0627\u0631\u0627\u062a \u060c \u0625\u062f\u0627\u0631\u0629 \u0623\u0639\u0645\u0627\u0644 \ud83d\udce7 Drrmohh@hotmail.com",
            "entities": {
                "description": {
                    "urls": []
                },
                "url": {
                    "urls": [
                        {
                            "display_url": "snapchat.com/add/mohammed_q\u2026",
                            "expanded_url": "https://www.snapchat.com/add/mohammed_qii11",
                            "indices": [
                                0,
                                23
                            ],
                            "url": "https://t.co/iG0upzl8YR"
                        }
                    ]
                }
            },
            "favourites_count": 1958,
            "follow_request_sent": false,
            "followers_count": 367023,
            "following": false,
            "friends_count": 84,
            "geo_enabled": true,
            "has_extended_profile": true,
            "id": 1607244571,
            "id_str": "1607244571",
            "is_translation_enabled": false,
            "is_translator": false,
            "lang": "ar",
            "listed_count": 141,
            "location": "United Kingdom",
            "name": "\u0645\u062d\u0645\u062f \u0627\u0644\u062e\u0627\u0644\u062f\u064a",
            "notifications": false,
            "profile_background_color": "C0DEED",
            "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
            "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
            "profile_background_tile": false,
            "profile_banner_url": "https://pbs.twimg.com/profile_banners/1607244571/1496293957",
            "profile_image_url": "http://pbs.twimg.com/profile_images/870139504820199424/qKaGxWKk_normal.jpg",
            "profile_image_url_https": "https://pbs.twimg.com/profile_images/870139504820199424/qKaGxWKk_normal.jpg",
            "profile_link_color": "1DA1F2",
            "profile_sidebar_border_color": "C0DEED",
            "profile_sidebar_fill_color": "DDEEF6",
            "profile_text_color": "333333",
            "profile_use_background_image": true,
            "protected": false,
            "screen_name": "Moh_d_alkhaldi",
            "statuses_count": 4011,
            "time_zone": "Baghdad",
            "translator_type": "none",
            "url": "https://t.co/iG0upzl8YR",
            "utc_offset": 10800,
            "verified": false
        }
    }
]