Run pre-commit
This commit is contained in:
@@ -1 +1 @@
|
||||
*.ts
|
||||
*.ts
|
||||
|
||||
@@ -36,4 +36,4 @@ module.exports = {
|
||||
"one-var": ["error", { uninitialized: "consecutive" }],
|
||||
"prefer-destructuring": "warn",
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker build -t ippexdeploymentscr.azurecr.io/dave/stremio-addon-jackett:latest . --platform linux/amd64
|
||||
docker push ippexdeploymentscr.azurecr.io/dave/stremio-addon-jackett:latest
|
||||
docker push ippexdeploymentscr.azurecr.io/dave/stremio-addon-jackett:latest
|
||||
|
||||
@@ -18,4 +18,4 @@
|
||||
"typeRoots": ["node_modules/@types", "src/@types"]
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ builder.defineStreamHandler((args) => {
|
||||
if (!args.id.match(/tt\d+/i) && !args.id.match(/kitsu:\d+/i)) {
|
||||
return Promise.resolve({ streams: [] });
|
||||
}
|
||||
|
||||
|
||||
if (processConfig.DEBUG) {
|
||||
console.log(`Incoming stream ${args.id} request`)
|
||||
console.log('args', args);
|
||||
}
|
||||
|
||||
|
||||
return cacheWrapStream(args.id, () => limiter.schedule(() =>
|
||||
streamHandler(args)
|
||||
.then(records => records.map(record => toStreamInfo(record, args.type))))
|
||||
|
||||
@@ -111,7 +111,7 @@ export const transformData = async (data, query) => {
|
||||
console.log("Transforming data for query " + data);
|
||||
|
||||
let results = [];
|
||||
|
||||
|
||||
const parsedData = await parseString(data);
|
||||
|
||||
if (!parsedData.rss.channel[0]?.item) {
|
||||
@@ -126,7 +126,7 @@ export const transformData = async (data, query) => {
|
||||
[torznabDataItem.$.name]: torznabDataItem.$.value,
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
if (torznabData.infohash) {
|
||||
|
||||
const [title, pubDate, category, size] = [rssItem.title[0], rssItem.pubDate[0], rssItem.category[0], rssItem.size[0]];
|
||||
@@ -148,4 +148,4 @@ export const transformData = async (data, query) => {
|
||||
|
||||
|
||||
return results;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -38,4 +38,4 @@ export const searchJackett = async (query) => {
|
||||
}
|
||||
|
||||
return sortedResults;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ const getMovieSearchQueries = (cleanName, year) => {
|
||||
const getSeriesSearchQueries = (cleanName, year, season, episode) => {
|
||||
return {
|
||||
seriesByEpisode: seriesByEpisode(cleanName, season, episode),
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export const jackettSearchQueries = (cleanName, type, year, season, episode) => {
|
||||
@@ -27,8 +27,8 @@ export const jackettSearchQueries = (cleanName, type, year, season, episode) =>
|
||||
return getMovieSearchQueries(cleanName, year);
|
||||
case Type.SERIES:
|
||||
return getSeriesSearchQueries(cleanName, year, season, episode);
|
||||
|
||||
|
||||
default:
|
||||
return { };
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ const cinemetaUri = cinemetaConfig.URI;
|
||||
export const getMetaData = (args) => {
|
||||
const [imdbId] = args.id.split(':');
|
||||
const {type} = args;
|
||||
|
||||
|
||||
return cacheWrapImdbMetaData(args.id, () => getInfoForImdbId(imdbId, type));
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ const getInfoForImdbId = async (imdbId, type) => {
|
||||
console.log(`Getting info for ${imdbId} of type ${type}`);
|
||||
console.log(`Request URI: ${requestUri}`);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
const { data: response } = await axios.get(requestUri, options);
|
||||
return response.meta;
|
||||
@@ -28,4 +28,4 @@ const getInfoForImdbId = async (imdbId, type) => {
|
||||
console.log(error);
|
||||
return {};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -22,4 +22,4 @@ export function parseConfiguration(configuration) {
|
||||
.map(value => keysToUppercase.includes(key) ? value.toUpperCase() : value.toLowerCase()))
|
||||
|
||||
return configValues;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ a.install-link {
|
||||
}
|
||||
|
||||
.input:focus, .btn:focus {
|
||||
outline: none;
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 2pt rgb(30, 144, 255, 0.7);
|
||||
}
|
||||
`;
|
||||
@@ -210,7 +210,7 @@ export default function landingTemplate(manifest, config = {}) {
|
||||
const debridOptionsHTML = Object.values(DebridOptions.options)
|
||||
.map(option => `<option value="${option.key}">${option.description}</option>`)
|
||||
.join('\n');
|
||||
|
||||
|
||||
return `
|
||||
<!DOCTYPE html>
|
||||
<html style="background-image: url(${background});">
|
||||
@@ -239,54 +239,54 @@ export default function landingTemplate(manifest, config = {}) {
|
||||
<h2 class="description">${manifest.description || ''}</h2>
|
||||
|
||||
<div class="separator"></div>
|
||||
|
||||
|
||||
<label class="label" id="iLimitLabel" for="iLimit">Max results per quality:</label>
|
||||
<input type="text" inputmode="numeric" pattern="[0-9]*" id="iLimit" onchange="generateInstallLink()" class="input" placeholder="All results">
|
||||
|
||||
|
||||
<label class="label" for="iDebridProviders">Debrid provider:</label>
|
||||
<select id="iDebridProviders" class="input" onchange="debridProvidersChange()">
|
||||
<option value="none" selected>None</option>
|
||||
${debridProvidersHTML}
|
||||
</select>
|
||||
|
||||
|
||||
<div id="dRealDebrid">
|
||||
<label class="label" for="iRealDebrid">RealDebrid API Key (Find it <a href='https://real-debrid.com/apitoken' target="_blank">here</a>):</label>
|
||||
<input type="text" id="iRealDebrid" onchange="generateInstallLink()" class="input">
|
||||
</div>
|
||||
|
||||
|
||||
<div id="dAllDebrid">
|
||||
<label class="label" for="iAllDebrid">AllDebrid API Key (Create it <a href='https://alldebrid.com/apikeys' target="_blank">here</a>):</label>
|
||||
<input type="text" id="iAllDebrid" onchange="generateInstallLink()" class="input">
|
||||
</div>
|
||||
|
||||
|
||||
<div id="dPremiumize">
|
||||
<label class="label" for="iPremiumize">Premiumize API Key (Find it <a href='https://www.premiumize.me/account' target="_blank">here</a>):</label>
|
||||
<input type="text" id="iPremiumize" onchange="generateInstallLink()" class="input">
|
||||
</div>
|
||||
|
||||
|
||||
<div id="dDebridLink">
|
||||
<label class="label" for="iDebridLink">DebridLink API Key (Find it <a href='https://debrid-link.fr/webapp/apikey' target="_blank">here</a>):</label>
|
||||
<input type="text" id="iDebridLink" onchange="generateInstallLink()" class="input">
|
||||
</div>
|
||||
|
||||
|
||||
<div id="dOffcloud">
|
||||
<label class="label" for="iOffcloud">Offcloud API Key (Find it <a href='https://offcloud.com/#/account' target="_blank">here</a>):</label>
|
||||
<input type="text" id="iOffcloud" onchange="generateInstallLink()" class="input">
|
||||
</div>
|
||||
|
||||
|
||||
<div id="dPutio">
|
||||
<label class="label" for="iPutio">Put.io ClientId and Token (Create new OAuth App <a href='https://app.put.io/oauth' target="_blank">here</a>):</label>
|
||||
<input type="text" id="iPutioClientId" placeholder="ClientId" onchange="generateInstallLink()" class="input">
|
||||
<input type="text" id="iPutioToken" placeholder="Token" onchange="generateInstallLink()" class="input">
|
||||
</div>
|
||||
|
||||
|
||||
<div id="dDebridOptions">
|
||||
<label class="label" for="iDebridOptions">Debrid options:</label>
|
||||
<select id="iDebridOptions" class="input" onchange="generateInstallLink()" name="debridOptions[]" multiple="multiple">
|
||||
${debridOptionsHTML}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="separator"></div>
|
||||
|
||||
<a id="installLink" class="install-link" href="#">
|
||||
@@ -295,7 +295,7 @@ export default function landingTemplate(manifest, config = {}) {
|
||||
<div class="contact">
|
||||
<p>Or paste into Stremio search bar after clicking install</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="separator"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
@@ -304,7 +304,7 @@ export default function landingTemplate(manifest, config = {}) {
|
||||
const isTvAgent = /\\b(?:tv|wv)\\b/i.test(navigator.userAgent)
|
||||
const isDesktopMedia = window.matchMedia("(pointer:fine)").matches;
|
||||
if (isDesktopMedia && !isTvMedia && !isTvAgent) {
|
||||
$('#iDebridOptions').multiselect({
|
||||
$('#iDebridOptions').multiselect({
|
||||
nonSelectedText: 'None',
|
||||
buttonTextAlignment: 'left',
|
||||
onChange: () => generateInstallLink()
|
||||
@@ -325,7 +325,7 @@ export default function landingTemplate(manifest, config = {}) {
|
||||
generateInstallLink();
|
||||
debridProvidersChange();
|
||||
});
|
||||
|
||||
|
||||
function debridProvidersChange() {
|
||||
const provider = $('#iDebridProviders').val()
|
||||
$('#dDebridOptions').toggle(provider !== 'none');
|
||||
@@ -336,10 +336,10 @@ export default function landingTemplate(manifest, config = {}) {
|
||||
$('#dOffcloud').toggle(provider === '${MochOptions.offcloud.key}');
|
||||
$('#dPutio').toggle(provider === '${MochOptions.putio.key}');
|
||||
}
|
||||
|
||||
|
||||
function generateInstallLink() {
|
||||
const limitValue = $('#iLimit').val() || '';
|
||||
|
||||
|
||||
const debridOptionsValue = $('#iDebridOptions').val().join(',') || '';
|
||||
const realDebridValue = $('#iRealDebrid').val() || '';
|
||||
const allDebridValue = $('#iAllDebrid').val() || '';
|
||||
@@ -348,9 +348,9 @@ export default function landingTemplate(manifest, config = {}) {
|
||||
const offcloudValue = $('#iOffcloud').val() || ''
|
||||
const putioClientIdValue = $('#iPutioClientId').val() || '';
|
||||
const putioTokenValue = $('#iPutioToken').val() || '';
|
||||
|
||||
|
||||
const limit = /^[1-9][0-9]{0,2}$/.test(limitValue) && limitValue;
|
||||
|
||||
|
||||
const debridOptions = debridOptionsValue.length && debridOptionsValue.trim();
|
||||
const realDebrid = realDebridValue.length && realDebridValue.trim();
|
||||
const premiumize = premiumizeValue.length && premiumizeValue.trim();
|
||||
@@ -361,7 +361,7 @@ export default function landingTemplate(manifest, config = {}) {
|
||||
|
||||
let configurationValue = [
|
||||
['limit', limit],
|
||||
['${DebridOptions.key}', debridOptions],
|
||||
['${DebridOptions.key}', debridOptions],
|
||||
['${MochOptions.realdebrid.key}', realDebrid],
|
||||
['${MochOptions.premiumize.key}', premiumize],
|
||||
['${MochOptions.alldebrid.key}', allDebrid],
|
||||
|
||||
@@ -56,4 +56,4 @@ export function getSources(magnetInfo) {
|
||||
}
|
||||
const trackers = Array.isArray(magnetInfo.announce) ? magnetInfo.announce : magnetInfo.announce.split(',');
|
||||
return trackers.map(tracker => `tracker:${tracker}`).concat(`dht:${magnetInfo.infohash}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,4 +39,4 @@ export const cacheConfig = {
|
||||
STALE_REVALIDATE_AGE: parseInt(process.env.STALE_REVALIDATE_AGE) || 4 * 60 * 60, // 4 hours
|
||||
STALE_ERROR_AGE: parseInt(process.env.STALE_ERROR_AGE) || 7 * 24 * 60 * 60, // 7 days
|
||||
GLOBAL_KEY_PREFIX: process.env.GLOBAL_KEY_PREFIX || 'jackettio-addon',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export function toStreamInfo(record, type) {
|
||||
const behaviorHints = bingeGroup ? { bingeGroup } : undefined;
|
||||
|
||||
const magnetInfo = decode(record.magneturl)
|
||||
|
||||
|
||||
return cleanOutputObject({
|
||||
name: name,
|
||||
title: title,
|
||||
@@ -61,7 +61,7 @@ function formatSize(size) {
|
||||
function getBingeGroupParts(record, sameInfo, quality, torrentInfo, fileInfo, type) {
|
||||
if (type === Type.MOVIE) {
|
||||
return [quality];
|
||||
|
||||
|
||||
} else if (sameInfo) {
|
||||
return [quality];
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@ export const Type = {
|
||||
SERIES: 'series',
|
||||
ANIME: 'anime',
|
||||
OTHER: 'other'
|
||||
};
|
||||
};
|
||||
|
||||
@@ -13,4 +13,4 @@ export function isStaticUrl(url) {
|
||||
return Object.values(staticVideoUrls).some(videoUrl => url?.endsWith(videoUrl));
|
||||
}
|
||||
|
||||
export default staticVideoUrls
|
||||
export default staticVideoUrls
|
||||
|
||||
Reference in New Issue
Block a user