torrent-online 1.5.0 → 1.5.1
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/package.json +1 -1
- package/wtui.js +11 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "torrent-online",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Stream .torrent / magnet to VLC or browser — torrent streaming for macOS/Linux without a torrent client. Стрим торрентов в VLC или браузер.",
|
|
6
6
|
"keywords": [
|
package/wtui.js
CHANGED
|
@@ -328,7 +328,7 @@ async function search1337x(q) {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
async function searchTPB(q, host = 'https://tpb.party') {
|
|
331
|
-
const r = await fetch(`${host}/search/${encodeURIComponent(q)}/0/99/
|
|
331
|
+
const r = await fetch(`${host}/search/${encodeURIComponent(q)}/0/99/0/`, {
|
|
332
332
|
headers: { 'user-agent': UA },
|
|
333
333
|
signal: AbortSignal.timeout(9000),
|
|
334
334
|
});
|
|
@@ -349,21 +349,21 @@ async function searchTPB(q, host = 'https://tpb.party') {
|
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
async function searchRutor(q) {
|
|
352
|
-
const r = await fetch(`https://rutor.info/
|
|
352
|
+
const r = await fetch(`https://rutor.info/search/0/0/0/0/${encodeURIComponent(q)}/`, {
|
|
353
353
|
headers: { 'user-agent': UA },
|
|
354
354
|
signal: AbortSignal.timeout(9000),
|
|
355
355
|
});
|
|
356
356
|
if (!r.ok) throw new Error(`Rutor: HTTP ${r.status}`);
|
|
357
|
-
const
|
|
358
|
-
const VIDEO = /фильм|сериал|мультип|аниме|телевизор|документ|спорт/i;
|
|
357
|
+
const html = await r.text();
|
|
359
358
|
const out = [];
|
|
360
|
-
for (const
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
359
|
+
for (const row of html.split('<tr class="gai">').slice(1, 26)) {
|
|
360
|
+
const magRaw = /href="(magnet:[^"]+)"/.exec(row)?.[1];
|
|
361
|
+
const name = decodeXml(/<a href="\/torrent\/\d+\/[^"]*">([^<]+)<\/a>/.exec(row)?.[1] || '');
|
|
362
|
+
if (!magRaw || !name) continue;
|
|
363
|
+
const size = decodeXml(/<td align="right">([\d.,]+) (GB|MB|KB|TB)/.exec(row)?.[0].replace('<td align="right">', '') || '')
|
|
364
|
+
.replace(/ /g, ' ').trim();
|
|
365
|
+
const seeds = Number(decodeXml(/<td align="center">\s*<img[^>]*u\.png[^>]*>\s*([\d.,]+)/.exec(row)?.[1] || '0').replace(/[^\d]/g, '')) || 0;
|
|
366
|
+
out.push({ name, mag: decodeXml(magRaw), size, seeds, src: 'Rutor' });
|
|
367
367
|
}
|
|
368
368
|
return out;
|
|
369
369
|
}
|