https://github.com/danmindru/cncnet-map-downloader.js
Downloads & unzips all cncnet maps for a given command and conquer game (i.e. Yuri's Revenge)
https://github.com/danmindru/cncnet-map-downloader.js
cli cncnet command-and-conquer command-line-tool linux macos redalert redalert2 tiberian-dawn tiberian-sun windows yuri yurisrevenge
Last synced: 11 months ago
JSON representation
Downloads & unzips all cncnet maps for a given command and conquer game (i.e. Yuri's Revenge)
- Host: GitHub
- URL: https://github.com/danmindru/cncnet-map-downloader.js
- Owner: danmindru
- Created: 2019-06-17T20:13:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T04:43:12.000Z (over 3 years ago)
- Last Synced: 2025-06-29T11:48:17.865Z (12 months ago)
- Topics: cli, cncnet, command-and-conquer, command-line-tool, linux, macos, redalert, redalert2, tiberian-dawn, tiberian-sun, windows, yuri, yurisrevenge
- Language: JavaScript
- Homepage:
- Size: 173 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/cncnet-map-downloader.js)
# cncnet-map-downloader.js ⬇️💻
Downloads all maps from [cncnet.org](https://cncnet.org) into a directory of your choice.
### Usage
Grab the latest binary release on [the release page](https://github.com/danmindru/cncnet-map-downloader.js/releases) 💽.
Double-click your favorite executable or run the executable through the command line. You will be guided through the options (see demo).
- By default, it only downloads Yuri (yr) maps, but can be configured to download other types. See config below.
- If the process is somehow killed, it will resume downloading maps that haven't been downloaded yet (skips previously downlaoded maps).
- It sorts maps in directories by name (alpha numeric).
- It checks for duplicate maps (size, id, sha).
### Demo

| Windows preview | Mac preview |
| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
|
#### Build it yourself
Clone the repo, then run `npm install`.
You can start a download with `npm run download`. Downloads can be configured in `package.json` under scripts.
### Configuration
You can configure the downloader through enviornment variables.
- `MAP_AGE` - the age of the map in months (default: not specified - will get all). Example: `12` will get maps that are 1 year old and newer.
- `GAME_TYPE` - the type of maps to download (default: `yr`). Available: `ts`, `ra`, `d2`, `td`, `dta`.
- `DESTINATION_DIR` - the location to download files (default: `cncnet-maps`).
#### Configuration examples
- Get all Yuri's Revenge / Red Alert 2 maps in a custom directory
```bash
DESTINATION_DIR=my-yuri-maps ./cncnet-map-downloader-js-x-x-x-macos
```
- Get all Red alert maps
```bash
GAME_TYPE=ra ./cncnet-map-downloader-js-x-x-x-macos
```
- Get all Tiberian Sun maps, not older than 1 year
```bash
GAME_TYPE=ts MAP_AGE=12 ./cncnet-map-downloader-js-x-x-x-macos
```
##### Dev config
- `RUN_UNPACKAGED` - run the script in unpacked mode[1] (default: `false`; see `npm run download` in `package.json` for an example).
- `DEBUG` - print additional debug info.
> [1] essentially, run the non-binary script. Requires node v12.9+ & `npm install`
### About the method
Uses the cncnet search endpoint to retrieve all existing maps, then requests each map zip individually with a delay to be nice on the server.
Previously, scarping was considered, but not necessary at this point in time.
### Debugging
Run
```
DEBUG=true MAX_NUMBER_OF_MAPS=5 REQUEST_DELAY=5000 MAP_AGE=1 RUN_UNPACKAGED=true GAME_TYPE=yr DESTINATION_DIR=./cncnet-yuri-maps node --inspect-brk ./scripts/main.js
```
And open `chrome://inspect` to debug the node process.
### Other art
Check out the [cncnet search](https://mapdb.cncnet.org/search/?game=yr&search=), where you can search and download maps.