parent
1c9e0934d1
commit
8c12ad4d49
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "neo-scraper",
|
||||
"version": "0.5.7",
|
||||
"version": "0.5.8",
|
||||
"description": "Scrape a booru-like post object from the DOM.",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
|
@ -26,8 +26,8 @@
|
|||
"@types/jsdom": "^12.2.4",
|
||||
"@types/puppeteer": "^5.4.4",
|
||||
"@types/turndown": "^5.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
||||
"@typescript-eslint/parser": "^5.32.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
||||
"@typescript-eslint/parser": "^5.48.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "8.7.0",
|
||||
"eslint-plugin-import": "^2.25.2",
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
"puppeteer": "^13.1.2",
|
||||
"ts-jest": "^26.5.6",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.5.2"
|
||||
"typescript": "^4.9.4"
|
||||
},
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import NeoScraper from "../src/NeoScraper";
|
||||
import FallbackEngine from "../src/engines/Fallback";
|
||||
import NeoScraper from "../src/NeoScraper.js";
|
||||
import FallbackEngine from "../src/engines/Fallback.js";
|
||||
|
||||
const engines = [...new NeoScraper().engines, new FallbackEngine()];
|
||||
const txt = ["| Engine | Sites | Features | Notes |", "|---|---|---|---|---|"];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import NeoScraper from "./NeoScraper";
|
||||
import NeoScraper from "./NeoScraper.js";
|
||||
|
||||
test("create scraper with default engines", async () => {
|
||||
new NeoScraper();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ScrapeEngine, ScrapeResults } from "./ScrapeEngine";
|
||||
import * as engines from "./engines";
|
||||
import { ScrapeEngine, ScrapeResults } from "./ScrapeEngine.js";
|
||||
import * as engines from "./engines/index.js";
|
||||
|
||||
export default class NeoScraper {
|
||||
engines: ScrapeEngine[] = [];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { TagCategory, SafetyRating } from "./BooruTypes";
|
||||
import { TagCategory, SafetyRating } from "./BooruTypes.js";
|
||||
|
||||
export type ContentType = "image" | "video";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { getUrlExtension, guessContentType } from "./Utility";
|
||||
import { getUrlExtension, guessContentType } from "./Utility.js";
|
||||
|
||||
test("getUrlExtension", () => {
|
||||
expect(getUrlExtension("image.png")).toBe("png");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import TurndownService from "turndown";
|
||||
import { ContentType, ScrapedNote, ScrapedPost } from "./ScrapeEngine";
|
||||
import { ContentType, ScrapedNote, ScrapedPost } from "./ScrapeEngine.js";
|
||||
|
||||
// https://github.com/sindresorhus/video-extensions/blob/main/video-extensions.json
|
||||
export const videoExtensions = [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get anime-pictures.net post 729833", async () => {
|
||||
const pageUrl = "https://anime-pictures.net/pictures/view_post/729833?lang=en";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { guessContentType, parseResolutionString } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
import { guessContentType, parseResolutionString } from "../Utility.js";
|
||||
|
||||
export default class AnimePictures extends ScrapeEngineBase {
|
||||
name = "animepictures";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import { TagCategory } from "../BooruTypes";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
|
||||
export type CategoryMap = Record<string, TagCategory>;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get danbooru.donmai.us post 3555872", async () => {
|
||||
const pageUrl = "https://danbooru.donmai.us/posts/3555872";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { createNoteFromDanbooruArticle, guessContentType } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
import { createNoteFromDanbooruArticle, guessContentType } from "../Utility.js";
|
||||
|
||||
export default class Danbooru extends ScrapeEngineBase {
|
||||
name = "danbooru";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ContentType, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { guessContentType } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ContentType, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { guessContentType } from "../Utility.js";
|
||||
|
||||
class MediaElement {
|
||||
constructor(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get furaffinity.net post 23281942", async () => {
|
||||
const pageUrl = "https://www.furaffinity.net/view/23281942/";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { guessContentType, parseResolutionString } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { guessContentType, parseResolutionString } from "../Utility.js";
|
||||
|
||||
export default class FurAffinity extends ScrapeEngineBase {
|
||||
name = "furaffinity";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get safebooru.org post 2871532", async () => {
|
||||
const pageUrl = "https://safebooru.org/index.php?page=post&s=view&id=2871532";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { CategoryMap } from "./Common";
|
||||
import { createNoteFromDanbooruArticle, guessContentType, parseResolutionString } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
import { CategoryMap } from "./Common.js";
|
||||
import { createNoteFromDanbooruArticle, guessContentType, parseResolutionString } from "../Utility.js";
|
||||
|
||||
// Small hack to avoid screwing with semver
|
||||
enum Version {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get inkbunny.net post 2430530", async () => {
|
||||
const pageUrl = "https://inkbunny.net/s/2430530";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
|
||||
export default class Inkbunny extends ScrapeEngineBase {
|
||||
name = "inkbunny";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl, scrapeEvalUrl } from "../test/engine";
|
||||
import { scrapeUrl, scrapeEvalUrl } from "../test/engine.js";
|
||||
|
||||
test("get yande.re post 438510", async () => {
|
||||
const pageUrl = "https://yande.re/post/show/438510";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { createNotesFromMoebooruBoxes, guessContentType, parseResolutionString } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
import { createNotesFromMoebooruBoxes, guessContentType, parseResolutionString } from "../Utility.js";
|
||||
|
||||
export default class Moebooru extends ScrapeEngineBase {
|
||||
name = "moebooru";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ScrapeResults } from "../ScrapeEngine";
|
||||
import { MobileUserAgent, scrapeEvalUrl, scrapePage } from "../test/engine";
|
||||
import { upgradeUrlToOriginalQuality } from "./Pixiv";
|
||||
import { ScrapeResults } from "../ScrapeEngine.js";
|
||||
import { MobileUserAgent, scrapeEvalUrl, scrapePage } from "../test/engine.js";
|
||||
import { upgradeUrlToOriginalQuality } from "./Pixiv.js";
|
||||
|
||||
test("upgradeUrlToOriginalQuality", async () => {
|
||||
expect(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { guessContentType } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { guessContentType } from "../Utility.js";
|
||||
|
||||
export function upgradeUrlToOriginalQuality(imgLink: string) {
|
||||
if (imgLink.indexOf("img-master") != -1) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get old.reddit.com post", async () => {
|
||||
const pageUrl = "https://old.reddit.com/r/IceCreamWaifu/comments/ce0wgh/rtx_2018_neo_luluchan92/";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { guessContentType } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { guessContentType } from "../Utility.js";
|
||||
|
||||
export default class Reddit extends ScrapeEngineBase {
|
||||
name = "reddit";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get rule34.us post 4646579", async () => {
|
||||
// Kinda sketchy.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
// Technically speaking rule34.us also uses gelbooru, albeit a (heavily?) modified one.
|
||||
// Because pretty much no scraper code can be shared with other gelbooru-likes it makes more sense to create a new engine for rule34.us.
|
||||
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { CategoryMap } from "./Common";
|
||||
import { guessContentType, parseResolutionString } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
import { CategoryMap } from "./Common.js";
|
||||
import { guessContentType, parseResolutionString } from "../Utility.js";
|
||||
|
||||
export default class Gelbooru extends ScrapeEngineBase {
|
||||
name = "rule34us";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get chan.sankakucomplex.com post 19614481 with notes", async () => {
|
||||
const pageUrl = "https://chan.sankakucomplex.com/post/show/19614481";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { createNotesFromMoebooruBoxes, guessContentType } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
import { createNotesFromMoebooruBoxes, guessContentType } from "../Utility.js";
|
||||
|
||||
export default class SankakuComplex extends ScrapeEngineBase {
|
||||
name = "sankakucomplex";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get rule34.paheal.net post 2505982", async () => {
|
||||
const pageUrl = "https://rule34.paheal.net/post/view/2505982"; // Somewhat sketchy
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { guessContentType } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { guessContentType } from "../Utility.js";
|
||||
|
||||
export default class Shimmie2 extends ScrapeEngineBase {
|
||||
name = "shimmie2";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get e-shuushuu.net post 1063586", async () => {
|
||||
const pageUrl = "https://e-shuushuu.net/image/1063586/";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { guessContentType, parseResolutionString } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
import { guessContentType, parseResolutionString } from "../Utility.js";
|
||||
|
||||
export default class Shuushuu extends ScrapeEngineBase {
|
||||
name = "shuushuu";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ScrapeResults } from "../ScrapeEngine";
|
||||
import { scrapeEvalUrl } from "../test/engine";
|
||||
import { ScrapeResults } from "../ScrapeEngine.js";
|
||||
import { scrapeEvalUrl } from "../test/engine.js";
|
||||
|
||||
describe("get twitter.com post", () => {
|
||||
const pageUrl = "https://twitter.com/Dishwasher1910/status/1171162651461746688/photo/1";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
|
||||
export function getOriginalImageUrl(image: HTMLImageElement) {
|
||||
// if the link includes a resolution, change it to orig:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get zerochan.net post 2934998", async () => {
|
||||
const pageUrl = "https://www.zerochan.net/2934998";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { guessContentType, parseResolutionString } from "../Utility";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
import { guessContentType, parseResolutionString } from "../Utility.js";
|
||||
|
||||
export default class Zerochan extends ScrapeEngineBase {
|
||||
name = "zerochan";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { scrapeUrl } from "../test/engine";
|
||||
import { scrapeUrl } from "../test/engine.js";
|
||||
|
||||
test("get e621.net post 380315", async () => {
|
||||
const pageUrl = "https://e621.net/posts/380315?q=league_of_legends+rating%3Asafe+order%3Ascore";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
|
||||
export default class e621 extends ScrapeEngineBase {
|
||||
name = "e621";
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
export { default as AnimePictures } from "./AnimePictures";
|
||||
export { default as Danbooru } from "./Danbooru";
|
||||
export { default as e621 } from "./e621";
|
||||
export { default as Fallback } from "./Fallback";
|
||||
export { default as FurAffinity } from "./FurAffinity";
|
||||
export { default as Gelbooru } from "./Gelbooru";
|
||||
export { default as Inkbunny } from "./Inkbunny";
|
||||
export { default as Moebooru } from "./Moebooru";
|
||||
export { default as Pixiv } from "./Pixiv";
|
||||
export { default as Reddit } from "./Reddit";
|
||||
export { default as Rule34us } from "./Rule34us";
|
||||
export { default as SankakuComplex } from "./SankakuComplex";
|
||||
export { default as Shimmie2 } from "./Shimmie2";
|
||||
export { default as Shuushuu } from "./Shuushuu";
|
||||
export { default as Twitter } from "./Twitter";
|
||||
export { default as Zerochan } from "./Zerochan";
|
||||
export { default as AnimePictures } from "./AnimePictures.js";
|
||||
export { default as Danbooru } from "./Danbooru.js";
|
||||
export { default as e621 } from "./e621.js";
|
||||
export { default as Fallback } from "./Fallback.js";
|
||||
export { default as FurAffinity } from "./FurAffinity.js";
|
||||
export { default as Gelbooru } from "./Gelbooru.js";
|
||||
export { default as Inkbunny } from "./Inkbunny.js";
|
||||
export { default as Moebooru } from "./Moebooru.js";
|
||||
export { default as Pixiv } from "./Pixiv.js";
|
||||
export { default as Reddit } from "./Reddit.js";
|
||||
export { default as Rule34us } from "./Rule34us.js";
|
||||
export { default as SankakuComplex } from "./SankakuComplex.js";
|
||||
export { default as Shimmie2 } from "./Shimmie2.js";
|
||||
export { default as Shuushuu } from "./Shuushuu.js";
|
||||
export { default as Twitter } from "./Twitter.js";
|
||||
export { default as Zerochan } from "./Zerochan.js";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export { default as NeoScraper } from "./NeoScraper";
|
||||
export * from "./ScrapeEngine";
|
||||
export { default as NeoScraper } from "./NeoScraper.js";
|
||||
export * from "./ScrapeEngine.js";
|
||||
|
||||
import * as Engines from "./ScrapeEngine";
|
||||
import * as Engines from "./ScrapeEngine.js";
|
||||
export { Engines };
|
||||
|
||||
import * as BooruTypes from "./BooruTypes";
|
||||
import * as BooruTypes from "./BooruTypes.js";
|
||||
export { BooruTypes };
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { JSDOM, ConstructorOptions } from "jsdom";
|
||||
import { Page } from "puppeteer";
|
||||
import NeoScraper from "../NeoScraper";
|
||||
import NeoScraper from "../NeoScraper.js";
|
||||
|
||||
export const MobileUserAgent = "Mozilla/5.0 (Android 12; Mobile; rv:68.0) Gecko/68.0 Firefox/103.0";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import "jest-extended";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
|
||||
declare global {
|
||||
namespace jest {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { JSDOM } from "jsdom";
|
||||
import { TagCategory } from "../BooruTypes";
|
||||
import { ScrapedPost } from "../ScrapeEngine";
|
||||
import { TagCategory } from "../BooruTypes.js";
|
||||
import { ScrapedPost } from "../ScrapeEngine.js";
|
||||
|
||||
// Expose JSDOM Element constructor
|
||||
global.Element = new JSDOM().window.Element;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"moduleResolution": "NodeNext",
|
||||
"target": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
|
|
|
|||
117
yarn.lock
117
yarn.lock
|
|
@ -806,6 +806,11 @@
|
|||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/semver@^7.3.12":
|
||||
version "7.3.13"
|
||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91"
|
||||
integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==
|
||||
|
||||
"@types/stack-utils@^2.0.0":
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c"
|
||||
|
|
@ -847,84 +852,87 @@
|
|||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@typescript-eslint/eslint-plugin@^5.32.0":
|
||||
version "5.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.32.0.tgz#e27e38cffa4a61226327c874a7be965e9a861624"
|
||||
integrity sha512-CHLuz5Uz7bHP2WgVlvoZGhf0BvFakBJKAD/43Ty0emn4wXWv5k01ND0C0fHcl/Im8Td2y/7h44E9pca9qAu2ew==
|
||||
"@typescript-eslint/eslint-plugin@^5.48.1":
|
||||
version "5.48.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.1.tgz#deee67e399f2cb6b4608c935777110e509d8018c"
|
||||
integrity sha512-9nY5K1Rp2ppmpb9s9S2aBiF3xo5uExCehMDmYmmFqqyxgenbHJ3qbarcLt4ITgaD6r/2ypdlcFRdcuVPnks+fQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.32.0"
|
||||
"@typescript-eslint/type-utils" "5.32.0"
|
||||
"@typescript-eslint/utils" "5.32.0"
|
||||
"@typescript-eslint/scope-manager" "5.48.1"
|
||||
"@typescript-eslint/type-utils" "5.48.1"
|
||||
"@typescript-eslint/utils" "5.48.1"
|
||||
debug "^4.3.4"
|
||||
functional-red-black-tree "^1.0.1"
|
||||
ignore "^5.2.0"
|
||||
natural-compare-lite "^1.4.0"
|
||||
regexpp "^3.2.0"
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/parser@^5.32.0":
|
||||
version "5.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.32.0.tgz#1de243443bc6186fb153b9e395b842e46877ca5d"
|
||||
integrity sha512-IxRtsehdGV9GFQ35IGm5oKKR2OGcazUoiNBxhRV160iF9FoyuXxjY+rIqs1gfnd+4eL98OjeGnMpE7RF/NBb3A==
|
||||
"@typescript-eslint/parser@^5.48.1":
|
||||
version "5.48.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.48.1.tgz#d0125792dab7e232035434ab8ef0658154db2f10"
|
||||
integrity sha512-4yg+FJR/V1M9Xoq56SF9Iygqm+r5LMXvheo6DQ7/yUWynQ4YfCRnsKuRgqH4EQ5Ya76rVwlEpw4Xu+TgWQUcdA==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.32.0"
|
||||
"@typescript-eslint/types" "5.32.0"
|
||||
"@typescript-eslint/typescript-estree" "5.32.0"
|
||||
"@typescript-eslint/scope-manager" "5.48.1"
|
||||
"@typescript-eslint/types" "5.48.1"
|
||||
"@typescript-eslint/typescript-estree" "5.48.1"
|
||||
debug "^4.3.4"
|
||||
|
||||
"@typescript-eslint/scope-manager@5.32.0":
|
||||
version "5.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.32.0.tgz#763386e963a8def470580cc36cf9228864190b95"
|
||||
integrity sha512-KyAE+tUON0D7tNz92p1uetRqVJiiAkeluvwvZOqBmW9z2XApmk5WSMV9FrzOroAcVxJZB3GfUwVKr98Dr/OjOg==
|
||||
"@typescript-eslint/scope-manager@5.48.1":
|
||||
version "5.48.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.48.1.tgz#39c71e4de639f5fe08b988005beaaf6d79f9d64d"
|
||||
integrity sha512-S035ueRrbxRMKvSTv9vJKIWgr86BD8s3RqoRZmsSh/s8HhIs90g6UlK8ZabUSjUZQkhVxt7nmZ63VJ9dcZhtDQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.32.0"
|
||||
"@typescript-eslint/visitor-keys" "5.32.0"
|
||||
"@typescript-eslint/types" "5.48.1"
|
||||
"@typescript-eslint/visitor-keys" "5.48.1"
|
||||
|
||||
"@typescript-eslint/type-utils@5.32.0":
|
||||
version "5.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.32.0.tgz#45a14506fe3fb908600b4cef2f70778f7b5cdc79"
|
||||
integrity sha512-0gSsIhFDduBz3QcHJIp3qRCvVYbqzHg8D6bHFsDMrm0rURYDj+skBK2zmYebdCp+4nrd9VWd13egvhYFJj/wZg==
|
||||
"@typescript-eslint/type-utils@5.48.1":
|
||||
version "5.48.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.48.1.tgz#5d94ac0c269a81a91ad77c03407cea2caf481412"
|
||||
integrity sha512-Hyr8HU8Alcuva1ppmqSYtM/Gp0q4JOp1F+/JH5D1IZm/bUBrV0edoewQZiEc1r6I8L4JL21broddxK8HAcZiqQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/utils" "5.32.0"
|
||||
"@typescript-eslint/typescript-estree" "5.48.1"
|
||||
"@typescript-eslint/utils" "5.48.1"
|
||||
debug "^4.3.4"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/types@5.32.0":
|
||||
version "5.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.32.0.tgz#484273021eeeae87ddb288f39586ef5efeb6dcd8"
|
||||
integrity sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ==
|
||||
"@typescript-eslint/types@5.48.1":
|
||||
version "5.48.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.48.1.tgz#efd1913a9aaf67caf8a6e6779fd53e14e8587e14"
|
||||
integrity sha512-xHyDLU6MSuEEdIlzrrAerCGS3T7AA/L8Hggd0RCYBi0w3JMvGYxlLlXHeg50JI9Tfg5MrtsfuNxbS/3zF1/ATg==
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.32.0":
|
||||
version "5.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.32.0.tgz#282943f34babf07a4afa7b0ff347a8e7b6030d12"
|
||||
integrity sha512-ZVAUkvPk3ITGtCLU5J4atCw9RTxK+SRc6hXqLtllC2sGSeMFWN+YwbiJR9CFrSFJ3w4SJfcWtDwNb/DmUIHdhg==
|
||||
"@typescript-eslint/typescript-estree@5.48.1":
|
||||
version "5.48.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.1.tgz#9efa8ee2aa471c6ab62e649f6e64d8d121bc2056"
|
||||
integrity sha512-Hut+Osk5FYr+sgFh8J/FHjqX6HFcDzTlWLrFqGoK5kVUN3VBHF/QzZmAsIXCQ8T/W9nQNBTqalxi1P3LSqWnRA==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.32.0"
|
||||
"@typescript-eslint/visitor-keys" "5.32.0"
|
||||
"@typescript-eslint/types" "5.48.1"
|
||||
"@typescript-eslint/visitor-keys" "5.48.1"
|
||||
debug "^4.3.4"
|
||||
globby "^11.1.0"
|
||||
is-glob "^4.0.3"
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/utils@5.32.0":
|
||||
version "5.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.32.0.tgz#eccb6b672b94516f1afc6508d05173c45924840c"
|
||||
integrity sha512-W7lYIAI5Zlc5K082dGR27Fczjb3Q57ECcXefKU/f0ajM5ToM0P+N9NmJWip8GmGu/g6QISNT+K6KYB+iSHjXCQ==
|
||||
"@typescript-eslint/utils@5.48.1":
|
||||
version "5.48.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.48.1.tgz#20f2f4e88e9e2a0961cbebcb47a1f0f7da7ba7f9"
|
||||
integrity sha512-SmQuSrCGUOdmGMwivW14Z0Lj8dxG1mOFZ7soeJ0TQZEJcs3n5Ndgkg0A4bcMFzBELqLJ6GTHnEU+iIoaD6hFGA==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.9"
|
||||
"@typescript-eslint/scope-manager" "5.32.0"
|
||||
"@typescript-eslint/types" "5.32.0"
|
||||
"@typescript-eslint/typescript-estree" "5.32.0"
|
||||
"@types/semver" "^7.3.12"
|
||||
"@typescript-eslint/scope-manager" "5.48.1"
|
||||
"@typescript-eslint/types" "5.48.1"
|
||||
"@typescript-eslint/typescript-estree" "5.48.1"
|
||||
eslint-scope "^5.1.1"
|
||||
eslint-utils "^3.0.0"
|
||||
semver "^7.3.7"
|
||||
|
||||
"@typescript-eslint/visitor-keys@5.32.0":
|
||||
version "5.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.32.0.tgz#b9715d0b11fdb5dd10fd0c42ff13987470525394"
|
||||
integrity sha512-S54xOHZgfThiZ38/ZGTgB2rqx51CMJ5MCfVT2IplK4Q7hgzGfe0nLzLCcenDnc/cSjP568hdeKfeDcBgqNHD/g==
|
||||
"@typescript-eslint/visitor-keys@5.48.1":
|
||||
version "5.48.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.1.tgz#79fd4fb9996023ef86849bf6f904f33eb6c8fccb"
|
||||
integrity sha512-Ns0XBwmfuX7ZknznfXozgnydyR8F6ev/KEGePP4i74uL3ArsKbEhJ7raeKr1JSa997DBDwol/4a0Y+At82c9dA==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.32.0"
|
||||
"@typescript-eslint/types" "5.48.1"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
abab@^2.0.0, abab@^2.0.3, abab@^2.0.5:
|
||||
|
|
@ -4046,6 +4054,11 @@ nanomatch@^1.2.9:
|
|||
snapdragon "^0.8.1"
|
||||
to-regex "^3.0.1"
|
||||
|
||||
natural-compare-lite@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4"
|
||||
integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==
|
||||
|
||||
natural-compare@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||
|
|
@ -5386,10 +5399,10 @@ typedarray-to-buffer@^3.1.5:
|
|||
dependencies:
|
||||
is-typedarray "^1.0.0"
|
||||
|
||||
typescript@^4.5.2:
|
||||
version "4.7.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
|
||||
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
|
||||
typescript@^4.9.4:
|
||||
version "4.9.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78"
|
||||
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==
|
||||
|
||||
unbox-primitive@^1.0.2:
|
||||
version "1.0.2"
|
||||
|
|
|
|||
Loading…
Reference in New Issue