{ "is_360": false, "duration": 28617, "scribe_widget_origin": true, "heartbeatEnabled": true, "video_url": "https://video.twimg.com/ext_tw_video/844504104512749568/pu/pl/e91Du5N2TZ09ZaW_.m3u8", "disable_embed": "0", "videoInfo": { "title": null, "description": null, "publisher": { "screen_name": "MountainButorac", "name": "Mountain Butorac", "profile_image_url": "https://pbs.twimg.com/profile_images/808318456701521920/vBvlAASx_normal.jpg" } }, "cardUrl": "https://t.co/SdSorop3uN", "content_type": "application/x-mpegURL", "owner_id": "14120461", "looping_enabled": true, "show_cookie_override_en": true, "visit_cta_url": null, "scribe_playlist_url": "https://twitter.com/MountainButorac/status/844505243538931714/video/1", "source_type": "consumer", "image_src": "https://pbs.twimg.com/ext_tw_video_thumb/844504104512749568/pu/img/FFt3qkbeOh0RlGfZ.jpg", "heartbeatIntervalInMs": 5000.0, "use_tfw_live_heartbeat_event_category": true, "video_loading_timeout": 45000.0, "status": { "created_at": "Wed Mar 22 11:05:14 +0000 2017", "id": 844505243538931714, "id_str": "844505243538931714", "text": "Took my Goddaughter to meet the pope. She stole his hat! https://t.co/SdSorop3uN", "truncated": false, "entities": { "hashtags": [], "symbols": [], "user_mentions": [], "urls": [], "media": [{ "id": 844504104512749568, "id_str": "844504104512749568", "indices": [57, 80], "media_url": "http://pbs.twimg.com/ext_tw_video_thumb/844504104512749568/pu/img/FFt3qkbeOh0RlGfZ.jpg", "media_url_https": "https://pbs.twimg.com/ext_tw_video_thumb/844504104512749568/pu/img/FFt3qkbeOh0RlGfZ.jpg", "url": "https://t.co/SdSorop3uN", "display_url": "pic.twitter.com/SdSorop3uN", "expanded_url": "https://twitter.com/MountainButorac/status/844505243538931714/video/1", "type": "photo", "sizes": { "small": { "w": 340, "h": 604, "resize": "fit" }, "thumb": { "w": 150, "h": 150, "resize": "crop" }, "large": { "w": 576, "h": 1024, "resize": "fit" }, "medium": { "w": 576, "h": 1024, "resize": "fit" } } }] }, "source": "\u003ca href=https://www.jb51.net/article/\"http://twitter.com/download/iphone\" rel=https://www.jb51.net/article/\"nofollow\"\u003eTwitter for iPhone\u003c/a\u003e", "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, "geo": null, "coordinates": null, "place": null, "contributors": null, "retweet_count": 0, "favorite_count": 0, "favorited": false, "retweeted": false, "possibly_sensitive": false, "lang": "en" }, "show_cookie_override_all": true, "video_session_enabled": false, "media_id": "844504104512749568", "view_counts": null, "statusTimestamp": { "local": "4:05 AM - 22 Mar 2017" }, "media_type": 1, "user": { "screen_name": "MountainButorac", "name": "Mountain Butorac", "profile_image_url": "https://pbs.twimg.com/profile_images/808318456701521920/vBvlAASx_bigger.jpg" }, "watch_now_cta_url": null, "tweet_id": "844505243538931714" }
从上面的JSON格式,可以看到video_url的值
https://video.twimg.com/ext_tw_video/844504104512749568/pu/pl/e91Du5N2TZ09ZaW_.m3u8
这里的问题是,在2016年8月1日之后,Twitter不再使用.mp4视频,而是转换为新的HLS,自适应流格式,带有.m3u8文件扩展名。
.m3u8文件基本上只是一个文本文的封装,它们非常小(300-500字节)。当您使用文本编辑器打开它们时,它们包含指向不同视频大小的链接
在记事本++(Notepad++)中打开文件m3u8,它会包含这样的代码