diff --git a/README.md b/README.md index 566ce44..32dbd58 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,13 @@ Download DDL links, magnets and torrent files. `npm i -g rdcli` +And set your real-debrid account as enviroment variable on your `~/.bashrc` + +```bash +export REALDEBRID_USERNAME=your_username +export REALDEBRID_PASSWORD=your_password +``` + ## Usage `rdcli ` diff --git a/src/rdcli.js b/src/rdcli.js index a739362..66f8f2e 100644 --- a/src/rdcli.js +++ b/src/rdcli.js @@ -19,8 +19,8 @@ program .usage('') .action(arg => co(function* action() { try { - const username = yield prompt('Username: '); - const password = yield prompt.password('Password: '); + const username = process.env.REALDEBRID_USERNAME || (yield prompt('Username: ')); + const password = process.env.REALDEBRID_PASSWORD || (yield prompt.password('Password: ')); const token = yield getToken(username, password); let link;