Looking for the misty rain and the world of mortals, and thinking about poetry and painting in the south of the Yangtze River

[Download] Aria2+Rclone realizes offline download and can be configured to automatically upload to OneDrive

Wandering the Jianghu 2020-07-18 Browse (10916) Comments (1)

Aria2

 Bt.jpg [Download] Aria2+Rclone realize offline download, which can be configured to automatically upload to OneDrive for wandering in the Jianghu

Aria2 is a lightweight multi protocol and multi source command line download utility. It supports HTTP / HTTPS,FTP,SFTP, BitTorrent and Metalink Aria2 can operate through the built-in JSON-RPC and XML-RPC interfaces.

Aria2 install

Use the following code to download and run the Aria2 one click installation management script to integrate the perfect Aria2 configuration scheme.

 wget -N git.io/aria2.sh && chmod +x aria2.sh && ./ aria2.sh

The script operation menu appears. Enter 1 to start the installation.

Rclone

Rclone is a command line tool that supports data synchronization, uploading, and downloading between different object storage and network disks. And through some settings, it can realize offline download, server backup and other very practical functions. Here with OneDrive For example, configure the connection. Other network disks operate similarly. Since it is an interactive configuration option, there is no difficulty as long as you can understand it.

Rclone installation

Use official one click script (it may be extremely slow, 14MB file, several KB/s, who can withstand this)

 curl  https://rclone.org/install.sh  | sudo bash

Rclone Connect Onedrive

Get Token

Download Rclone on your Windows computer. Rclone official website: https://rclone.org/downloads/

Extract to the directory with environment variables, such as C:\Windows\system32\ You can also configure environment variables by yourself, Baidu will not add environment variables... then Win+R Open Explorer Input cmd Enter to open the console, and then enter the following command.

 rclone authorize "onedrive"

Next, a browser will pop up asking you to log in to your Onedrive account for authorization. After authorization, the following information will appear in the command prompt window:

 TIM20200713151935.png [Download] Aria2+Rclone realizes offline download, and can be configured to automatically upload to OneDrive for wandering in the Jianghu

Note: Copy the entire {"access_token": "xxxxxxxx"}, save it, and use it later.

Configure Rclone

Server input rclone config Command, the following information will appear. Please refer to the following # # # comments, Modify at your own discretion.

 2020/07/13 15:20:30 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults No remotes found - make a new one n) New remote s) Set configuration password q) Quit config N/s/q>n # # # Select n New Name>onedrive ##### Enter a name, similar to a label, which is used to distinguish different network disks. Type of storage to configure. Enter a string value.  Press Enter for the default (""). Choose a number from below, or type in your own value  1 / 1Fichier     "fichier"  2 / Alias for an existing remote     "alias"  3 / Amazon Drive     "amazon cloud drive"  4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)     "s3"  5 / Backblaze B2     "b2"  6 / Box     "box"  7 / Cache a remote     "cache"  8 / Citrix Sharefile     "sharefile"  9 / Dropbox     "dropbox" 10 / Encrypt/Decrypt a remote     "crypt" 11 / FTP Connection     "ftp" 12 / Google Cloud Storage (this is not Google Drive)     "google cloud storage" 13 / Google Drive     "drive" 14 / Google Photos     "google photos" 15 / Hubic     "hubic" 16 / In memory object storage system.     "memory" 17 / Jottacloud     "jottacloud" 18 / Koofr     "koofr" 19 / Local Disk     "local" 20 / Mail.ru Cloud     "mailru" 21 / Mega     "mega" 22 / Microsoft Azure Blob Storage     "azureblob" 23 / Microsoft OneDrive     "onedrive" 24 / OpenDrive     "opendrive" 25 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)     "swift" 26 / Pcloud     "pcloud" 27 / Put.io     "putio" 28 / QingCloud Object Storage     "qingstor" 29 / SSH/SFTP Connection     "sftp" 30 / Sugarsync     "sugarsync" 31 / Tardigrade Decentralized Cloud Storage     "tardigrade" 32 / Transparently chunk/split large files     "chunker" 33 / Union merges the contents of several upstream fs     "union" 34 / Webdav     "webdav" 35 / Yandex Disk     "yandex" 36 / http Connection     "http" 37 / premiumize.me     "premiumizeme" 38 / seafile     "seafile" Storage>23 #### Select 23 Microsoft OneDrive  See help for onedrive backend at:  https://rclone.org/onedrive/ Microsoft App Client Id Leave blank normally. Enter a string value.  Press Enter for the default (""). Client_id>#### Leave blank, enter Microsoft App Client Secret Leave blank normally. Enter a string value.  Press Enter for the default (""). Client_secret>#### Leave blank, enter Edit advanced config?  (y/n) y) Yes n) No (default) Y/n>n # # # # Leave blank, enter Remote config Use auto config?  * Say Y if not sure  * Say N if you are working on a remote or headless machine y) Yes (default) n) No Y/n>n # # # # Note that you can manually enter n configuration here For this to work, you will need rclone available on a machine that has a web browser available. For more help and alternate methods see:  https://rclone.org/remote_setup/ Execute the following on the machine with the web browser (same rclone version recommended):         rclone authorize "onedrive" Then paste the result below: Result>{"access_token": "xxxxxxxx"} # # # Paste the token information saved before Choose a number from below, or type in an existing value  1 / OneDrive Personal or Business     "onedrive"  2 / Root Sharepoint site     "sharepoint"  3 / Type in driveID     "driveid"  4 / Type in SiteID     "siteid"  5 / Search a Sharepoint site     "search" Your choice>1 # # # Select 1, personal or commercial Found 1 drives, please select the one you want to use: 0: OneDrive (business) id=b! gZgSN2Wux0C9L823fflVNq1Bp3h8h3tHvUCXmXNGYYSe7cGCw_HmRI773l1N4l-u Choose drive to use:>0 # # # Select 0. Here is the network disk information found by Rclone Found drive 'root' of type 'business', URL:  https://alpinerescueteam-my.sharepoint.com/personal/vircul_mail_anandaigueschools_org/Documents Is that okay? y) Yes (default) n) No Y/n>y # # # Select y -------------------- [Velin Cloud] type = onedrive token = drive_id = drive_type = -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote Y/e/d>y # # # Default y Current remotes: Name                 Type ====                 ==== Onedrive onedrive # # # Configuration is complete when this step appears e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config E/n/d/r/c/s/q>q # # # q Exit

So far, Rclone has successfully connected to OneDrive cloud disk

Configure Auto Upload Script

The Aria2 one click installation management script integrates the perfect configuration of Aria2. After installation, some additional function script function scripts will be attached. Rclone automatic upload script is one of them. Since it is not enabled by default, it needs to be enabled manually.

open /root/.aria2c/script.conf The configuration file is modified, with Chinese notes, according to your own actual situation, generally only the following two parts need to be modified.

 #Network disk name (the name filled in when RCLONE is configured. Note that it is case sensitive) drive-name=onedrive #Network disk directory. If it is left blank or commented, it is the root directory of the network disk, and there should be no slash at the end. drive-dir=/DRIVEX/Download

open /root/.aria2c/aria2.conf The configuration file is modified. Or use the manual modification option in the Aria2 one key installation management script to open the configuration file for modification. Find the "Command to execute after downloading" and replace clean.sh with upload.sh.

 on-download-complete=/root/.aria2c/upload.sh

Restart Aria2

 systemctl restart aria2

When you follow this tutorial without error, the downloaded files will be automatically uploaded to the corresponding network disk, and the local files will be automatically deleted.

Used with Aria2Ng

Since Aria2 is a command line back-end tool, it can bring a better experience with the front-end GUI visual interface. It is recommended to download the Aria2Ng panel to use with Aria2, download the compressed package to the root directory of the website, decompress the browser, and access the following interface.

Aria2Ng panel: https://github.com/mayswind/AriaNg/releases

 QQ Pinyin screenshot 20200718134334.png [download] Aria2+Rclone realizes offline download, which can be configured to automatically upload to OneDrive for wandering the Jianghu

RPC key can execute script ./aria2.sh Find the number input carriage return corresponding to the view configuration, copy the string behind the RPC key, paste it on the panel and reload it. If the RPC port is not modified, the default 6800 does not need to be modified, and the Aria2 status shows that it is connected and can be used.

In addition, it is recommended to use it with the Zdir directory program, which is an online file manager.

Title: [Download] Aria2+Rclone realizes offline download and can be configured to automatically upload to OneDrive
Author authorization: Unless otherwise specified, this document is written by Intoxicated with Chinese style Original compilation and authorization Intoxicated with Chinese style blog Publication.
Copyright notice: This article uses the "Signature Sharing 4.0 International in the Same Way" Creative Sharing Agreement. Please follow the signature agreement when reprinting or using.
Comment List (1) Comments
 Netizen nickname: Intoxicated with Chinese style
Intoxicated with Chinese style administrators 2020-07-18 reply
Forgot to write the source: https://voiin.com/37