Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Untitled diff
建立於
7 年前
差異永不過期
清除
匯出
分享
解釋
6 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
56 行
全部複製
4 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
54 行
全部複製
const { PassThrough } = require('stream')
const { PassThrough } = require('stream')
const { promisify } = require('util')
const { promisify } = require('util')
const axios = require('axios')
const axios = require('axios')
const MultiStream = require('multistream')
const MultiStream = require('multistream')
const ffprobePath = require('@ffprobe-installer/ffprobe').path
const ffprobePath = require('@ffprobe-installer/ffprobe').path
const ffmpeg = require('fluent-ffmpeg')
const ffmpeg = require('fluent-ffmpeg')
ffmpeg.setFfprobePath(ffprobePath)
ffmpeg.setFfprobePath(ffprobePath)
const ffprobeAsync = promisify(ffmpeg.ffprobe)
const ffprobeAsync = promisify(ffmpeg.ffprobe)
const cl = console.log
const cl = console.log
async function run () {
async function run () {
const url = 'https://storage.arc.io/arc/homepage_demo_files/vacations.mp4'
const url = 'https://storage.arc.io/arc/homepage_demo_files/vacations.mp4'
const res = await axios.get(url, { responseType: 'stream' })
const res = await axios.get(url, { responseType: 'stream' })
const contentLength = Number(res.headers['content-length'])
const contentLength = Number(res.headers['content-length'])
const tee = new PassThrough()
const tee = new PassThrough()
複製
已複製
複製
已複製
const
multiPass
= new PassThrough()
const
lenPass
= new PassThrough()
const ffmpegPass = new PassThrough()
const ffmpegPass = new PassThrough()
複製
已複製
複製
已複製
const multistream = new MultiStream([multiPass])
res.data.pipe(tee)
res.data.pipe(tee)
複製
已複製
複製
已複製
tee.pipe(
multiPass
)
tee.pipe(
lenPass
)
tee.pipe(ffmpegPass)
tee.pipe(ffmpegPass)
const p1 = ffprobeAsync(ffmpegPass).then(metadata => {
const p1 = ffprobeAsync(ffmpegPass).then(metadata => {
tee.unpipe(ffmpegPass)
tee.unpipe(ffmpegPass)
// ffmpegPass.destroy()
// ffmpegPass.destroy()
return metadata
return metadata
})
})
const p2 = new Promise(resolve => {
const p2 = new Promise(resolve => {
let len = 0
let len = 0
複製
已複製
複製
已複製
multistream
.on('data', chunk => {
lenPass
.on('data', chunk => {
len += chunk.length
len += chunk.length
})
})
複製
已複製
複製
已複製
multistream
.on('end', () => {
lenPass
.on('end', () => {
resolve(len)
resolve(len)
})
})
})
})
const [res1, length] = await Promise.all([p1, p2])
const [res1, length] = await Promise.all([p1, p2])
console.log(contentLength, length)
console.log(contentLength, length)
if (contentLength !== length) {
if (contentLength !== length) {
cl('LENGTH MISMATCH')
cl('LENGTH MISMATCH')
} else {
} else {
cl('okay')
cl('okay')
}
}
}
}
run()
run()
已保存差異
原始文本
開啟檔案
const { PassThrough } = require('stream') const { promisify } = require('util') const axios = require('axios') const MultiStream = require('multistream') const ffprobePath = require('@ffprobe-installer/ffprobe').path const ffmpeg = require('fluent-ffmpeg') ffmpeg.setFfprobePath(ffprobePath) const ffprobeAsync = promisify(ffmpeg.ffprobe) const cl = console.log async function run () { const url = 'https://storage.arc.io/arc/homepage_demo_files/vacations.mp4' const res = await axios.get(url, { responseType: 'stream' }) const contentLength = Number(res.headers['content-length']) const tee = new PassThrough() const multiPass = new PassThrough() const ffmpegPass = new PassThrough() const multistream = new MultiStream([multiPass]) res.data.pipe(tee) tee.pipe(multiPass) tee.pipe(ffmpegPass) const p1 = ffprobeAsync(ffmpegPass).then(metadata => { tee.unpipe(ffmpegPass) // ffmpegPass.destroy() return metadata }) const p2 = new Promise(resolve => { let len = 0 multistream.on('data', chunk => { len += chunk.length }) multistream.on('end', () => { resolve(len) }) }) const [res1, length] = await Promise.all([p1, p2]) console.log(contentLength, length) if (contentLength !== length) { cl('LENGTH MISMATCH') } else { cl('okay') } } run()
更改後文本
開啟檔案
const { PassThrough } = require('stream') const { promisify } = require('util') const axios = require('axios') const MultiStream = require('multistream') const ffprobePath = require('@ffprobe-installer/ffprobe').path const ffmpeg = require('fluent-ffmpeg') ffmpeg.setFfprobePath(ffprobePath) const ffprobeAsync = promisify(ffmpeg.ffprobe) const cl = console.log async function run () { const url = 'https://storage.arc.io/arc/homepage_demo_files/vacations.mp4' const res = await axios.get(url, { responseType: 'stream' }) const contentLength = Number(res.headers['content-length']) const tee = new PassThrough() const lenPass = new PassThrough() const ffmpegPass = new PassThrough() res.data.pipe(tee) tee.pipe(lenPass) tee.pipe(ffmpegPass) const p1 = ffprobeAsync(ffmpegPass).then(metadata => { tee.unpipe(ffmpegPass) // ffmpegPass.destroy() return metadata }) const p2 = new Promise(resolve => { let len = 0 lenPass.on('data', chunk => { len += chunk.length }) lenPass.on('end', () => { resolve(len) }) }) const [res1, length] = await Promise.all([p1, p2]) console.log(contentLength, length) if (contentLength !== length) { cl('LENGTH MISMATCH') } else { cl('okay') } } run()
尋找差異