-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
38 lines (38 loc) · 2.57 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env node
const inquirer = require('inquirer')
var startingText = `
███████╗░█████╗░░██████╗██╗░░░██╗ ████████╗░█████╗░██████╗░██████╗░███████╗███╗░░██╗████████╗
██╔════╝██╔══██╗██╔════╝╚██╗░██╔╝ ╚══██╔══╝██╔══██╗██╔══██╗██╔══██╗██╔════╝████╗░██║╚══██╔══╝
█████╗░░███████║╚█████╗░░╚████╔╝░ ░░░██║░░░██║░░██║██████╔╝██████╔╝█████╗░░██╔██╗██║░░░██║░░░
██╔══╝░░██╔══██║░╚═══██╗░░╚██╔╝░░ ░░░██║░░░██║░░██║██╔══██╗██╔══██╗██╔══╝░░██║╚████║░░░██║░░░
███████╗██║░░██║██████╔╝░░░██║░░░ ░░░██║░░░╚█████╔╝██║░░██║██║░░██║███████╗██║░╚███║░░░██║░░░
╚══════╝╚═╝░░╚═╝╚═════╝░░░░╚═╝░░░ ░░░╚═╝░░░░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝╚══════╝╚═╝░░╚══╝░░░╚═╝░░░
`
console.log(startingText)
inquirer.prompt({
type: "list",
name:"TorrentProviderIsHere",
message: "Choose the torrent provider",
choices: ["ThePirateBay",
"Yts",
"KickassTorrents",
"Torrent9",
"Torrentz2",
"Limetorrents",
"TorrentProject",
"1337x",
"Rarbg",
"Eztv"]
}).then(answer => {
inquirer.prompt({
name: "TorrentNameAlr",
message: "Which torrent do you want?"
}).then(searchthisthing =>{
(async () => {
const TorrentSearchApi = require('torrent-search-api');
TorrentSearchApi.enableProvider(answer.TorrentProviderIsHere);
const magnet = await TorrentSearchApi.search(searchthisthing.TorrentNameAlr).catch(e => console.log(e))
console.log(magnet);
TorrentSearchApi.disableAllProviders();})();
})
})