Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
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()
違いを見つける