resource-downloader

0.5.3 • Public • Published

web-resource-downlaoder

install

asciicast

npm -g i resource-downloader
rdcli #or resource-downloader 

feature

  • command line interface
  • local config, multiple remote configs
  • download multiple image resource -> zip
  • wide(width > height) images -> split half / half
    • swap split file order(split: left -> right, splitRight right -> left)
  • async operation(via stream);

config

rdconfig.json

sample

{
    "sites": [{
        "name": "Top Box Office (US)",
        "url":  "http://www.imdb.com/chart/boxoffice",
        "stages": [{
            "type": "list",
            "selector": "#boxoffice .titleColumn a",
            "attrs": {
                "value": "href"
            },
            "message": "select movie",
            "operation": {
                "type": "next"
            }
        }, {
            "type": "download",
            "selector": ".poster img",
            "attrs": {
                "value": "src"
            },
            "prefixes": {
                "doing": "[receiving] ",
                "done": "[received] ${0}"
            },
            "operation": {
                "type": "prev"
            }
        }]
    }],
    "remoteConfigs": []
}

typescript definition

interface Config {
    sites: Sites;
    remoteConfigs: string[];
}

Sites

remoteConfigs is url indicates rdconfig.json format text

loading order

  1. ./rdconfig.json
  2. ~/.config/rdconfig.json

etc

milestone

license

Apache 2.0

Readme

Keywords

none

Package Sidebar

Install

npm i resource-downloader

Weekly Downloads

1

Version

0.5.3

License

Apache 2.0

Last publish

Collaborators

  • deptno