Saya mencoba mengunduh video dengan url src blob:https%3A//www.youtube.com/23aea5c8-9ae2-40dc-9417-e675ea99b386
.
Apakah ada proses yang dapat diikuti untuk mengunduh semua jenis video ini?
Saya mencoba mengunduh video dengan url src blob:https%3A//www.youtube.com/23aea5c8-9ae2-40dc-9417-e675ea99b386
.
Apakah ada proses yang dapat diikuti untuk mengunduh semua jenis video ini?
Jawaban:
Saya menemukan cara untuk men-download video dengan blob url
di Vimeo
(membaca di sini saya mengerti bagaimana melakukannya). Saya menulis langkah-langkah sederhana di sini. Saya menggunakan Google Chrome:
More Tools
→Developer Tools
Periksa apakah di tag video ada sesuatu seperti ini:
<video preload="" src="blob:https://player.vimeo.com/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"></video>
http://player.vimeo.com/video/XYZ
jika Anda menemukannya Anda dapat langsung ke titik 7, jika tidak ikuti langkah 4, 5, 6.Sekarang cari string ini https://skyfire.vimeocdn.com/.../master.json?base64_init=1
di dalam halaman (menggunakan Tampilan Pengembang), Anda harus menemukannya di dalam fungsi javascript, seperti ini:
(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":"
Salin tautan di dalam bidang url pada tab Chrome baru, misalnya https://48skyfiregce-a.akamaihd.net/.../master.json?base64_init=1
akhiri dengan browser, itu akan membuka Anda file json seperti ini:
{
"clip_id": XYZ,
"base_url": "../",
"video": [
{ ... ... ...
Sekarang buat url dengan id Anda XYZ
seperti ini:https://player.vimeo.com/video/XYZ
blob:https://player.vimeo.com/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
di dalam tag video dengan url terakhir (yang dibuat pada langkah sebelumnya # 6).Sekarang Anda akan melihat bahwa secara ajaib bidang src di dalam tag video berubah (jika tidak, coba langkah 7 beberapa kali) ...
<video preload="none" src="https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/XX/XXX/X/XXXXXXXX/XXXXXXXXX.mp4?token=abcdefg"></video>
Gunakan tautan baru itu untuk memuatnya secara langsung, itu seperti ini: https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/XX/XX/X/XXXXXXX/XXXXXX//XXXXXXXXX.mp4?token=abcdefg
<video>
tag di struktur dev tools DOM dan ubah src
atribut dari blob:...
menjadi x
. Tidak ada yang akan terjadi - ini tidak masalah. Sekarang ubah lagi, menjadi y
. Chrome akan mengonversinya 'secara ajaib' ke URL seperti pada langkah 8 atau 9. :-)
Jawaban ini untuk URL Twitter -
Anda akan menemukan kode seperti ini
<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. Salin Tempel kode di atas di notepad ++. Mengganti semua "
dengan "
dan \/
wth /
di notepad ++. (Gunakan CTRL + H)
Anda akan mendapatkan sesuatu seperti
{
"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"
}
Dari format JSON di atas, lihat nilai video_url
https://video.twimg.com/ext_tw_video/844504104512749568/pu/pl/e91Du5N2TZ09ZaW_.m3u8
Masalahnya di sini adalah, setelah 1 Agustus 2016, Twitter tidak lagi menggunakan video .mp4, tetapi mengonversi ke HLS baru, format streaming adaptif, dengan ekstensi file .m3u8 .
File .m3u8 pada dasarnya hanya pembungkus file teks, mereka super kecil (300-500 byte), dan ketika Anda membukanya dengan editor teks, file tersebut berisi tautan ke berbagai ukuran video
EXTM3U EXT-X-INDEPENDEN-SEGMENTS EXT-X-STREAM-INF: PROGRAM-ID = 1, BANDWIDTH = 256000, RESOLUTION = 180x320, CODECS = "mp4a.40.2, avc1.42001f" / ext_tw_video / 844504101212 180x320 / _Z42SY5zwMlLdFYx.m3u8 EXT-X-STREAM-INF: PROGRAM-ID = 1, BANDWIDTH = 832000, RESOLUTION = 360x640, CODECS = "mp4a.40.2, avc1.42001f" / ext4504/48/484/48/485/upload_internet.html. Phfjbbx2yinirLi.m3u8
<div id="playerContainer"
id="playerContainer"
elemen untuk mencari og:video:url
dan membuka url dalam konten, dan periksa sumbernya.
document.querySelector('video').src
di tab konsol alat pengembang browser Anda.
<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>
Saya juga punya blob:
URL video/@src
, tetapi dengan menonton Developer tools
> Network
selama pemutaran ternyata itu video/source/@src
adalah URL untuk m3u8
daftar putar.
Sebuah m3u8
video yang -backed dapat segera diunduh oleh:
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 - gumpalan URL terdengar seperti biner yang ingin Anda dapatkan tetapi mungkin ada cara yang lebih mudah untuk mendapatkan videonya. Cukup periksa tab Network di Dev tools saat Anda memutar video untuk melihat apa yang sebenarnya Anda ambil.
-i <URL> -i <URL> -i <URL>
untuk menggabungkan video, audio, dan terjemahan semua menjadi satu output :)
m3u8
metalis (yaitu file m3u8 merujuk file m3u8 lainnya) dan ffmpeg akan mengunduh dan menggabungkannya dengan benar, sehingga Anda tidak perlu secara manual menentukan banyak input -i
.
Saya menemukan cara lain untuk mengunduh video dengan blob url
masuk Vimeo
(lihat jawaban lain di halaman ini).
Solusi ini hanya cocok jika Anda menginginkan video tanpa suara!
Jadi, jika Anda ingin mengunduh hanya video Vimeo (seringkali tanpa suara), saya dapat mengonfirmasi bahwa ekstensi Google Chrome ini bekerja dengan sangat baik: Flash Video Downloader .