feat: vidstack
This commit is contained in:
1 parent
184ee26e5b
commit
c31058c4f7
22 files changed
+419
-191
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
import { parse } from 'node-html-parser';
|
||||
import torrentTitle from 'parse-torrent-title';
|
||||
|
||||
import { Sort } from './index';
|
||||
|
||||
@@ -47,12 +48,22 @@ export class PirateBay {
|
||||
|
||||
const magnets = table?.querySelectorAll('a[href^="magnet:"]').map((link) => link.getAttribute('href'));
|
||||
|
||||
return titles.map((title, index) => {
|
||||
return titles.map((originalTitle, index) => {
|
||||
const { title, resolution, source, codec, container, season, episode, year } = torrentTitle.parse(
|
||||
originalTitle || ''
|
||||
);
|
||||
|
||||
return {
|
||||
title,
|
||||
year,
|
||||
source,
|
||||
codec,
|
||||
container,
|
||||
originalTitle,
|
||||
title: `${title} ${season && episode ? `[S${season}:E${episode}]` : ''}`,
|
||||
id: title,
|
||||
size: sizes[index],
|
||||
seeders: parseInt(seeders[index]!),
|
||||
quality: resolution,
|
||||
magnet: magnets[index]!
|
||||
};
|
||||
}) as Torrent[];
|
||||
|
||||
@@ -50,10 +50,12 @@ export class YTS {
|
||||
|
||||
return {
|
||||
id: movie.id?.toString(),
|
||||
title: `${movie.title_english} ${torrent.quality ? `[${torrent.quality}]` : ''}`,
|
||||
title: movie.title_english,
|
||||
seeders: torrent.seeds,
|
||||
size: torrent.size,
|
||||
type: torrent.type,
|
||||
quality: torrent.quality,
|
||||
source: torrent.type,
|
||||
year: movie.year?.toString(),
|
||||
magnet: `magnet:?xt=urn:btih:${torrent.hash}&dn=${encodeURIComponent(query)}&tr=${trackers.join('&tr=')}`
|
||||
};
|
||||
}) || []
|
||||
|
||||
Reference in new issue
Block a user