Project address reference:

Github.com/iikira/Baid…

Basic idea: according to the manual second transmission method, as long as you know the file_size and md5 value of the file, and add a file name according to your own desire, you can “copy” a copy of the existing data in the cloud disk.

Project background and ideas

The author has dozens of cloud disk accounts so far, file management is more troublesome, even the account switch has to rely on Cookie Profile Switcher plug-in. In addition, a squirrel party must always be vigilant to deal with the pain of account closure and loss of resources.

If the same file exists in the cloud, copy it directly to the cloud by detecting the file size and md5 value or adding other information, such as the md5 value of the first 256KB slice of the file.

The author of BaiduPCS-Go has implemented the following functions in the new version: Only file_size and MD5 are needed to realize the virtual second transmission when the file is not in the local hard disk but has been uploaded by others in the cloud.

The usage of BaiduPCS-Go and its second transmission function will not be described here. They are all on Github.

For example:

Baidupcs-go ru-length =< file size > -md5=< MD5 value of file > < disk path/file name >Copy the code

Based on this idea, according to the principle of baiduYunCacheFilev0.db file containing file directory, file name, size, MD5 and other information, we can use SQLite to extract the information, with Excel and its formula, make a batch file of the following type:

Baidupcs-go ru-length =<size_1> -MD5 =< MD5_1 > < file 1> Baidupcs-go ru-length =<size_2> -md5=< MD5_2 > < file 2> Baidupcs-go ru -length=<size_3> -md5=< MD5_3 > < file 3>... pauseCopy the code

Project start

Download and Login

First, download BaiduPCs-go. exe and put it in the appropriate directory. Type login and press Enter. Enter your account, password, and verify login as prompted.

Configuring environment Variables

Extract information from BaiduYunCacheFilev0.db

Here’s a tool that I’m going to “share” directly in order to demonstrate its usefulness. To save a copy of SQlitespy. exe in your cloud disk, enter the following command at the command prompt, if you have logged in baiduPCs-Go.

BaiduPCS-Go ru -length=3746304 -md5=D3C44CE0F2EA0886091DFBDD3BB6CB45 /SQLiteSpy/SQLiteSpy.exe
Copy the code

And then download

BaiduPCS-Go d SQLiteSpy
Copy the code

Use the same method to download the second, more powerful tool

BaiduPCS-Go ru -length=101809138 -md5=09FC738A805C8EA4C27A86C553C1A048 /navicat/navicatpremiumpjb3264lsb.zip BaiduPCS-Go  d navicatCopy the code

Use sqlitespy. exe with everything to find and open BaiduyunCacheFilev0.db, click Cache to open, randomly click a cell, CTRL + A then CTRL + C, select all, copy, create a new text document, paste and save.

Synthesize command line instructions in Excel and run them

Open Excel, data – import text documents, automatically generate tables with formatting. It can be seen that A to J are listed as the following data:

A B C D E F G H I J
id fid parent_path server_filename file_size md5 isdir category server_mtime local_mtime

Edit the formula in an empty column:

="BaiduPCS-Go ru -length="&E1&" -md5="&F1&""""&C1&D1&""""
Copy the code

CTRL + D fills all, copy the required command lines into a text file and save it as a bat file or CMD file. Bat “and double-click to run to achieve batch second file transfer.

Problem solving

Workaround for Unicode characters

Transcoding is required when a filename with a Unicode character like “†” is garbled in CMD even when saved as a Unicode or UTF-8 document.

Save name.bat as a UTF-8 encoded document.

To run the UTF-8 file without garbled characters, enter CHCP 65001 in CMD. So create another bat file in the same directory as name.bat and type:

chcp 65001
name.bat
pause
Copy the code

Save the BAT as ANSI code, double-click to run to call name.bat. If you need to save the output to a text document to see which seconds failed, the code looks like this:

chcp 65001
name.bat >>log.txt
pause
Copy the code

You can view the records in log.txt after running.

For large databases

If BaiduYunCacheFilev0.db exceeds 10MB, the text copied in SQLiteSpy cannot be fully pasted into the text document. Navicat Premium 12 is required

Project test

I personally test the second butter resources, the results are as follows:

I extracted information about 2TB of butter from say spark and my melancholy brother in one of my accounts, and successfully transmitted 1.3TB in seconds through command line transmission test. Well, that’s not bad to say. Because Baidu may be on some although others have uploaded but the resources are too new files are not included in the second pass list.

It’s a good way to back up what you already have.