[addon] updates premiumize moch

This commit is contained in:
TheBeastLT
2021-01-18 15:44:53 +01:00
parent 5074551c41
commit b467943c5e
9 changed files with 97 additions and 29 deletions

View File

@@ -7,7 +7,7 @@ const putio = require('./putio');
const StaticResponse = require('./static');
const { cacheWrapResolvedUrl } = require('../lib/cache');
const MIN_API_KEY_SYMBOLS = 20;
const MIN_API_KEY_SYMBOLS = 15;
const RESOLVER_HOST = process.env.RESOLVER_HOST || 'http://localhost:7050';
const MOCHS = {
realdebrid: {
@@ -16,13 +16,12 @@ const MOCHS = {
name: "RealDebrid",
shortName: 'RD'
},
// @TODO disabled until it is possible to resolve stream url for specific ip
// premiumize: {
// key: 'premiumize',
// instance: premiumize,
// name: 'Premiumize',
// shortName: 'PM'
// },
premiumize: {
key: 'premiumize',
instance: premiumize,
name: 'Premiumize',
shortName: 'PM'
},
alldebrid: {
key: 'alldebrid',
instance: alldebrid,
@@ -113,6 +112,7 @@ async function getMochItemMeta(mochKey, itemId, config) {
meta.videos
.map(video => video.streams)
.reduce((a, b) => a.concat(b), [])
.filter(stream => !stream.url.startsWith('http'))
.forEach(stream => stream.url = `${RESOLVER_HOST}/${moch.key}/${stream.url}`)
return meta;
});