From c590599d3b5801b98cc4eaa27eb0f4295e6e7569 Mon Sep 17 00:00:00 2001 From: jcherqui Date: Tue, 28 Feb 2017 17:09:40 +0100 Subject: [PATCH] Store logins on enviroment variables --- README.md | 7 +++++++ src/rdcli.js | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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;