"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TorrentParadiseProvider = void 0;
const common_stuff_1 = require("common-stuff");
const _1 = require(".");
const helpers_1 = require("../helpers");
class TorrentParadiseProvider extends _1.Provider {
    constructor() {
        super(...arguments);
        this.domain = 'https://torrent-paradise.ml';
    }
    async getMeta() {
        return {
            categories: [],
        };
    }
    async search(query, options) {
        const {} = options || {};
        const url = `${this.domain}/api/search?q=${encodeURIComponent(query)}`;
        const result = await helpers_1.loadJson(url);
        return result.map((v) => ({
            id: v.id,
            name: v.text,
            magnet: helpers_1.formatMagnet(v.id, v.text, []),
            seeds: v.s,
            peers: v.l,
            size: common_stuff_1.formatBytes(v.len),
            category: {
                name: 'All',
                id: '',
            },
        }));
    }
    async getMagnet() {
        throw new Error('');
    }
}
exports.TorrentParadiseProvider = TorrentParadiseProvider;
TorrentParadiseProvider.providerName = 'TorrentParadise.ml';
