{"id":34547436,"url":"https://github.com/xusd320/downtune.js","last_synced_at":"2026-05-27T00:32:35.048Z","repository":{"id":57215738,"uuid":"186357344","full_name":"xusd320/downtune.js","owner":"xusd320","description":"download some files with the way like a web spider","archived":false,"fork":false,"pushed_at":"2022-03-08T15:01:30.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-19T16:56:32.312Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xusd320.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-13T06:19:36.000Z","updated_at":"2022-03-08T14:53:45.000Z","dependencies_parsed_at":"2022-08-26T13:31:40.208Z","dependency_job_id":null,"html_url":"https://github.com/xusd320/downtune.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xusd320/downtune.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xusd320%2Fdowntune.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xusd320%2Fdowntune.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xusd320%2Fdowntune.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xusd320%2Fdowntune.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xusd320","download_url":"https://codeload.github.com/xusd320/downtune.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xusd320%2Fdowntune.js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33545458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T07:29:09.108Z","updated_at":"2026-05-27T00:32:35.031Z","avatar_url":"https://github.com/xusd320.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# downtune.js\nA web crawler based on nodejs, supports concurrency control, url deduplication, request retry and etc..., anything else which [request](https://www.npmjs.com/package/request) supports.\n\nParse html with [cheerio](https://www.npmjs.com/package/cheerio) which works like jQuery selector, is compatible with json response.\n\nLook over the ./test/test.js or ***npm run test***  for example. \n\nWe can use it to generate a web spider like blow:\n\n```js\n'use strict';\nconst url = require('url');\nconst downtune = require('downtune.js');\nconst fs = require('fs');\n\nconst host = 'https://www.coolapk.com/';\n\nconst coolapk = {\n  log_level: 'debug', // log_level:\n  concurrency: 10, // concurrency control\n  retry : 10, // max retry times for failed request\n  timeout : 10, // request timeout use seconds\n  entry: {    // entry config\n  reqOpt : 'https://www.coolapk.com/', // request options like url, headers, method\\(GET or POST\\), proxy and etc...\n    link : $ =\u003e ({  // crawler will extract urls from webpage by 'link' property and add these urls to crawler urls queue, $ is a cheerio instance\n      list :  url.resolve(host, $('#navbar-apk a').attr('href')) // 'list' property as a tag for specific classification of some webpage those share some common features\n    })\n  },\n  list : {\n    link : $ =\u003e ({\n      app1 : $('.type_tag a').map((i, e) =\u003e encodeURI(url.resolve(host, $(e).attr('href')))).get().slice(0, 5),\n      app2 : $('.type_tag a').map((i, e) =\u003e encodeURI(url.resolve(host, $(e).attr('href')))).get().slice(6, 10)\n    })\n  },\n  app1 : {\n    link : $ =\u003e ({ \n      apk : url.resolve(host, $('.app_list_left a').eq(0).attr('href'))\n    })\n  }, \n  app2 : {\n    link : $ =\u003e ({ \n      apk : url.resolve(host, $('.app_list_left a').eq(0).attr('href'))\n    })\n  }, \n  apk : {\n    item : async $ =\u003e { // crawler will deal with 'item' property as information you want to extract from webpage, you can make custom procedure as you want. \n      const path = './' +  $('.detail_app_title').text().replace(/\\s/g,'-').replace(/\\//g,'.') + '.apk';\n      const uri = $('script:contains(onDownloadApk)').text().match('\"(.*from=click)\"')[1];\n      console.log(`Downloading item : ${ path } : ${ uri }`);\n    }\n  }\n};\n\nconst D = new downtune(coolapk);\nD.start().then(() =\u003e console.log('finish'));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxusd320%2Fdowntune.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxusd320%2Fdowntune.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxusd320%2Fdowntune.js/lists"}