Use ffmpeg -i video.mp4 -i audio.mp4 -c:v copy -c:a aac -strict experimental output.mp4
to merge audio and video files.
ffmpeg: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip
Script principle (Chinese): https://www.v2ex.com/t/856510
Github: https://github.com/dabaisuv/Tampermonkey-Script
Tips:
After the cache progress is loaded to 100 %, the video and audio file will be downloaded automatically ~
You can play video with 16x rate (document.querySelector('video').playbackRate = x
), or fast-forward video before cache progress, but please do not let the current progress bar exceeds the cache progress bar of the video bar. That will lead to the corresponding fragment of the video or audio lack of downloaded!
The script adds some variables on window:
Set in the console:
1.window.downloadAll
Set this value to 1 (window.downloadAll = 1) to download cached audio and video files (best to wait for the video to finish playing before setting it to avoid audio and video out of sync)
2.window.quickPlay
This value is the playback speed of the video in the page, the default is 1. You can set it up to 16 (window.quickPlay = x)
Replace window.quickPlay = x
with document.querySelector('video').playbackRate = x
3.window.autoDownload
Set window.autoDownload = 1 (defaul 1)
in the source file will automatically download the video after it finishes playing, and it will automatically play at 16x speed
Disclaimer: Please use scripts within the legal scope. Do not use it for any illegal use. The consequences have nothing to do with the author.