如何下载带有Blob网址的视频?


94

我正在尝试使用src url下载视频blob:https%3A//www.youtube.com/23aea5c8-9ae2-40dc-9417-e675ea99b386

有没有可以遵循的程序来下载所有类型的视频?


如果您想下载youtube视频,请使用扩展程序,例如Video Downloadhelper(Firefox)
Ganesh R.

我想从vimeo网址下载。
vinesh '16

Vinesh,请尝试导航至vimeo网站并开始播放您需要下载的视频。Video DownloadHelper将检测到它并为您提供下载选项。我尝试过这个。
Ganesh R.

没运气。当我开始播放视频时,我从您提到的扩展名中看到了大约2 MB的多个视频建议。下载零件时,我无法播放该小文件。我收到文件已损坏的错误消息。
vinesh'2

在评论中添加链接
Ganesh R.

Answers:


69

我发现了一个方法来下载视频与blob urlVimeo(读这里我明白怎么做)。我在这里写一些简单的步骤。我正在使用Google Chrome:

  1. 打开More ToolsDeveloper Tools
  2. 检查视频标签中是否有以下内容:

    <video preload="" src="blob:https://player.vimeo.com/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"></video>
    
  3. 复制iframe标记的src(如果有),就像http://player.vimeo.com/video/XYZ发现它一样,您可以直接转到第7点,否则请按照步骤4、5、6进行操作。
  4. 现在,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":"
    
  5. 将链接复制到新的Chrome标签页的url字段内,例如https://48skyfiregce-a.akamaihd.net/.../master.json?base64_init=1,用浏览器将其打开,它将为您打开一个json文件,如下所示:

    {
        "clip_id": XYZ,
        "base_url": "../",
        "video": [
                     { ... ... ...
    
  6. 现在,使用您的ID组成一个网址,XYZ如下所示:https://player.vimeo.com/video/XYZ

  7. blob:https://player.vimeo.com/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX最后一个网址(在上一步#6中创建的网址)替换视频标签内的内容。
  8. 现在,您会注意到,视频标签内的src字段已经神奇地更改了(如果没有更改,请多次尝试执行步骤7)...

    <video preload="none" src="https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/XX/XXX/X/XXXXXXXX/XXXXXXXXX.mp4?token=abcdefg"></video>
    
  9. 使用该新链接直接下载它,就像这样:https ://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/XX/XXX/X/XXXXXXXX/XXXXXXXXX.mp4?token=abcdefg


7
令人印象深刻。您是如何知道的?
gronostaj

1
在第7步中,“ html内的最后一个URL”是什么意思?
joaorodr84

6
可以完美运行,但诀窍是有时您必须多次替换“ src”值才能生成下载链接。
Ashrith '17

19
目前,对于Vimeo而言,它要容易得多,不需要所有步骤。只需打开Vimeo视频,<video>在开发工具DOM结构中找到标签,然后将src属性从更改为blob:...即可x。什么都不会发生-没关系。现在再次将其更改为y。Chrome会像步骤8或9一样,将其“神奇地”转换为URL。:-)
StanE

3
@StanE它也可以像Firefox一样运行,并且绝对更快……
ling

10

此答案适用于Twitter URL-

  1. 右键点击视频,然后点击检查元素-

您会发现这样的代码

<div id="playerContainer" class="player-container full-screen-enabled" data-config="{&quot;is_360&quot;:false,&quot;duration&quot;:28617,&quot;scribe_widget_origin&quot;:true,&quot;heartbeatEnabled&quot;:true,&quot;video_url&quot;:&quot;https:\/\/video.twimg.com\/ext_tw_video\/844504104512749568\/pu\/pl\/e91Du5N2TZ09ZaW_.m3u8&quot;,&quot;disable_embed&quot;:&quot;0&quot;,&quot;videoInfo&quot;:{&quot;title&quot;:null,&quot;description&quot;:null,&quot;publisher&quot;:{&quot;screen_name&quot;:&quot;MountainButorac&quot;,&quot;name&quot;:&quot;Mountain Butorac&quot;,&quot;profile_image_url&quot;:&quot;https:\/\/pbs.twimg.com\/profile_images\/808318456701521920\/vBvlAASx_normal.jpg&quot;}},&quot;cardUrl&quot;:&quot;https:\/\/t.co\/SdSorop3uN&quot;,&quot;content_type&quot;:&quot;application\/x-mpegURL&quot;,&quot;owner_id&quot;:&quot;14120461&quot;,&quot;looping_enabled&quot;:true,&quot;show_cookie_override_en&quot;:true,&quot;visit_cta_url&quot;:null,&quot;scribe_playlist_url&quot;:&quot;https:\/\/twitter.com\/MountainButorac\/status\/844505243538931714\/video\/1&quot;,&quot;source_type&quot;:&quot;consumer&quot;,&quot;image_src&quot;:&quot;https:\/\/pbs.twimg.com\/ext_tw_video_thumb\/844504104512749568\/pu\/img\/FFt3qkbeOh0RlGfZ.jpg&quot;,&quot;heartbeatIntervalInMs&quot;:5000.0,&quot;use_tfw_live_heartbeat_event_category&quot;:true,&quot;video_loading_timeout&quot;:45000.0,&quot;status&quot;:{&quot;created_at&quot;:&quot;Wed Mar 22 11:05:14 +0000 2017&quot;,&quot;id&quot;:844505243538931714,&quot;id_str&quot;:&quot;844505243538931714&quot;,&quot;text&quot;:&quot;Took my Goddaughter to meet the pope. She stole his hat! https:\/\/t.co\/SdSorop3uN&quot;,&quot;truncated&quot;:false,&quot;entities&quot;:{&quot;hashtags&quot;:[],&quot;symbols&quot;:[],&quot;user_mentions&quot;:[],&quot;urls&quot;:[],&quot;media&quot;:[{&quot;id&quot;:844504104512749568,&quot;id_str&quot;:&quot;844504104512749568&quot;,&quot;indices&quot;:[57,80],&quot;media_url&quot;:&quot;http:\/\/pbs.twimg.com\/ext_tw_video_thumb\/844504104512749568\/pu\/img\/FFt3qkbeOh0RlGfZ.jpg&quot;,&quot;media_url_https&quot;:&quot;https:\/\/pbs.twimg.com\/ext_tw_video_thumb\/844504104512749568\/pu\/img\/FFt3qkbeOh0RlGfZ.jpg&quot;,&quot;url&quot;:&quot;https:\/\/t.co\/SdSorop3uN&quot;,&quot;display_url&quot;:&quot;pic.twitter.com\/SdSorop3uN&quot;,&quot;expanded_url&quot;:&quot;https:\/\/twitter.com\/MountainButorac\/status\/844505243538931714\/video\/1&quot;,&quot;type&quot;:&quot;photo&quot;,&quot;sizes&quot;:{&quot;small&quot;:{&quot;w&quot;:340,&quot;h&quot;:604,&quot;resize&quot;:&quot;fit&quot;},&quot;thumb&quot;:{&quot;w&quot;:150,&quot;h&quot;:150,&quot;resize&quot;:&quot;crop&quot;},&quot;large&quot;:{&quot;w&quot;:576,&quot;h&quot;:1024,&quot;resize&quot;:&quot;fit&quot;},&quot;medium&quot;:{&quot;w&quot;:576,&quot;h&quot;:1024,&quot;resize&quot;:&quot;fit&quot;}}}]},&quot;source&quot;:&quot;\u003ca href=\&quot;http:\/\/twitter.com\/download\/iphone\&quot; rel=\&quot;nofollow\&quot;\u003eTwitter for iPhone\u003c\/a\u003e&quot;,&quot;in_reply_to_status_id&quot;:null,&quot;in_reply_to_status_id_str&quot;:null,&quot;in_reply_to_user_id&quot;:null,&quot;in_reply_to_user_id_str&quot;:null,&quot;in_reply_to_screen_name&quot;:null,&quot;geo&quot;:null,&quot;coordinates&quot;:null,&quot;place&quot;:null,&quot;contributors&quot;:null,&quot;retweet_count&quot;:0,&quot;favorite_count&quot;:0,&quot;favorited&quot;:false,&quot;retweeted&quot;:false,&quot;possibly_sensitive&quot;:false,&quot;lang&quot;:&quot;en&quot;},&quot;show_cookie_override_all&quot;:true,&quot;video_session_enabled&quot;:false,&quot;media_id&quot;:&quot;844504104512749568&quot;,&quot;view_counts&quot;:null,&quot;statusTimestamp&quot;:{&quot;local&quot;:&quot;4:05 AM - 22 Mar 2017&quot;},&quot;media_type&quot;:1,&quot;user&quot;:{&quot;screen_name&quot;:&quot;MountainButorac&quot;,&quot;name&quot;:&quot;Mountain Butorac&quot;,&quot;profile_image_url&quot;:&quot;https:\/\/pbs.twimg.com\/profile_images\/808318456701521920\/vBvlAASx_bigger.jpg&quot;},&quot;watch_now_cta_url&quot;:null,&quot;tweet_id&quot;:&quot;844505243538931714&quot;}" data-source-type="consumer">

2.复制以上代码粘贴到记事本++中。替换所有&quot;"\/相机连/在记事本++。(使用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字节),当您使用文本编辑器打开它们时,它们包含指向不同视频大小的链接

  1. 在记事本++中打开文件m3u8,它将包含如下代码

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

  1. 根据需要从上方复制相应的链接。重复相同的步骤,直到拥有.ts文件。下载.ts文件(视频文件)。

您是什么意思,“您会得到类似的东西”-从何而来?
用户

@User从上面的代码开始,例如<div id="playerContainer"
Pirate X X

3
嘿,在第4步中,“复制相应链接”是什么意思?这不是有效的网址,我也找不到如何获取视频。编辑:好的,对,我找到了。您应该提到必须将“ video.twimg.com ” 放在前面并访问URL。
Elzo

如果找不到该id="playerContainer"元素,请查找og:video:url并打开内容中的url,然后检查其来源。
guillefix

Twitter上执行此操作的另一种方法是document.querySelector('video').src在浏览器开发人员工具的“控制台”选项卡中运行。
法扎德YZ

8
<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/@srcm3u8播放列表的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.mkv

tl; dr-Blob URL听起来像您想要获取的二进制文件,但可能会有更简单的方法来获取视频。播放视频时,只需在开发工具中查看“网络”标签,即可查看实际获取的内容。


1
适用于我的机器!而且,您可以提供多种流输入,-i <URL> -i <URL> -i <URL>以将视频,音频和字幕全部合并为一个输出:)
mcandre,

@mcandre是的,这是一个很好的提示。您也可能会找到m3u8 Metalist(即,引用其他m3u8文件的m3u8文件),并且ffmpeg将正确下载并合并它,因此您无需手动指定多个输入-i
VlastimilOvčáčík18年

0

我找到了另一种使用blob urlin 下载视频的方法Vimeo(请参阅此页面中的其他答案)。

仅当您只需要视频而没有声音时,此解决方案才适用!

因此,如果您只想下载Vimeo视频(通常没有声音),则可以确认此Google Chrome扩展程序确实很好用:Flash Video Downloader

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.