Niwder-API

May 29, 2022 ยท View on GitHub

action status badge

 __    __  __                      __                      __           
|  \  |  \|  \                    |  \                    |  \          
| $$\ | $$ \$$ __   __   __   ____| $$  ______    ______   \$$  ______  
| $$$\| $$|  \|  \ |  \ |  \ /      $$ /      \  /      \ |  \ /      \
| $$$$\ $$| $$| $$ | $$ | $$|  $$$$$$$|  $$$$$$\|  $$$$$$\| $$|  $$$$$$\
| $$\$$ $$| $$| $$ | $$ | $$| $$  | $$| $$    $$| $$   \$$| $$| $$  | $$
| $$ \$$$$| $$| $$_/ $$_/ $$| $$__| $$| $$$$$$$$| $$ __   | $$| $$__/ $$
| $$  \$$$| $$ \$$   $$   $$ \$$    $$ \$$     \| $$|  \  | $$ \$$    $$
 \$$   \$$ \$$  \$$$$$\$$$$   \$$$$$$$  \$$$$$$$ \$$ \$$   \$$  \$$$$$$

image

Niwder-API

Niwder (a combo of words, NIWeera, DownloadER) is a long time dream of mine (actually I got this idea around 2017, thanks to nisalb), and I tried to realize this dream for years but to no avail until now.

Niwder is a system in three parts where,

  1. Niwder-API
  2. Niwder-Worker
  3. Niwder-UI

image

Currently, a user can add a Mega.nz file link, and get it converted to a Google Drive file link. Since handling a public faced Google Drive app authentication is a big hassle (you need to get the Drive app verified), I have used a dummy Google Drive account for storing the transferred Mega.nz file. In a future release, I will try to add a feature so that anyone can get their files straight into their Google Drive.

When a user add a Mega.nz file, the Niwder-API will queue the transfer job using Niwder-Worker and the Niwder-Worker will handle the transfer job and transfer the Mega.nz file to a pre-determined Google Drive. The Google Drive SDK will provide the pre-shared download link for the transferred file, and it will be visible in the Niwder-UI.

Niwder-UI and Niwder-API use Firebase for hosting and authentication.

image

This project uses WebTorrent for torrents transferring.

image

๐Ÿ”ฅ This project uses source code from checker.openwebtorrent.com by OpenWebTorrent.

๐ŸŽฏ This project uses Bull-Board by felixmosh to visualize queues and jobs currently running in Niwder.io system. Since there is no personal data collected, the Bull-Board job data is perfectly anonymized.

๐Ÿญ This project uses LogDNA and Winston for logging purposes.

Setting up Niwder-API

  1. Install Mega-CMD (this will be automatically done by Ansible script).
  2. Log in to Mega-CMD using your email and password.
  3. Add Firebase Service Account JSON file to /src/keys/ directory.
  4. Create Google oAuth client (learn how).
  5. Get a LogDNA Ingestion key (learn how).
  6. Add the following Environment Variables.
PORT=<number>
FIREBASE_API_KEY=<string>
REDIS_URL=<string>
GOOGLE_DRIVE_CLIENT_ID=<string>
GOOGLE_DRIVE_CLIENT_SECRET=<string>
BULL_UI_USERNAME=<string>
BULL_UI_PASSWORD=<string>
LOGDNA_INGESTION_KEY=<string>

Niwder API Specification (OpenAPI v3) is online and can be viewed from here.

New features to keep an eye on;

  • Google Drive link to Mega.nz link
  • Direct download link to Google Drive link
  • Direct download link to Mega.nz link
  • Google Drive link to direct download link
  • Mega.nz to direct download link
  • Torrents to Google Drive link
  • Torrents to Mega.nz link
  • Torrents to direct download link

Niwder-API is live on https://niwder-api.niweera.gq.
Niwder is live on https://niwder.niweera.gq.