pk10技巧34567名定位

Classic Case
  • Website of Tongren Development and Reform Commission
  • Tongren City Science and Technology Innovation Service Platform
  • Tongren Science and Technology Bureau

Qiniu Cloud File Batch Download

Posted: 2019-11-03 11:00 Source: unknown Author: admin Click: Times

qshell download seven cow cloud pictures

The qdownload command of the qshell tool can realize batch download of pictures. At this time, if the domain name has not expired, you can refer to the official documentation to download the pictures. If the space has expired, you can try to bind a registered domain name to download. Finally, if there is no domain name to try, you can consider the following method, copy the original space picture to the newly created space (the free 30-day test domain name is available), and then download the picture. qshell more instructions and usage of qshell , please see here .

qshell download

Download the qshell tool, decompress it to any directory, and enter the decompressed directory from the command line qshell_windows_x64.exe ).

Enter qshell_windows_x64.exe -v command line to test whether the tool can be used normally.

Authorization (key)

After confirming that qshell can be used normally, use the following command to authorize

 qshell account [<AccessKey> <SecretKey> <Name>] [flags] 

Among them, the key AccessKey and SecretKey can be obtained in the management platform of AccessKey Cloud, and the name is the account name (you can start it arbitrarily ...), and the final flags can be ignored.

1.png

After the command is executed, you can enter the command qshell_windows_x64.exe account view the authorized account information, similar to the following figure:

2.png

Get original space file name

  • List the name of the original space file and save it in the imglist.txt file

     qshell listbucket original space name -o imglist.txt 

    The content stored in the obtained file is roughly as follows:

    3.png

    It can be seen that the content of the obtained list information is relatively large, and we only need the first column, so we need to process this file, which can be processed manually or by using the following command.

  • As cmd does not support the following commands, it is recommended that Windows system users try to use cmder to handle

     cat imglist.txt | awk '{print $ 1}'> img-name.txt 

    Contents of img-name.txt after processing

    4.png

Copy the original space file to the new space

  • Create new storage space

Log in to the Qiniu Cloud console and select 对象存储 - 新建存储空间 . Note that the storage area selected for the newly created space must be the same as the original space, otherwise an error will occur when copying the file.

5.png

  • Copy file

     qshell batchcopy --force original space name new space name -i img-name.txt 

    After the command is executed, you can see the backed up files in the new storage space.

Image download

  • Create a configuration file for download

    Create a new json file in the qshell tool directory, customize the name, and save the following content in the file

     {"dest_dir": "Directory where downloaded pictures are stored", "bucket": "New storage space name", "cdn_domain": "Test domain name provided by the new storage space"} 
  • Execute the following command to download the picture

     qshell qdownload file name just created.json 

    6.png




tag:
    ------ Divider ----------------------------
    ------ Divider ----------------------------