torrent-online 1.4.6 → 1.4.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/wtui.js +34 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "torrent-online",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
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
@@ -259,6 +259,39 @@ function makeServer(torrent, base) {
259
259
  // ---- Поиск индексаторов ----
260
260
  const TRANSLIT = { а:'a',б:'b',в:'v',г:'g',д:'d',е:'e',ё:'e',ж:'zh',з:'z',и:'i',й:'y',к:'k',л:'l',м:'m',н:'n',о:'o',п:'p',р:'r',с:'s',т:'t',у:'u',ф:'f',х:'kh',ц:'ts',ч:'ch',ш:'sh',щ:'shch',ъ:'',ы:'y',ь:'',э:'e',ю:'yu',я:'ya' };
261
261
  function translit(s) { return s.toLowerCase().split('').map(c => TRANSLIT[c] ?? c).join(''); }
262
+
263
+ // RU->EN словарь популярных названий для TPB/1337x
264
+ const RU_EN = {
265
+ 'пацаны': 'the boys', 'во все тяжкие': 'breaking bad', 'лучше звонка сола': 'better call saul',
266
+ 'игра престолов': 'game of thrones', 'странные дела': 'stranger things', 'ведьмак': 'the witcher',
267
+ 'ходячие мертвецы': 'the walking dead', 'теория большого взрыва': 'the big bang theory',
268
+ 'клиника': 'scrubs', 'друзья': 'friends', 'голодные игры': 'the hunger games',
269
+ 'мистер робот': 'mr robot', 'шерлок': 'sherlock', 'южный парк': 'south park',
270
+ 'гриффины': 'family guy', 'симпсоны': 'the simpsons', 'футурама': 'futurama',
271
+ 'рик и морти': 'rick and morty', 'арчер': 'archer', 'американская история ужасов': 'american horror story',
272
+ 'сумерки': 'twilight', 'властелин колец': 'the lord of the rings', 'хоббит': 'the hobbit',
273
+ 'гарри поттер': 'harry potter', 'человек-паук': 'spider-man', 'бэтмен': 'batman',
274
+ 'супермен': 'superman', 'мстители': 'avengers', 'флэш': 'the flash', 'стрела': 'arrow',
275
+ 'тёмный рыцарь': 'the dark knight', 'диванный псих': 'divan', 'дэдпул': 'deadpool',
276
+ 'стражи галактики': 'guardians of the galaxy', 'человек-муравей': 'ant-man',
277
+ 'доктор стрэндж': 'doctor strange', 'веном': 'venom', 'джон уик': 'john wick',
278
+ 'терминатор': 'terminator', 'матрица': 'the matrix', 'чужой': 'alien',
279
+ 'хищник': 'predator', 'трансформеры': 'transformers', 'форсаж': 'fast and furious',
280
+ 'крид': 'creed', 'рокки': 'rocky', 'рамбо': 'rambo', 'неудержимые': 'the expendables',
281
+ 'миссия': 'mission impossible', 'индиана джонс': 'indiana jones', 'парк юрского периода': 'jurassic park',
282
+ 'аватар': 'avatar', 'титаник': 'titanic', 'оно': 'it', 'сияние': 'the shining',
283
+ 'мир дикого запада': 'westworld', 'наркос': 'narcos', 'элита': 'elite',
284
+ 'бумажный дом': 'la casa de papel', 'декстер': 'dexter', 'монк': 'monk',
285
+ 'последний богатырь': 'the last hero', 'чучело': 'scarecrow', 'фонари': 'lanterns',
286
+ 'гангстерленд': 'mobland', 'сердце пармы': 'heart of parma', 'метро 2033': 'metro',
287
+ };
288
+ function ruToEn(q) {
289
+ let s = q.toLowerCase().replace(/[«»\/]/g, ' ');
290
+ for (const k of Object.keys(RU_EN).sort((a, b) => b.length - a.length))
291
+ s = s.split(k).join(RU_EN[k]);
292
+ s = s.replace(/(\d+)\s*сезон/g, (m, n) => 's' + n.padStart(2, '0')).replace(/серия\b/g, 'episode');
293
+ return s.replace(/\s+/g, ' ').trim();
294
+ }
262
295
  function btihKey(mag) { const m = /btih:([0-9a-fA-F]{40}|[0-9a-fA-F]{32})/.exec(mag); return m ? m[1].toLowerCase() : mag.slice(0, 90); }
263
296
 
264
297
  async function search1337x(q) {
@@ -321,7 +354,7 @@ async function searchRutor(q) {
321
354
  }
322
355
 
323
356
  async function searchIndexers(q) {
324
- const queries = [...new Set([q.trim(), translit(q.trim())].filter(Boolean))];
357
+ const queries = [...new Set([q.trim(), translit(q.trim()), ruToEn(q.trim())].filter(Boolean))];
325
358
  const results = [];
326
359
  const notes = [];
327
360
  const jobs = [];