tor-dl 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +53 -0
- package/README.md +255 -0
- package/bin/tordl.js +5 -0
- package/dist/bin/tordl.js +5 -0
- package/dist/bin/torrent-cli.js +5 -0
- package/dist/cli/display.d.ts +7 -0
- package/dist/cli/display.d.ts.map +1 -0
- package/dist/cli/display.js +58 -0
- package/dist/cli/display.js.map +1 -0
- package/dist/cli/parser.d.ts +5 -0
- package/dist/cli/parser.d.ts.map +1 -0
- package/dist/cli/parser.js +122 -0
- package/dist/cli/parser.js.map +1 -0
- package/dist/cli/progress.d.ts +15 -0
- package/dist/cli/progress.d.ts.map +1 -0
- package/dist/cli/progress.js +76 -0
- package/dist/cli/progress.js.map +1 -0
- package/dist/commands/download.d.ts +2 -0
- package/dist/commands/download.d.ts.map +1 -0
- package/dist/commands/download.js +70 -0
- package/dist/commands/download.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +46 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +32 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/download/engine.d.ts +6 -0
- package/dist/download/engine.d.ts.map +1 -0
- package/dist/download/engine.js +163 -0
- package/dist/download/engine.js.map +1 -0
- package/dist/filters/category.d.ts +3 -0
- package/dist/filters/category.d.ts.map +1 -0
- package/dist/filters/category.js +24 -0
- package/dist/filters/category.js.map +1 -0
- package/dist/filters/index.d.ts +5 -0
- package/dist/filters/index.d.ts.map +1 -0
- package/dist/filters/index.js +13 -0
- package/dist/filters/index.js.map +1 -0
- package/dist/filters/seeds.d.ts +3 -0
- package/dist/filters/seeds.d.ts.map +1 -0
- package/dist/filters/seeds.js +7 -0
- package/dist/filters/seeds.js.map +1 -0
- package/dist/filters/size.d.ts +4 -0
- package/dist/filters/size.d.ts.map +1 -0
- package/dist/filters/size.js +36 -0
- package/dist/filters/size.js.map +1 -0
- package/dist/filters/sort.d.ts +5 -0
- package/dist/filters/sort.d.ts.map +1 -0
- package/dist/filters/sort.js +25 -0
- package/dist/filters/sort.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/sources/1337x.d.ts +11 -0
- package/dist/sources/1337x.d.ts.map +1 -0
- package/dist/sources/1337x.js +121 -0
- package/dist/sources/1337x.js.map +1 -0
- package/dist/sources/eztv.d.ts +11 -0
- package/dist/sources/eztv.d.ts.map +1 -0
- package/dist/sources/eztv.js +104 -0
- package/dist/sources/eztv.js.map +1 -0
- package/dist/sources/httpClient.d.ts +24 -0
- package/dist/sources/httpClient.d.ts.map +1 -0
- package/dist/sources/httpClient.js +42 -0
- package/dist/sources/httpClient.js.map +1 -0
- package/dist/sources/limetorrent.d.ts +11 -0
- package/dist/sources/limetorrent.d.ts.map +1 -0
- package/dist/sources/limetorrent.js +113 -0
- package/dist/sources/limetorrent.js.map +1 -0
- package/dist/sources/nyaa.d.ts +11 -0
- package/dist/sources/nyaa.d.ts.map +1 -0
- package/dist/sources/nyaa.js +119 -0
- package/dist/sources/nyaa.js.map +1 -0
- package/dist/sources/rarbg.d.ts +11 -0
- package/dist/sources/rarbg.d.ts.map +1 -0
- package/dist/sources/rarbg.js +122 -0
- package/dist/sources/rarbg.js.map +1 -0
- package/dist/sources/registry.d.ts +9 -0
- package/dist/sources/registry.d.ts.map +1 -0
- package/dist/sources/registry.js +70 -0
- package/dist/sources/registry.js.map +1 -0
- package/dist/sources/solidtorrents.d.ts +11 -0
- package/dist/sources/solidtorrents.d.ts.map +1 -0
- package/dist/sources/solidtorrents.js +105 -0
- package/dist/sources/solidtorrents.js.map +1 -0
- package/dist/sources/thepiratebay.d.ts +11 -0
- package/dist/sources/thepiratebay.d.ts.map +1 -0
- package/dist/sources/thepiratebay.js +67 -0
- package/dist/sources/thepiratebay.js.map +1 -0
- package/dist/sources/torlock.d.ts +11 -0
- package/dist/sources/torlock.d.ts.map +1 -0
- package/dist/sources/torlock.js +116 -0
- package/dist/sources/torlock.js.map +1 -0
- package/dist/sources/torrentproject.d.ts +11 -0
- package/dist/sources/torrentproject.d.ts.map +1 -0
- package/dist/sources/torrentproject.js +105 -0
- package/dist/sources/torrentproject.js.map +1 -0
- package/dist/sources/torrentscsv.d.ts +11 -0
- package/dist/sources/torrentscsv.d.ts.map +1 -0
- package/dist/sources/torrentscsv.js +62 -0
- package/dist/sources/torrentscsv.js.map +1 -0
- package/dist/sources/yts.d.ts +12 -0
- package/dist/sources/yts.d.ts.map +1 -0
- package/dist/sources/yts.js +88 -0
- package/dist/sources/yts.js.map +1 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/filters.json +9 -0
- package/package.json +37 -0
- package/sources.json +105 -0
- package/src/cli/display.ts +58 -0
- package/src/cli/parser.ts +96 -0
- package/src/cli/progress.ts +78 -0
- package/src/commands/download.ts +36 -0
- package/src/commands/search.ts +53 -0
- package/src/commands/update.ts +30 -0
- package/src/download/engine.ts +177 -0
- package/src/filters/category.ts +26 -0
- package/src/filters/index.ts +4 -0
- package/src/filters/seeds.ts +5 -0
- package/src/filters/size.ts +42 -0
- package/src/filters/sort.ts +34 -0
- package/src/index.ts +10 -0
- package/src/sources/1337x.ts +85 -0
- package/src/sources/eztv.ts +70 -0
- package/src/sources/httpClient.ts +39 -0
- package/src/sources/limetorrent.ts +78 -0
- package/src/sources/nyaa.ts +85 -0
- package/src/sources/rarbg.ts +86 -0
- package/src/sources/registry.ts +70 -0
- package/src/sources/solidtorrents.ts +70 -0
- package/src/sources/thepiratebay.ts +65 -0
- package/src/sources/torlock.ts +82 -0
- package/src/sources/torrentproject.ts +70 -0
- package/src/sources/torrentscsv.ts +58 -0
- package/src/sources/yts.ts +85 -0
- package/src/types.d.ts +86 -0
- package/src/types.ts +65 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.RarBGScraper = void 0;
|
|
40
|
+
const axios_1 = __importDefault(require("axios"));
|
|
41
|
+
const cheerio = __importStar(require("cheerio"));
|
|
42
|
+
const httpClient_1 = require("./httpClient");
|
|
43
|
+
class RarBGScraper {
|
|
44
|
+
constructor() {
|
|
45
|
+
this.name = 'RarBG';
|
|
46
|
+
}
|
|
47
|
+
async search(query, category) {
|
|
48
|
+
try {
|
|
49
|
+
const catMap = { movie: '4', tv: '14' };
|
|
50
|
+
const catParam = category && catMap[category] ? `&category=${catMap[category]}` : '';
|
|
51
|
+
const url = `https://rarbg.to/torrents.php?search=${encodeURIComponent(query)}${catParam}`;
|
|
52
|
+
const { data } = await axios_1.default.get(url, {
|
|
53
|
+
headers: httpClient_1.DEFAULT_HEADERS,
|
|
54
|
+
timeout: httpClient_1.TIMEOUT
|
|
55
|
+
});
|
|
56
|
+
const $ = cheerio.load(data);
|
|
57
|
+
const results = [];
|
|
58
|
+
$('table.lista2 tr').each((i, el) => {
|
|
59
|
+
const titleEl = $(el).find('td:nth-child(2) a');
|
|
60
|
+
const title = titleEl.text().trim();
|
|
61
|
+
const size = $(el).find('td:nth-child(4)').text().trim();
|
|
62
|
+
const seeds = parseInt($(el).find('td:nth-child(5)').text().trim()) || 0;
|
|
63
|
+
const peers = parseInt($(el).find('td:nth-child(6)').text().trim()) || 0;
|
|
64
|
+
const link = 'https://rarbg.to' + (titleEl.attr('href') || '');
|
|
65
|
+
if (title && !title.includes('imdb') && !title.includes('tvcache')) {
|
|
66
|
+
results.push({
|
|
67
|
+
num: results.length + 1,
|
|
68
|
+
name: title,
|
|
69
|
+
size: size || 'Unknown',
|
|
70
|
+
sizeBytes: this.parseSize(size),
|
|
71
|
+
seeds,
|
|
72
|
+
peers,
|
|
73
|
+
source: 'RarBG',
|
|
74
|
+
url: link,
|
|
75
|
+
magnet: ''
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return results;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
83
|
+
console.error(`RarBG search error: ${message}`);
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async getTorrentUrl(result) {
|
|
88
|
+
try {
|
|
89
|
+
const { data } = await axios_1.default.get(result.url, { headers: httpClient_1.DEFAULT_HEADERS, timeout: httpClient_1.TIMEOUT });
|
|
90
|
+
const $ = cheerio.load(data);
|
|
91
|
+
const torrentUrl = $('a[href$=".torrent"]').attr('href');
|
|
92
|
+
return torrentUrl || '';
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return '';
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async getMagnet(result) {
|
|
99
|
+
try {
|
|
100
|
+
const { data } = await axios_1.default.get(result.url, { headers: httpClient_1.DEFAULT_HEADERS, timeout: httpClient_1.TIMEOUT });
|
|
101
|
+
const $ = cheerio.load(data);
|
|
102
|
+
return $('a[href^="magnet:"]').attr('href') || '';
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return '';
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
parseSize(size) {
|
|
109
|
+
if (!size)
|
|
110
|
+
return 0;
|
|
111
|
+
const match = size.toString().match(/([\d.]+)\s*(GB|MB|TB|KB)/i);
|
|
112
|
+
if (!match)
|
|
113
|
+
return 0;
|
|
114
|
+
const value = parseFloat(match[1]);
|
|
115
|
+
const unit = match[2].toUpperCase();
|
|
116
|
+
const multipliers = { 'KB': 1024, 'MB': 1024 ** 2, 'GB': 1024 ** 3, 'TB': 1024 ** 4 };
|
|
117
|
+
return value * (multipliers[unit] || 1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.RarBGScraper = RarBGScraper;
|
|
121
|
+
exports.default =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AC,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,WAAW,GAA2B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,IAAE,CAAC,EAAE,IAAI,EAAE,IAAI,IAAE,CAAC,EAAE,IAAI,EAAE,IAAI,IAAE,CAAC,EAAE,CAAC;QACxG,OAAO,KAAK,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF;AA9ED,oCA8EC;AAED,kBAAe,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SourcesJSON, SourceConfig, SourceScraper } from '../types';
|
|
2
|
+
declare const scrapers: Record<string, SourceScraper>;
|
|
3
|
+
export declare function loadSourcesConfig(): SourcesJSON;
|
|
4
|
+
export declare function getEnabledSources(): SourceScraper[];
|
|
5
|
+
export declare function getSourceConfig(name: string): SourceConfig | undefined;
|
|
6
|
+
export declare function getUpdateUrl(): string;
|
|
7
|
+
export declare function getAllScrapers(): Record<string, SourceScraper>;
|
|
8
|
+
export { scrapers };
|
|
9
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/sources/registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAcpE,QAAA,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAY3C,CAAC;AAEF,wBAAgB,iBAAiB,IAAI,WAAW,CAM/C;AAED,wBAAgB,iBAAiB,IAAI,aAAa,EAAE,CAenD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAGtE;AAED,wBAAgB,YAAY,IAAI,MAAM,CAGrC;AAED,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAE9D;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.scrapers = void 0;
|
|
7
|
+
exports.loadSourcesConfig = loadSourcesConfig;
|
|
8
|
+
exports.getEnabledSources = getEnabledSources;
|
|
9
|
+
exports.getSourceConfig = getSourceConfig;
|
|
10
|
+
exports.getUpdateUrl = getUpdateUrl;
|
|
11
|
+
exports.getAllScrapers = getAllScrapers;
|
|
12
|
+
const fs_1 = require("fs");
|
|
13
|
+
const path_1 = require("path");
|
|
14
|
+
const eztv_1 = __importDefault(require("./eztv"));
|
|
15
|
+
const solidtorrents_1 = __importDefault(require("./solidtorrents"));
|
|
16
|
+
const thepiratebay_1 = __importDefault(require("./thepiratebay"));
|
|
17
|
+
const torlock_1 = __importDefault(require("./torlock"));
|
|
18
|
+
const torrentproject_1 = __importDefault(require("./torrentproject"));
|
|
19
|
+
const torrentscsv_1 = __importDefault(require("./torrentscsv"));
|
|
20
|
+
const limetorrent_1 = __importDefault(require("./limetorrent"));
|
|
21
|
+
const _1337x_1 = __importDefault(require("./1337x"));
|
|
22
|
+
const rarbg_1 = __importDefault(require("./rarbg"));
|
|
23
|
+
const yts_1 = __importDefault(require("./yts"));
|
|
24
|
+
const nyaa_1 = __importDefault(require("./nyaa"));
|
|
25
|
+
const scrapers = {
|
|
26
|
+
eztv: eztv_1.default,
|
|
27
|
+
solidtorrents: solidtorrents_1.default,
|
|
28
|
+
thepiratebay: thepiratebay_1.default,
|
|
29
|
+
torlock: torlock_1.default,
|
|
30
|
+
torrentproject: torrentproject_1.default,
|
|
31
|
+
torrentscsv: torrentscsv_1.default,
|
|
32
|
+
limetorrent: limetorrent_1.default,
|
|
33
|
+
'1337x': _1337x_1.default,
|
|
34
|
+
rarbg: rarbg_1.default,
|
|
35
|
+
yts: yts_1.default,
|
|
36
|
+
nyaa: nyaa_1.default
|
|
37
|
+
};
|
|
38
|
+
exports.scrapers = scrapers;
|
|
39
|
+
function loadSourcesConfig() {
|
|
40
|
+
const sourcesPath = (0, path_1.join)(process.cwd(), 'sources.json');
|
|
41
|
+
if ((0, fs_1.existsSync)(sourcesPath)) {
|
|
42
|
+
return JSON.parse((0, fs_1.readFileSync)(sourcesPath, 'utf-8'));
|
|
43
|
+
}
|
|
44
|
+
return { updateUrl: '', version: '1.0.0', sources: {} };
|
|
45
|
+
}
|
|
46
|
+
function getEnabledSources() {
|
|
47
|
+
const config = loadSourcesConfig();
|
|
48
|
+
const enabled = [];
|
|
49
|
+
for (const [key, sourceConfig] of Object.entries(config.sources)) {
|
|
50
|
+
if (sourceConfig.enabled && scrapers[key]) {
|
|
51
|
+
enabled.push(scrapers[key]);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (enabled.length === 0) {
|
|
55
|
+
return Object.values(scrapers);
|
|
56
|
+
}
|
|
57
|
+
return enabled;
|
|
58
|
+
}
|
|
59
|
+
function getSourceConfig(name) {
|
|
60
|
+
const config = loadSourcesConfig();
|
|
61
|
+
return config.sources[name];
|
|
62
|
+
}
|
|
63
|
+
function getUpdateUrl() {
|
|
64
|
+
const config = loadSourcesConfig();
|
|
65
|
+
return config.updateUrl;
|
|
66
|
+
}
|
|
67
|
+
function getAllScrapers() {
|
|
68
|
+
return scrapers;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/sources/registry.ts"],"names":[],"mappings":";;;;;;AA8BA,8CAMC;AAED,8CAeC;AAED,0CAGC;AAED,oCAGC;AAED,wCAE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Q,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAgB,eAAe,CAAC,IAAY;IAC1C,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;IACnC,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,SAAgB,YAAY;IAC1B,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC;AAC1B,CAAC;AAED,SAAgB,cAAc;IAC5B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TorrentResult, SourceScraper } from '../types';
|
|
2
|
+
export declare class SolidTorrentsScraper implements SourceScraper {
|
|
3
|
+
name: string;
|
|
4
|
+
search(query: string, category?: string): Promise<TorrentResult[]>;
|
|
5
|
+
getTorrentUrl(result: TorrentResult): Promise<string>;
|
|
6
|
+
getMagnet(result: TorrentResult): Promise<string>;
|
|
7
|
+
private parseSize;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: SolidTorrentsScraper;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=solidtorrents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidtorrents.d.ts","sourceRoot":"","sources":["../../src/sources/solidtorrents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGxD,qBAAa,oBAAqB,YAAW,aAAa;IACxD,IAAI,SAAmB;IAEjB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IA0ClE,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAIrD,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvD,OAAO,CAAC,SAAS;CASlB;;AAED,wBAA0C"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.SolidTorrentsScraper = void 0;
|
|
40
|
+
const axios_1 = __importDefault(require("axios"));
|
|
41
|
+
const cheerio = __importStar(require("cheerio"));
|
|
42
|
+
const httpClient_1 = require("./httpClient");
|
|
43
|
+
class SolidTorrentsScraper {
|
|
44
|
+
constructor() {
|
|
45
|
+
this.name = 'SolidTorrents';
|
|
46
|
+
}
|
|
47
|
+
async search(query, category) {
|
|
48
|
+
try {
|
|
49
|
+
const url = `https://solidtorrents.to/search?q=${encodeURIComponent(query)}`;
|
|
50
|
+
const { data } = await axios_1.default.get(url, {
|
|
51
|
+
headers: httpClient_1.DEFAULT_HEADERS,
|
|
52
|
+
timeout: httpClient_1.TIMEOUT
|
|
53
|
+
});
|
|
54
|
+
const $ = cheerio.load(data);
|
|
55
|
+
const results = [];
|
|
56
|
+
$('div[data-href^="/torrent/"]').each((i, el) => {
|
|
57
|
+
const title = $(el).find('a.torrent-title').text().trim();
|
|
58
|
+
const size = $(el).find('span[data-size]').attr('data-size') || 'Unknown';
|
|
59
|
+
const seeds = parseInt($(el).find('span.seed-count').text().trim()) || 0;
|
|
60
|
+
const peers = parseInt($(el).find('span.leech-count').text().trim()) || 0;
|
|
61
|
+
const link = 'https://solidtorrents.to' + $(el).find('a.torrent-title').attr('href');
|
|
62
|
+
const magnet = $(el).find('a[href^="magnet:"]').attr('href');
|
|
63
|
+
if (title) {
|
|
64
|
+
results.push({
|
|
65
|
+
num: results.length + 1,
|
|
66
|
+
name: title,
|
|
67
|
+
size,
|
|
68
|
+
sizeBytes: this.parseSize(size),
|
|
69
|
+
seeds,
|
|
70
|
+
peers,
|
|
71
|
+
source: 'SolidTorrents',
|
|
72
|
+
url: link,
|
|
73
|
+
magnet
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return results;
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
81
|
+
console.error(`SolidTorrents search error: ${message}`);
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async getTorrentUrl(result) {
|
|
86
|
+
return result.url;
|
|
87
|
+
}
|
|
88
|
+
async getMagnet(result) {
|
|
89
|
+
return result.magnet || '';
|
|
90
|
+
}
|
|
91
|
+
parseSize(size) {
|
|
92
|
+
if (!size || size === 'Unknown')
|
|
93
|
+
return 0;
|
|
94
|
+
const match = size.toString().match(/([\d.]+)\s*(GB|MB|TB|KB)/i);
|
|
95
|
+
if (!match)
|
|
96
|
+
return 0;
|
|
97
|
+
const value = parseFloat(match[1]);
|
|
98
|
+
const unit = match[2].toUpperCase();
|
|
99
|
+
const multipliers = { 'KB': 1024, 'MB': 1024 ** 2, 'GB': 1024 ** 3, 'TB': 1024 ** 4 };
|
|
100
|
+
return value * (multipliers[unit] || 1);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.SolidTorrentsScraper = SolidTorrentsScraper;
|
|
104
|
+
exports.default = new SolidTorrentsScraper();
|
|
105
|
+
//# sourceMappingURL=solidtorrents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidtorrents.js","sourceRoot":"","sources":["../../src/sources/solidtorrents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iDAAmC;AAEnC,6CAAwD;AAExD,MAAa,oBAAoB;IAAjC;QACE,SAAI,GAAG,eAAe,CAAC;IA6DzB,CAAC;IA3DC,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,QAAiB;QAC3C,IAAI,CAAC;YAC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AI,EAAE,IAAI,EAAE,IAAI,IAAE,CAAC,EAAE,IAAI,EAAE,IAAI,IAAE,CAAC,EAAE,IAAI,EAAE,IAAI,IAAE,CAAC,EAAE,CAAC;QACxG,OAAO,KAAK,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF;AA9DD,oDA8DC;AAED,kBAAe,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TorrentResult, SourceScraper } from '../types';
|
|
2
|
+
export declare class ThePirateBayScraper implements SourceScraper {
|
|
3
|
+
name: string;
|
|
4
|
+
search(query: string, category?: string): Promise<TorrentResult[]>;
|
|
5
|
+
getTorrentUrl(result: TorrentResult): Promise<string>;
|
|
6
|
+
getMagnet(result: TorrentResult): Promise<string>;
|
|
7
|
+
private formatSize;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: ThePirateBayScraper;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=thepiratebay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thepiratebay.d.ts","sourceRoot":"","sources":["../../src/sources/thepiratebay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAOxD,qBAAa,mBAAoB,YAAW,aAAa;IACvD,IAAI,SAAkB;IAEhB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAkClE,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAIrD,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvD,OAAO,CAAC,UAAU;CASnB;;AAED,wBAAyC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ThePirateBayScraper = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const httpClient_1 = require("./httpClient");
|
|
9
|
+
const API_URL = 'https://apibay.org/q.php';
|
|
10
|
+
const CAT_MAP = { movie: '201', tv: '205', music: '102', games: '400', apps: '300' };
|
|
11
|
+
class ThePirateBayScraper {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.name = 'ThePirateBay';
|
|
14
|
+
}
|
|
15
|
+
async search(query, category) {
|
|
16
|
+
try {
|
|
17
|
+
const cat = category && CAT_MAP[category] ? CAT_MAP[category] : '0';
|
|
18
|
+
const url = `${API_URL}?q=${encodeURIComponent(query)}&cat=${cat}&limit=100`;
|
|
19
|
+
const { data } = await axios_1.default.get(url, {
|
|
20
|
+
headers: httpClient_1.DEFAULT_HEADERS,
|
|
21
|
+
timeout: httpClient_1.TIMEOUT
|
|
22
|
+
});
|
|
23
|
+
if (!Array.isArray(data))
|
|
24
|
+
return [];
|
|
25
|
+
const results = data.slice(0, 50).map((item) => ({
|
|
26
|
+
num: 0,
|
|
27
|
+
name: item.name,
|
|
28
|
+
size: this.formatSize(parseInt(item.size)),
|
|
29
|
+
sizeBytes: parseInt(item.size),
|
|
30
|
+
seeds: parseInt(item.seeders) || 0,
|
|
31
|
+
peers: parseInt(item.leechers) || 0,
|
|
32
|
+
source: 'ThePirateBay',
|
|
33
|
+
url: `https://thepiratebay.org/torrent/${item.id}`,
|
|
34
|
+
magnet: `magnet:?xt=urn:btih:${item.info_hash}`,
|
|
35
|
+
hash: item.info_hash
|
|
36
|
+
}));
|
|
37
|
+
results.forEach((r, i) => r.num = i + 1);
|
|
38
|
+
return results;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
42
|
+
console.error(`ThePirateBay search error: ${message}`);
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async getTorrentUrl(result) {
|
|
47
|
+
return result.url;
|
|
48
|
+
}
|
|
49
|
+
async getMagnet(result) {
|
|
50
|
+
return result.magnet || '';
|
|
51
|
+
}
|
|
52
|
+
formatSize(bytes) {
|
|
53
|
+
const gb = bytes / (1024 ** 3);
|
|
54
|
+
if (gb >= 1)
|
|
55
|
+
return `${gb.toFixed(2)} GB`;
|
|
56
|
+
const mb = bytes / (1024 ** 2);
|
|
57
|
+
if (mb >= 1)
|
|
58
|
+
return `${mb.toFixed(2)} MB`;
|
|
59
|
+
const kb = bytes / 1024;
|
|
60
|
+
if (kb >= 1)
|
|
61
|
+
return `${kb.toFixed(2)} KB`;
|
|
62
|
+
return `${bytes} B`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.ThePirateBayScraper = ThePirateBayScraper;
|
|
66
|
+
exports.default = new ThePirateBayScraper();
|
|
67
|
+
//# sourceMappingURL=thepiratebay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thepiratebay.js","sourceRoot":"","sources":["../../src/sources/thepiratebay.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,6CAAwD;AAExD,MAAM,OAAO,GAAG,0BAA0B,CAAC;AAE3C,MAAM,OAAO,GAA2B,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAE7G,MAAa,mBAAmB;IAAhC;QACE,SAAI,GAAG,cAAc,CAAC;IAqDxB,CAAC;IAnDC,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,QAAiB;QAC3C,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,QAAQ,IAAI,OAAO,CAAC,QAAQ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;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YACzE,OAAO,CAAC,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;YACvD,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAqB;QACvC,OAAO,MAAM,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAAqB;QACnC,OAAO,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;IAC7B,CAAC;IAEO,UAAU,CAAC,KAAa;QAC9B,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,IAAI,IAAE,CAAC,CAAC,CAAC;QAC7B,IAAI,EAAE,IAAI,CAAC;YAAE,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;QAC1C,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,IAAI,IAAE,CAAC,CAAC,CAAC;QAC7B,IAAI,EAAE,IAAI,CAAC;YAAE,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;QAC1C,MAAM,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC;QACxB,IAAI,EAAE,IAAI,CAAC;YAAE,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;QAC1C,OAAO,GAAG,KAAK,IAAI,CAAC;IACtB,CAAC;CACF;AAtDD,kDAsDC;AAED,kBAAe,IAAI,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TorrentResult, SourceScraper } from '../types';
|
|
2
|
+
export declare class TorLockScraper implements SourceScraper {
|
|
3
|
+
name: string;
|
|
4
|
+
search(query: string, category?: string): Promise<TorrentResult[]>;
|
|
5
|
+
getTorrentUrl(result: TorrentResult): Promise<string>;
|
|
6
|
+
getMagnet(result: TorrentResult): Promise<string>;
|
|
7
|
+
private parseSize;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: TorLockScraper;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=torlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"torlock.d.ts","sourceRoot":"","sources":["../../src/sources/torlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAUxD,qBAAa,cAAe,YAAW,aAAa;IAClD,IAAI,SAAa;IAEX,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAyClE,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAIrD,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAUvD,OAAO,CAAC,SAAS;CASlB;;AAED,wBAAoC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.TorLockScraper = void 0;
|
|
40
|
+
const axios_1 = __importDefault(require("axios"));
|
|
41
|
+
const cheerio = __importStar(require("cheerio"));
|
|
42
|
+
const httpClient_1 = require("./httpClient");
|
|
43
|
+
const AD_KEYWORDS = ['vpn', 'service', 'banner', 'advertisement', 'sponsored', 'aclib', 'zoneid'];
|
|
44
|
+
function isAdContent(title) {
|
|
45
|
+
const lower = title.toLowerCase();
|
|
46
|
+
return AD_KEYWORDS.some(keyword => lower.includes(keyword));
|
|
47
|
+
}
|
|
48
|
+
class TorLockScraper {
|
|
49
|
+
constructor() {
|
|
50
|
+
this.name = 'TorLock';
|
|
51
|
+
}
|
|
52
|
+
async search(query, category) {
|
|
53
|
+
try {
|
|
54
|
+
const url = `https://www.torlock.com/all/torrents/${encodeURIComponent(query)}.html`;
|
|
55
|
+
const { data } = await axios_1.default.get(url, {
|
|
56
|
+
headers: httpClient_1.DEFAULT_HEADERS,
|
|
57
|
+
timeout: httpClient_1.TIMEOUT
|
|
58
|
+
});
|
|
59
|
+
const $ = cheerio.load(data);
|
|
60
|
+
const results = [];
|
|
61
|
+
$('table tbody tr').each((i, el) => {
|
|
62
|
+
const title = $(el).find('td:nth-child(2) a').text().trim();
|
|
63
|
+
const size = $(el).find('td:nth-child(3)').text().trim();
|
|
64
|
+
const seeds = parseInt($(el).find('td:nth-child(4)').text().trim()) || 0;
|
|
65
|
+
const peers = parseInt($(el).find('td:nth-child(5)').text().trim()) || 0;
|
|
66
|
+
const link = 'https://www.torlock.com' + ($(el).find('td:nth-child(2) a').attr('href') || '');
|
|
67
|
+
if (title && !isAdContent(title)) {
|
|
68
|
+
results.push({
|
|
69
|
+
num: results.length + 1,
|
|
70
|
+
name: title,
|
|
71
|
+
size: size || 'Unknown',
|
|
72
|
+
sizeBytes: this.parseSize(size),
|
|
73
|
+
seeds,
|
|
74
|
+
peers,
|
|
75
|
+
source: 'TorLock',
|
|
76
|
+
url: link,
|
|
77
|
+
magnet: ''
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
return results;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
85
|
+
console.error(`TorLock search error: ${message}`);
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async getTorrentUrl(result) {
|
|
90
|
+
return result.url;
|
|
91
|
+
}
|
|
92
|
+
async getMagnet(result) {
|
|
93
|
+
try {
|
|
94
|
+
const { data } = await axios_1.default.get(result.url, { headers: httpClient_1.DEFAULT_HEADERS, timeout: httpClient_1.TIMEOUT });
|
|
95
|
+
const $ = cheerio.load(data);
|
|
96
|
+
return $('a[href^="magnet:"]').attr('href') || '';
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return '';
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
parseSize(size) {
|
|
103
|
+
if (!size)
|
|
104
|
+
return 0;
|
|
105
|
+
const match = size.toString().match(/([\d.]+)\s*(GB|MB|TB|KB)/i);
|
|
106
|
+
if (!match)
|
|
107
|
+
return 0;
|
|
108
|
+
const value = parseFloat(match[1]);
|
|
109
|
+
const unit = match[2].toUpperCase();
|
|
110
|
+
const multipliers = { 'KB': 1024, 'MB': 1024 ** 2, 'GB': 1024 ** 3, 'TB': 1024 ** 4 };
|
|
111
|
+
return value * (multipliers[unit] || 1);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.TorLockScraper = TorLockScraper;
|
|
115
|
+
exports.default = new TorLockScraper();
|
|
116
|
+
//# sourceMappingURL=torlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"torlock.js","sourceRoot":"","sources":["../../src/sources/torlock.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iDAAmC;AAEnC,6CAAwD;AAExD,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAElG,SAAS,WAAW,CAAC,KAAa;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAClC,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,MAAa,cAAc;IAA3B;QACE,SAAI,GAAG,SAAS,CAAC;IAkEnB,CAAC;IAhEC,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,QAAiB;QAC3C,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,wCAAwC,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC;YACrF,M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YAAE,OAAO,CAAC,CAAC;QACrB,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,WAAW,GAA2B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,IAAE,CAAC,EAAE,IAAI,EAAE,IAAI,IAAE,CAAC,EAAE,IAAI,EAAE,IAAI,IAAE,CAAC,EAAE,CAAC;QACxG,OAAO,KAAK,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF;AAnED,wCAmEC;AAED,kBAAe,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TorrentResult, SourceScraper } from '../types';
|
|
2
|
+
export declare class TorrentProjectScraper implements SourceScraper {
|
|
3
|
+
name: string;
|
|
4
|
+
search(query: string, category?: string): Promise<TorrentResult[]>;
|
|
5
|
+
getTorrentUrl(result: TorrentResult): Promise<string>;
|
|
6
|
+
getMagnet(result: TorrentResult): Promise<string>;
|
|
7
|
+
private parseSize;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: TorrentProjectScraper;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=torrentproject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"torrentproject.d.ts","sourceRoot":"","sources":["../../src/sources/torrentproject.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGxD,qBAAa,qBAAsB,YAAW,aAAa;IACzD,IAAI,SAAoB;IAElB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IA0ClE,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAIrD,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvD,OAAO,CAAC,SAAS;CASlB;;AAED,wBAA2C"}
|