Skip to content

staugur/down2local

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

down2local

Download transit program to help you download remote resources through an intermediate service.

(CN:下载中转程序,帮助你通过一个中间服务下载远程资源!)

down2local.png

Deploy (Production)

1. download

git clone https://github.com/staugur/down2local.git
cd down2local

2. install

  • 2.1 dependencies

    yarn --prod
  • 2.2 pm2/forever(Choose one)

    • 2.2.1 pm2

      sudo yarn global add pm2 # or local install with `yarn add pm2`
    • 2.2.2 forever

      sudo yarn global add forever # or local install with `yarn add forever`

3. process manager

App default listen on 127.0.0.1:5201, you can set it on config.json

  • 3.1 pm2

    yarn pm2:[start/stop/restart/reload]
  • 3.2 forever

    yarn fe:[start/stop/restart]
  • 3.3 docker

    • Build Docker Image:

      docker build -t down2local .
      //or
      docker pull staugur/down2local
    • Run Container

      docker run -d --name down2local --restart=always --net=host staugur/down2local

4. Nginx (optional)

server {
    listen 80;
    server_name YOUR-DOMAIN-NAME;
    charset utf-8;
    location / {
       proxy_pass http://127.0.0.1:5201;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Usage

  1. download with query

    wget --content-disposition YOUR-DOMAIN-NAME/get?url=YOUR-DOWNLOAD-URL
    curl -O YOUR-DOMAIN-NAME/get?url=YOUR-DOWNLOAD-URL
  2. download with pathname(recommend)

    wget YOUR-DOMAIN-NAME/get/YOUR-DOWNLOAD-URL
    curl -O YOUR-DOMAIN-NAME/get/YOUR-DOWNLOAD-URL

Development

yarn      # install all dependencies
yarn dev  # start app with auto reload