Skip to content

Commit

Permalink
Print links only
Browse files Browse the repository at this point in the history
  • Loading branch information
ston3o committed Jun 17, 2018
1 parent ba1767e commit a0b11d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rdcli.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ program
.version(pjson.version)
.description('Download links, magnets and torrent files.')
.usage('<url|magnet|torrent>')
.option('-p, --print', 'Print unrestricted link only')
.action(async (arg) => {
try {
const username = process.env.REALDEBRID_USERNAME || (await prompt('Username: '));
Expand All @@ -33,9 +34,14 @@ program
}

const unrestrictLink = await unrestrict(link, token);

if (program.print) {
console.log(unrestrictLink);
process.exit(0);
}

console.log(`Start download : ${unrestrictLink}`);
await waitDuringScan(link);

const spinner = ora('Download: 0.0% Speed: 0Mbps').start();
download(unrestrictLink, (res) => {
if (res.percent) {
Expand Down

0 comments on commit a0b11d3

Please sign in to comment.