中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

js blob類型url的視頻下載問題的解決

發布時間:2020-09-06 03:13:19 來源:腳本之家 閱讀:386 作者:威震四海 欄目:web開發

blob下載問題的詳細描述

我想用src url blob:https://www.youtube.com/23aea5c8-9ae2-40dc-9417-e675ea99b386下載視頻,但是不知道應該怎么做。

有沒有下載這類視頻的通用方法?

推薦的解決方法

我在Vimeo中找到了一個使用blob url下載視頻的方法(讀了這篇文章,我才知道做法)。我正在使用Google Chrome,具體步驟如下:

1、打開More Tools(更多工具)→Developer 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、復制上面的url字段中的鏈接到一個新的Chrome選項卡,例如https://48skyfiregce-a.akamaihd.net/.../master.json?base64_init=1,然后使用瀏覽器打開它,它會打開一個像這樣的json文件:

{
  "clip_id": XYZ,
  "base_url": "../",
  "video": [
         { ... ... ...

6、現在用id XYZ組合構造一個URL,如下所示:https://player.vimeo.com/video/XYZ

7、用最終的URL替換視頻標簽內的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>

最后,使用新的鏈接直接下載它,就像這樣:https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/XX/XXX/X/XXXXXXXX/XXXXXXXXX.mp4?token=abcdefg

其他的解決思路

這個答案是針對Twitter網址的 -

右鍵點擊視頻,然后點擊檢查元素 -

你會發現這樣的代碼

<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">

復制上面的代碼,并粘貼到記事本++(Notepad++)中,然后用"替換所有的&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://cache.yisu.com/upload/information/20200622/114/9992.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": "https://cache.yisu.com/upload/information/20200622/114/9996.jpg",
        "media_url_https": "https://cache.yisu.com/upload/information/20200622/114/9992.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視頻,而是轉換為新的HLS,自適應流格式,帶有.m3u8文件擴展名。

.m3u8文件基本上只是一個文本文的封裝,它們非常小(300-500字節)。當您使用文本編輯器打開它們時,它們包含指向不同視頻大小的鏈接

在記事本++(Notepad++)中打開文件m3u8,它會包含這樣的代碼

EXTM3U EXT-X-INDEPENDENT-SEGMENTS 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

根據您需要的分辨率從上面復制對應的鏈接。重復相同的步驟,直到有.ts文件。下載.ts文件(視頻文件)。

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持億速云。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

珲春市| 贺州市| 深圳市| 藁城市| 肃北| 平塘县| 眉山市| 固镇县| 周至县| 福鼎市| 固安县| 新郑市| 甘谷县| 绥芬河市| 韶山市| 改则县| 教育| 手游| 介休市| 新余市| 古田县| 平度市| 陕西省| 肃南| 古浪县| 盐津县| 桓台县| 普安县| 红安县| 清远市| 龙江县| 乃东县| 当涂县| 拉孜县| 休宁县| 阿克陶县| 连州市| 博客| 遂平县| 汉阴县| 武邑县|