The previous method to obtain the original quality video of station B was to download it using [Bili uwp] in the win10 app store. The downloaded file format is .mp4, but the player cannot decode and play it normally. The first 9 bits of the binary data of the video file need to be deleted before it can be played normally.
But now Bilibili has launched its own windows client and no longer provides login functionality for Biliuwp. The solution I have figured out now is to use the new Windows official client to cache the video first, and then use a script to convert it to mp4 format. What the script does: restore the format of .m4s files and merge .m4s audio and video into .mp4 files. There will be no loss of image quality in this process, unless you select a lower image quality when caching from the client.
After caching the video from the client, the video will be downloaded to the directory you specified D://mendge//video//bili
(as shown below). Each digital string directory corresponds to a cached video, and the video information corresponding to the digital string can be viewed in load_log
.
The sub-files of each digital string directory are as shown below, in which .videoInfo
records the detailed information of the video in json form. The former m4s file is a video file, and the latter m4s file is an audio file.
Release on the right: Manually download the bgen.exe executable command (or compile and generate it from your own source code), enter the terminal and cd to the directory where bgen.exe is located. The command implements single video processing and multi-video batch processing. The parameters corresponding to the angle brackets in the command example need to be filled in according to your own directory:
Single video processing: [ ./bgen.exe
]
According to the picture above, srcdir
is D://mendge//video//bili//1550140098
, destdir
is the output path of the destination .mp4 file, which is specified by yourself.
Multi-video batch processing: [ ./bgen.exe
]
According to the picture above, my srcdir
is D://mendge//video//bili
git clone https://github.com/mendge/bgen.gitcd bgen make prepare
Then we can carry out secondary development