我正在尝试使用src url下载视频blob:https%3A//www.youtube.com/23aea5c8-9ae2-40dc-9417-e675ea99b386。
有没有可以遵循的程序来下载所有类型的视频?
我正在尝试使用src url下载视频blob:https%3A//www.youtube.com/23aea5c8-9ae2-40dc-9417-e675ea99b386。
有没有可以遵循的程序来下载所有类型的视频?
Answers:
我发现了一个方法来下载视频与blob url在Vimeo(读这里我明白怎么做)。我在这里写一些简单的步骤。我正在使用Google Chrome:
More Tools→Developer Tools检查视频标签中是否有以下内容:
<video preload="" src="blob:https://player.vimeo.com/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"></video>
http://player.vimeo.com/video/XYZ发现它一样,您可以直接转到第7点,否则请按照步骤4、5、6进行操作。现在,https://skyfire.vimeocdn.com/.../master.json?base64_init=1在页面内(使用Developer View)查找此字符串,您应该在javascript函数内找到它,如下所示:
(function(e,a){var t={"cdn_url":"https://f.vimeocdn.com","view":1,"request":{"files":{"dash":{"origin":"gcs","url":"https://48skyfiregce-a.akamaihd.net/.../master.json?base64_init=1","cdn":"
将链接复制到新的Chrome标签页的url字段内,例如https://48skyfiregce-a.akamaihd.net/.../master.json?base64_init=1,用浏览器将其打开,它将为您打开一个json文件,如下所示:
{
    "clip_id": XYZ,
    "base_url": "../",
    "video": [
                 { ... ... ...
现在,使用您的ID组成一个网址,XYZ如下所示:https://player.vimeo.com/video/XYZ
blob:https://player.vimeo.com/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX最后一个网址(在上一步#6中创建的网址)替换视频标签内的内容。现在,您会注意到,视频标签内的src字段已经神奇地更改了(如果没有更改,请多次尝试执行步骤7)...
<video preload="none" src="https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/XX/XXX/X/XXXXXXXX/XXXXXXXXX.mp4?token=abcdefg"></video>
使用该新链接直接下载它,就像这样:https ://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/XX/XXX/X/XXXXXXXX/XXXXXXXXX.mp4?token=abcdefg
<video>在开发工具DOM结构中找到标签,然后将src属性从更改为blob:...即可x。什么都不会发生-没关系。现在再次将其更改为y。Chrome会像步骤8或9一样,将其“神奇地”转换为URL。:-)
                    此答案适用于Twitter URL-
您会发现这样的代码
<div id="playerContainer" class="player-container full-screen-enabled" data-config="{"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=\"http:\/\/twitter.com\/download\/iphone\" rel=\"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"}" data-source-type="consumer">
2.复制以上代码粘贴到记事本++中。替换所有"与"和\/相机连/在记事本++。(使用CTRL + H)
你会得到类似
{
    "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=\"http://twitter.com/download/iphone\" rel=\"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视频,而是转换为带有.m3u8文件扩展名的新HLS自适应流格式。
.m3u8文件基本上只是文本文件包装器,它们非常小(300-500字节),当您使用文本编辑器打开它们时,它们包含指向不同视频大小的链接
EXTM3U EXT-X独立段EXT-X-STREAM-INF:PROGRAM-ID = 1,BANDWIDTH = 256000,RESOLUTION = 180x320,CODECS =“ mp4a.40.2,avc1.42001f” / ext_tw_video / 844504104512749568 / pu / pl / 180x320 / _Z42SY5zwMlLdFYx.m3u8 EXT-X-STREAM-INF:PROGRAM-ID = 1,BANDWIDTH = 832000,RESOLUTION = 360x640,CODECS =“ mp4a.40.2,avc1.42001f” / ext_tw_video / 844504104512749568 / pu / pl / 360x640- Phfjbbx2yinirLi.m3u8
<div id="playerContainer"
                    id="playerContainer"元素,请查找og:video:url并打开内容中的url,然后检查其来源。
                    document.querySelector('video').src在浏览器开发人员工具的“控制台”选项卡中运行。
                    <video src="blob:https://www.example.tv/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
  <source src="https://cdn.example.tv/api/media/tv/xyzxyz/index" type="application/x-mpegurl">
</video>
我在中也有blob:URL video/@src,但是通过在播放过程中观看Developer tools> Network,原来video/source/@src是m3u8播放列表的URL 。
一个m3u8-backed视频可以通过很容易地下载:
ffplay -i "https://cdn.example.tv/api/media/tv/xyzxyz/1080/index.m3u8"ffmpeg -i "https://cdn.example.tv/api/media/tv/xyzxyz/1080/index.m3u8" -codec copy file.mkvtl; dr-Blob URL听起来像您想要获取的二进制文件,但可能会有更简单的方法来获取视频。播放视频时,只需在开发工具中查看“网络”标签,即可查看实际获取的内容。
-i <URL> -i <URL> -i <URL>以将视频,音频和字幕全部合并为一个输出:)
                    m3u8 Metalist(即,引用其他m3u8文件的m3u8文件),并且ffmpeg将正确下载并合并它,因此您无需手动指定多个输入-i。
                    我找到了另一种使用blob urlin 下载视频的方法Vimeo(请参阅此页面中的其他答案)。
仅当您只需要视频而没有声音时,此解决方案才适用!
因此,如果您只想下载Vimeo视频(通常没有声音),则可以确认此Google Chrome扩展程序确实很好用:Flash Video Downloader。