Skip to content

Commit

Permalink
3.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Dec 15, 2024
1 parent f47f8d7 commit 68c10a5
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 47 deletions.
5 changes: 2 additions & 3 deletions built/plugins/dlsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.process = exports.test = void 0;
exports.test = test;
exports.process = process;
const general_1 = require("../general");
const status_error_1 = require("../utils/status-error");
function test(url) {
return url.hostname === 'www.dlsite.com';
}
exports.test = test;
function process(url) {
return __awaiter(this, void 0, void 0, function* () {
const summaly = yield (0, general_1.default)(url).catch(e => {
Expand All @@ -42,4 +42,3 @@ function process(url) {
return summaly;
});
}
exports.process = process;
5 changes: 2 additions & 3 deletions built/plugins/iwara.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.postProcess = exports.test = void 0;
exports.test = test;
exports.postProcess = postProcess;
const decode_entities_1 = require("../utils/decode-entities");
function test(url) {
return /^(?:www|ecchi)[.]iwara[.]tv$/.test(url.hostname);
}
exports.test = test;
function postProcess(summaly) {
return __awaiter(this, void 0, void 0, function* () {
const landingUrl = summaly.url;
Expand All @@ -41,4 +41,3 @@ function postProcess(summaly) {
return summaly;
});
}
exports.postProcess = postProcess;
5 changes: 2 additions & 3 deletions built/plugins/komiflo.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.postProcess = exports.test = void 0;
exports.test = test;
exports.postProcess = postProcess;
const got_1 = require("../utils/got");
function test(url) {
return /^komiflo[.]com$/.test(url.hostname);
}
exports.test = test;
function postProcess(summaly) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d, _e, _f, _g, _h;
Expand Down Expand Up @@ -43,4 +43,3 @@ function postProcess(summaly) {
return summaly;
});
}
exports.postProcess = postProcess;
6 changes: 3 additions & 3 deletions built/plugins/nijie.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.postProcess = exports.isImageObject = exports.test = void 0;
exports.isImageObject = void 0;
exports.test = test;
exports.postProcess = postProcess;
function test(url) {
return /^nijie[.]info$/.test(url.hostname);
}
exports.test = test;
const isImageObject = (object) => object['@type'] === 'ImageObject';
exports.isImageObject = isImageObject;
function postProcess(summaly) {
Expand Down Expand Up @@ -43,4 +44,3 @@ function postProcess(summaly) {
return summaly;
});
}
exports.postProcess = postProcess;
5 changes: 2 additions & 3 deletions built/plugins/spotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.process = exports.test = void 0;
exports.test = test;
exports.process = process;
const got_1 = require("../utils/got");
const cheerio = require("cheerio");
function test(url) {
Expand All @@ -18,7 +19,6 @@ function test(url) {
}
return false;
}
exports.test = test;
function process(url) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
Expand Down Expand Up @@ -47,4 +47,3 @@ function process(url) {
};
});
}
exports.process = process;
5 changes: 2 additions & 3 deletions built/plugins/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.process = exports.test = void 0;
exports.test = test;
exports.process = process;
// 高速Twitterプラグイン
const got_1 = require("../utils/got");
function test(url) {
return /^(?:twitter|x)\.com$/.test(url.hostname)
&& /^[/]\w+[/]status[/](\d+)/.test(url.pathname);
}
exports.test = test;
function process(url) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
Expand Down Expand Up @@ -52,4 +52,3 @@ function process(url) {
};
});
}
exports.process = process;
5 changes: 2 additions & 3 deletions built/plugins/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.process = exports.test = void 0;
exports.test = test;
exports.process = process;
// 高速YouTubeプラグイン
const got_1 = require("../utils/got");
const cheerio = require("cheerio");
Expand All @@ -24,7 +25,6 @@ function test(url) {
}
return false;
}
exports.test = test;
function process(url) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
Expand Down Expand Up @@ -55,4 +55,3 @@ function process(url) {
};
});
}
exports.process = process;
2 changes: 1 addition & 1 deletion built/server/load-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const fs_1 = require("fs");
const yaml = require("js-yaml");
function default_1() {
Expand All @@ -12,4 +13,3 @@ function default_1() {
return {};
}
}
exports.default = default_1;
3 changes: 1 addition & 2 deletions built/summaly.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StripEx = void 0;
exports.StripEx = StripEx;
function StripEx(ex) {
return {
description: ex.description,
Expand All @@ -14,4 +14,3 @@ function StripEx(ex) {
url: ex.url,
};
}
exports.StripEx = StripEx;
4 changes: 0 additions & 4 deletions built/utils/agent.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node/http" />
/// <reference types="got/dist/source/core/utils/timed-out" />
import * as http from 'http';
import * as https from 'https';
export declare const httpAgent: http.Agent;
Expand Down
3 changes: 1 addition & 2 deletions built/utils/check-allowed-url.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkAllowedUrl = void 0;
exports.checkAllowedUrl = checkAllowedUrl;
const PrivateIp = require('private-ip');
function checkAllowedUrl(url) {
try {
Expand Down Expand Up @@ -33,4 +33,3 @@ function checkAllowedUrl(url) {
return false;
}
}
exports.checkAllowedUrl = checkAllowedUrl;
2 changes: 1 addition & 1 deletion built/utils/cleanup-title.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const escapeRegExp = require('escape-regexp');
function default_1(title, siteName) {
if (title == null)
Expand All @@ -21,4 +22,3 @@ function default_1(title, siteName) {
}
return title;
}
exports.default = default_1;
3 changes: 1 addition & 2 deletions built/utils/cleanup-url.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cleanupUrl = void 0;
exports.cleanupUrl = cleanupUrl;
/**
* To absolute and sanitize URL
* @param url URL (absolute or relative)
Expand All @@ -23,4 +23,3 @@ function cleanupUrl(url, base) {
}
return null;
}
exports.cleanupUrl = cleanupUrl;
2 changes: 1 addition & 1 deletion built/utils/clip.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
function default_1(s, max) {
if (s == null)
return s;
Expand All @@ -11,4 +12,3 @@ function default_1(s, max) {
return s;
}
}
exports.default = default_1;
3 changes: 1 addition & 2 deletions built/utils/decode-entities.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decodeEntities = void 0;
exports.decodeEntities = decodeEntities;
const clip_1 = require("./clip");
const html_entities_1 = require("html-entities");
function decodeEntities(description, limit = 300) {
return description
? ((0, clip_1.default)((0, html_entities_1.decode)(description), limit) || null)
: null;
}
exports.decodeEntities = decodeEntities;
1 change: 0 additions & 1 deletion built/utils/encoding.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="node" />
/**
* Detect HTML encoding
* @param body Body in Buffer
Expand Down
5 changes: 2 additions & 3 deletions built/utils/encoding.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toUtf8 = exports.detectEncoding = void 0;
exports.detectEncoding = detectEncoding;
exports.toUtf8 = toUtf8;
const iconv = require("iconv-lite");
const jschardet = require("jschardet");
const regCharset = new RegExp(/charset\s*=\s*["']?([\w-]+)/, 'i');
Expand Down Expand Up @@ -28,11 +29,9 @@ function detectEncoding(body) {
}
return 'utf-8';
}
exports.detectEncoding = detectEncoding;
function toUtf8(body, encoding) {
return iconv.decode(body, encoding);
}
exports.toUtf8 = toUtf8;
function toEncoding(candicate) {
if (iconv.encodingExists(candicate)) {
if (['shift_jis', 'shift-jis', 'windows-31j', 'x-sjis'].includes(candicate.toLowerCase()))
Expand Down
7 changes: 3 additions & 4 deletions built/utils/got.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchUrl = exports.getJson = exports.scpaping = void 0;
exports.scpaping = scpaping;
exports.getJson = getJson;
exports.fetchUrl = fetchUrl;
const fs = require("fs");
const stream = require("stream");
const util = require("util");
Expand Down Expand Up @@ -75,7 +77,6 @@ function scpaping(url, opts) {
}
});
}
exports.scpaping = scpaping;
function getJson(url, referer) {
return __awaiter(this, void 0, void 0, function* () {
const res = yield getResponse({
Expand All @@ -90,7 +91,6 @@ function getJson(url, referer) {
return yield JSON.parse(res.body);
});
}
exports.getJson = getJson;
function getResponse(args) {
return __awaiter(this, void 0, void 0, function* () {
if (!(0, check_allowed_url_1.checkAllowedUrl)(args.url)) {
Expand Down Expand Up @@ -241,4 +241,3 @@ function fetchUrl(url, path) {
}
});
}
exports.fetchUrl = fetchUrl;
3 changes: 1 addition & 2 deletions built/utils/sanitize-url.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sanitizeUrl = void 0;
exports.sanitizeUrl = sanitizeUrl;
function sanitizeUrl(str) {
if (str == null)
return str;
Expand All @@ -18,4 +18,3 @@ function sanitizeUrl(str) {
}
return null;
}
exports.sanitizeUrl = sanitizeUrl;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "summaly",
"version": "3.14.0",
"version": "3.15.0",
"description": "Get web page's summary",
"author": "mei23 <m@m544.net>",
"license": "MIT",
Expand Down

0 comments on commit 68c10a5

Please sign in to comment.