From 17c84b16db33219b199dcef4d8cea9898166514a Mon Sep 17 00:00:00 2001 From: neobooru <50623835+neobooru@users.noreply.github.com> Date: Tue, 25 Jun 2024 23:37:35 +0200 Subject: [PATCH] UploadMode tweaks + add Nozomi + add x.com as twitter domain --- package.json | 18 +- pnpm-lock.yaml | 531 +++++++++++++++++++++++----------------- src/NeoScraper.ts | 1 + src/ScrapeEngine.ts | 10 +- src/engines/Danbooru.ts | 7 +- src/engines/Ehentai.ts | 6 +- src/engines/Fallback.ts | 12 +- src/engines/Nozomi.ts | 49 ++++ src/engines/Twitter.ts | 2 +- src/engines/index.ts | 1 + 10 files changed, 387 insertions(+), 250 deletions(-) create mode 100644 src/engines/Nozomi.ts diff --git a/package.json b/package.json index c6adf12..1e41801 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neo-scraper", - "version": "0.8.0", + "version": "0.9.0", "description": "Scrape a booru-like post object from the DOM.", "type": "module", "main": "dist/index.js", @@ -39,7 +39,7 @@ "jest-ts-webcompat-resolver": "^1.0.0", "jsdom": "^15.2.1", "prettier": "2.5.1", - "puppeteer": "^21.5.0", + "puppeteer": "^22.12.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "typescript": "^4.9.5" @@ -52,7 +52,12 @@ "preset": "./jest.preset.cjs", "resolver": "jest-ts-webcompat-resolver", "transform": { - "^.+\\.tsx?$": "ts-jest" + "^.+\\.tsx?$": [ + "ts-jest", + { + "tsconfig": "tsconfig.test.json" + } + ] }, "moduleFileExtensions": [ "ts", @@ -62,11 +67,6 @@ "testRegex": "^.+\\.test\\.ts$", "setupFilesAfterEnv": [ "./src/test/jest.setup.ts" - ], - "globals": { - "ts-jest": { - "tsconfig": "tsconfig.test.json" - } - } + ] } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 64bd077..f357d17 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,7 +35,7 @@ importers: version: 5.0.3 '@typescript-eslint/eslint-plugin': specifier: ^5.62.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.7.0)(typescript@4.9.5) + version: 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.7.0)(typescript@4.9.5))(eslint@8.7.0)(typescript@4.9.5) '@typescript-eslint/parser': specifier: ^5.62.0 version: 5.62.0(eslint@8.7.0)(typescript@4.9.5) @@ -47,7 +47,7 @@ importers: version: 8.7.0 eslint-plugin-import: specifier: ^2.29.0 - version: 2.29.0(@typescript-eslint/parser@5.62.0)(eslint@8.7.0) + version: 2.29.0(@typescript-eslint/parser@5.62.0(eslint@8.7.0)(typescript@4.9.5))(eslint@8.7.0) eslint-plugin-n: specifier: ^15.7.0 version: 15.7.0(eslint@8.7.0) @@ -56,10 +56,10 @@ importers: version: 6.1.1(eslint@8.7.0) jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1) + version: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)) jest-puppeteer: specifier: ^9.0.1 - version: 9.0.1(puppeteer@21.5.0)(typescript@4.9.5) + version: 9.0.1(puppeteer@22.12.0(typescript@4.9.5))(typescript@4.9.5) jest-ts-webcompat-resolver: specifier: ^1.0.0 version: 1.0.0(jest-resolve@29.7.0) @@ -70,11 +70,11 @@ importers: specifier: 2.5.1 version: 2.5.1 puppeteer: - specifier: ^21.5.0 - version: 21.5.0(typescript@4.9.5) + specifier: ^22.12.0 + version: 22.12.0(typescript@4.9.5) ts-jest: specifier: ^29.1.1 - version: 29.1.1(@babel/core@7.23.2)(jest@29.7.0)(typescript@4.9.5) + version: 29.1.1(@babel/core@7.23.2)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.2))(jest@29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)))(typescript@4.9.5) ts-node: specifier: ^10.9.1 version: 10.9.1(@types/node@20.8.10)(typescript@4.9.5) @@ -409,9 +409,9 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@puppeteer/browsers@1.8.0': - resolution: {integrity: sha512-TkRHIV6k2D8OlUe8RtG+5jgOF/H98Myx0M6AOafC8DdNVOFiBSFa5cpRDtpm8LXOa9sVwe0+e6Q3FC56X/DZfg==} - engines: {node: '>=16.3.0'} + '@puppeteer/browsers@2.2.3': + resolution: {integrity: sha512-bJ0UBsk0ESOs6RFcLXOt99a3yTDcOKlzfjad+rhFwdaG1Lu/Wzq58GHYCDTlZ9z6mldf4g+NTb+TXEfe0PpnsQ==} + engines: {node: '>=18'} hasBin: true '@sideway/address@4.1.4': @@ -498,6 +498,9 @@ packages: '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + '@types/node@20.14.8': + resolution: {integrity: sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==} + '@types/node@20.8.10': resolution: {integrity: sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==} @@ -525,8 +528,8 @@ packages: '@types/yargs@17.0.29': resolution: {integrity: sha512-nacjqA3ee9zRF/++a3FUY1suHTFKZeHba2n8WeDw9cCVdmzmHpIxyzOJBcpHvvEmS8E9KqWlSnWHUkOrkhWcvA==} - '@types/yauzl@2.10.2': - resolution: {integrity: sha512-Km7XAtUIduROw7QPgvcft0lIupeG8a8rdKL8RiSyKvlE7dYY31fEn41HVuQsRFDuROA8tA4K2UVL+WdfFmErBA==} + '@types/yauzl@2.10.3': + resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} '@typescript-eslint/eslint-plugin@5.62.0': resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} @@ -620,8 +623,8 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - agent-base@7.1.0: - resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==} + agent-base@7.1.1: + resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} engines: {node: '>= 14'} ajv@6.12.6: @@ -717,8 +720,8 @@ packages: axios@0.27.2: resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} - b4a@1.6.4: - resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} + b4a@1.6.6: + resolution: {integrity: sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==} babel-jest@29.7.0: resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} @@ -748,11 +751,26 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + bare-events@2.4.2: + resolution: {integrity: sha512-qMKFd2qG/36aA4GwvKq8MxnPgCQAmBWmSyLWsJcbn8v03wvIPQ/hG1Ms8bPzndZxMDoHpxez5VOS+gC9Yi24/Q==} + + bare-fs@2.3.1: + resolution: {integrity: sha512-W/Hfxc/6VehXlsgFtbB5B4xFcsCl+pAh30cYhoFyXErf6oGrwjh8SwiPAdHgpmWonKuYpZgGywN0SXt7dgsADA==} + + bare-os@2.4.0: + resolution: {integrity: sha512-v8DTT08AS/G0F9xrhyLtepoo9EJBJ85FRSMbu1pQUlAf6A8T0tEEQGMVObWeqpjhSPXsE0VGlluFBJu2fdoTNg==} + + bare-path@2.1.3: + resolution: {integrity: sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==} + + bare-stream@2.1.3: + resolution: {integrity: sha512-tiDAH9H/kP+tvNO5sczyn9ZAA7utrSMobyDchsnyyXBuUe2FSQWbxhtuHB8jwpHYYevVo2UJpcmvvjrbHboUUQ==} + base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - basic-ftp@5.0.3: - resolution: {integrity: sha512-QHX8HLlncOLpy54mh+k/sWIFd0ThmRqwe9ZjELybGZK+tZ8rUb9VO0saKJUROTbE+KhzDUT7xziGpGrW8Kmd+g==} + basic-ftp@5.0.5: + resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==} engines: {node: '>=10.0.0'} bcrypt-pbkdf@1.0.2: @@ -825,8 +843,8 @@ packages: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} - chromium-bidi@0.4.33: - resolution: {integrity: sha512-IxoFM5WGQOIAd95qrSXzJUv4eXIrh+RvU3rwwqIiwYuvfE7U/Llj4fejbsJnjJMUYCuGtVQsY2gv7oGl4aTNSQ==} + chromium-bidi@0.5.24: + resolution: {integrity: sha512-5xQNN2SVBdZv4TxeMLaI+PelrnZsHDhn8h2JtyriLr+0qHcZS8BMuo93qN6J1VmtmrgYP+rmcLHcbpnA8QJh+w==} peerDependencies: devtools-protocol: '*' @@ -887,6 +905,15 @@ packages: typescript: optional: true + cosmiconfig@9.0.0: + resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} + engines: {node: '>=14'} + peerDependencies: + typescript: '>=4.9.5' + peerDependenciesMeta: + typescript: + optional: true + create-jest@29.7.0: resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -900,9 +927,6 @@ packages: engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} hasBin: true - cross-fetch@4.0.0: - resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==} - cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -925,8 +949,8 @@ packages: resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==} engines: {node: '>=0.10'} - data-uri-to-buffer@6.0.1: - resolution: {integrity: sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==} + data-uri-to-buffer@6.0.2: + resolution: {integrity: sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==} engines: {node: '>= 14'} data-urls@1.1.0: @@ -949,6 +973,15 @@ packages: supports-color: optional: true + debug@4.3.5: + resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dedent@1.5.1: resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} peerDependencies: @@ -984,8 +1017,8 @@ packages: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} - devtools-protocol@0.0.1203626: - resolution: {integrity: sha512-nEzHZteIUZfGCZtTiS1fRpC8UZmsfD1SiyPvaUNvS13dvKf666OAm8YTi0+Ca3n1nLEyu49Cy4+dPWpaHFJk9g==} + devtools-protocol@0.0.1299070: + resolution: {integrity: sha512-+qtL3eX50qsJ7c+qVyagqi7AWMoQCBGNfoyJZMwm/NSXVqLYbuitrWEEIzxfUmTNy7//Xe8yhMmQ+elj3uAqSg==} diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} @@ -1029,6 +1062,10 @@ packages: end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + env-paths@2.2.1: + resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} + engines: {node: '>=6'} + error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -1047,8 +1084,8 @@ packages: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} - escalade@3.1.1: - resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + escalade@3.1.2: + resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} escape-string-regexp@1.0.5: @@ -1304,9 +1341,9 @@ packages: resolution: {integrity: sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg==} engines: {node: '>=0.10.0'} - fs-extra@8.1.0: - resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} - engines: {node: '>=6 <7 || >=8'} + fs-extra@11.2.0: + resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} + engines: {node: '>=14.14'} fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -1356,8 +1393,8 @@ packages: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} - get-uri@6.0.2: - resolution: {integrity: sha512-5KLucCJobh8vBY1K07EFV4+cPZH3mrV9YeAruUseCQKHB58SGjjT2l9/eA9LD082IiuMjSlFJEcdJ27TXvbZNw==} + get-uri@6.0.3: + resolution: {integrity: sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==} engines: {node: '>= 14'} getpass@0.1.7: @@ -1456,16 +1493,16 @@ packages: html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - http-proxy-agent@7.0.0: - resolution: {integrity: sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==} + http-proxy-agent@7.0.2: + resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} http-signature@1.2.0: resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==} engines: {node: '>=0.8', npm: '>=1.3.7'} - https-proxy-agent@7.0.2: - resolution: {integrity: sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==} + https-proxy-agent@7.0.4: + resolution: {integrity: sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==} engines: {node: '>= 14'} human-signals@2.1.0: @@ -1509,16 +1546,14 @@ packages: resolution: {integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==} engines: {node: '>= 0.4'} + ip-address@9.0.5: + resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} + engines: {node: '>= 12'} + ip-regex@2.1.0: resolution: {integrity: sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==} engines: {node: '>=4'} - ip@1.1.8: - resolution: {integrity: sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==} - - ip@2.0.0: - resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} - is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} @@ -1822,6 +1857,9 @@ packages: jsbn@0.1.1: resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} + jsbn@1.1.0: + resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} + jsdom@15.2.1: resolution: {integrity: sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g==} engines: {node: '>=8'} @@ -1863,8 +1901,8 @@ packages: engines: {node: '>=6'} hasBin: true - jsonfile@4.0.0: - resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + jsonfile@6.1.0: + resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} jsprim@1.4.2: resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==} @@ -1961,9 +1999,6 @@ packages: mitt@3.0.1: resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} - mkdirp-classic@0.5.3: - resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} - ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -1980,15 +2015,6 @@ packages: resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==} engines: {node: '>= 0.4.0'} - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} @@ -2070,8 +2096,8 @@ packages: resolution: {integrity: sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==} engines: {node: '>= 14'} - pac-resolver@7.0.0: - resolution: {integrity: sha512-Fd9lT9vJbHYRACT8OhCbZBbxr6KRSawSovFpy8nDGshaK99S/EBhVIHp9+crhxrsZOuvLpgL1n23iyPg6Rl2hg==} + pac-resolver@7.0.1: + resolution: {integrity: sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==} engines: {node: '>= 14'} parent-module@1.0.1: @@ -2164,8 +2190,8 @@ packages: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} - proxy-agent@6.3.1: - resolution: {integrity: sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==} + proxy-agent@6.4.0: + resolution: {integrity: sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==} engines: {node: '>= 14'} proxy-from-env@1.1.0: @@ -2181,13 +2207,14 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - puppeteer-core@21.5.0: - resolution: {integrity: sha512-qG0RJ6qKgFz09UUZxDB9IcyTJGypQXMuE8WmEoHk7kgjutmRiOVv5RgsyUkY67AxDdBWx21bn1PHHRJnO/6b4A==} - engines: {node: '>=16.3.0'} + puppeteer-core@22.12.0: + resolution: {integrity: sha512-9gY+JwBW/Fp3/x9+cOGK7ZcwqjvtvY2xjqRqsAA0B3ZFMzBauVTSZ26iWTmvOQX2sk78TN/rd5rnetxVxmK5CQ==} + engines: {node: '>=18'} - puppeteer@21.5.0: - resolution: {integrity: sha512-prvy9rdauyIaaEgefQRcw9zhQnYQbl8O1Gj5VJazKJ7kwNx703+Paw/1bwA+b96jj/S+r55hrmF5SfiEG5PUcg==} - engines: {node: '>=16.3.0'} + puppeteer@22.12.0: + resolution: {integrity: sha512-kyUYI12SyJIjf9UGTnHfhNMYv4oVK321Jb9QZDBiGVNx5453SplvbdKI7UrF+S//3RtCneuUFCyHxnvQXQjpxg==} + engines: {node: '>=18'} + hasBin: true pure-rand@6.0.4: resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} @@ -2302,6 +2329,11 @@ packages: engines: {node: '>=10'} hasBin: true + semver@7.6.0: + resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + engines: {node: '>=10'} + hasBin: true + set-function-length@1.1.1: resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==} engines: {node: '>= 0.4'} @@ -2339,13 +2371,13 @@ packages: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} - socks-proxy-agent@8.0.2: - resolution: {integrity: sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==} + socks-proxy-agent@8.0.3: + resolution: {integrity: sha512-VNegTZKhuGq5vSD6XNKlbqWhyt/40CgoEw8XxD6dhnm8Jq9IEa3nIa4HwnM8XOqU0CdB0BwWVXusqiFXfHB3+A==} engines: {node: '>= 14'} - socks@2.7.1: - resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==} - engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} + socks@2.8.3: + resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==} + engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} source-map-support@0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} @@ -2361,6 +2393,9 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + sprintf-js@1.1.3: + resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} + sshpk@1.18.0: resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==} engines: {node: '>=0.10.0'} @@ -2374,8 +2409,8 @@ packages: resolution: {integrity: sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g==} engines: {node: '>=0.10.0'} - streamx@2.15.2: - resolution: {integrity: sha512-b62pAV/aeMjUoRN2C/9F0n+G8AfcJjNC0zw/ZmOHeFsIe4m4GzjVW9m6VHXVjk536NbdU9JRwKMJRfkc+zUFTg==} + streamx@2.18.0: + resolution: {integrity: sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==} string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} @@ -2434,16 +2469,19 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - tar-fs@3.0.4: - resolution: {integrity: sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==} + tar-fs@3.0.5: + resolution: {integrity: sha512-JOgGAmZyMgbqpLwct7ZV8VzkEB6pxXFBVErLtb+XCOqzc6w1xiWKI9GVd6bwk68EX7eJ4DWmfXVmq8K2ziZTGg==} - tar-stream@3.1.6: - resolution: {integrity: sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==} + tar-stream@3.1.7: + resolution: {integrity: sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==} test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} + text-decoder@1.1.0: + resolution: {integrity: sha512-TmLJNj6UgX8xcUZo4UDStGQtDiTzF7BzWlzn9g7UWrjkpHr5uJTK1ld16wZ3LXb2vb6jH8qU89dW5whuMdXYdw==} + text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} @@ -2469,9 +2507,6 @@ packages: resolution: {integrity: sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==} engines: {node: '>=6'} - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - tr46@1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} @@ -2523,6 +2558,9 @@ packages: tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + tslib@2.6.3: + resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} + tsutils@3.21.0: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -2587,9 +2625,9 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - universalify@0.1.2: - resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} - engines: {node: '>= 4.0.0'} + universalify@2.0.1: + resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} + engines: {node: '>= 10.0.0'} update-browserslist-db@1.0.13: resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} @@ -2600,8 +2638,8 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - urlpattern-polyfill@9.0.0: - resolution: {integrity: sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g==} + urlpattern-polyfill@10.0.0: + resolution: {integrity: sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==} uuid@3.4.0: resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} @@ -2637,9 +2675,6 @@ packages: walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} @@ -2649,9 +2684,6 @@ packages: whatwg-mimetype@2.3.0: resolution: {integrity: sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==} - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - whatwg-url@7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} @@ -2698,8 +2730,8 @@ packages: utf-8-validate: optional: true - ws@8.14.2: - resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} + ws@8.17.1: + resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -2745,6 +2777,9 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + zod@3.23.8: + resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + snapshots: '@aashutoshrathi/word-wrap@1.2.6': {} @@ -2774,7 +2809,7 @@ snapshots: '@babel/traverse': 7.23.2 '@babel/types': 7.23.0 convert-source-map: 2.0.0 - debug: 4.3.4 + debug: 4.3.5 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -2940,7 +2975,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.0 '@babel/types': 7.23.0 - debug: 4.3.4 + debug: 4.3.5 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -3013,7 +3048,7 @@ snapshots: jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(ts-node@10.9.1)': + '@jest/core@29.7.0(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -3027,7 +3062,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1) + jest-config: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -3224,13 +3259,14 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - '@puppeteer/browsers@1.8.0': + '@puppeteer/browsers@2.2.3': dependencies: debug: 4.3.4 extract-zip: 2.0.1 progress: 2.0.3 - proxy-agent: 6.3.1 - tar-fs: 3.0.4 + proxy-agent: 6.4.0 + semver: 7.6.0 + tar-fs: 3.0.5 unbzip2-stream: 1.4.3 yargs: 17.7.2 transitivePeerDependencies: @@ -3335,6 +3371,11 @@ snapshots: '@types/json5@0.0.29': {} + '@types/node@20.14.8': + dependencies: + undici-types: 5.26.5 + optional: true + '@types/node@20.8.10': dependencies: undici-types: 5.26.5 @@ -3361,12 +3402,12 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.2 - '@types/yauzl@2.10.2': + '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.8.10 + '@types/node': 20.14.8 optional: true - '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.7.0)(typescript@4.9.5)': + '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.7.0)(typescript@4.9.5))(eslint@8.7.0)(typescript@4.9.5)': dependencies: '@eslint-community/regexpp': 4.10.0 '@typescript-eslint/parser': 5.62.0(eslint@8.7.0)(typescript@4.9.5) @@ -3380,6 +3421,7 @@ snapshots: natural-compare-lite: 1.4.0 semver: 7.5.4 tsutils: 3.21.0(typescript@4.9.5) + optionalDependencies: typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -3391,6 +3433,7 @@ snapshots: '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) debug: 4.3.4 eslint: 8.7.0 + optionalDependencies: typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -3407,6 +3450,7 @@ snapshots: debug: 4.3.4 eslint: 8.7.0 tsutils: 3.21.0(typescript@4.9.5) + optionalDependencies: typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -3422,6 +3466,7 @@ snapshots: is-glob: 4.0.3 semver: 7.5.4 tsutils: 3.21.0(typescript@4.9.5) + optionalDependencies: typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -3467,7 +3512,7 @@ snapshots: acorn@8.11.2: {} - agent-base@7.1.0: + agent-base@7.1.1: dependencies: debug: 4.3.4 transitivePeerDependencies: @@ -3566,7 +3611,7 @@ snapshots: ast-types@0.13.4: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 asynckit@0.4.0: {} @@ -3583,7 +3628,7 @@ snapshots: transitivePeerDependencies: - debug - b4a@1.6.4: {} + b4a@1.6.6: {} babel-jest@29.7.0(@babel/core@7.23.2): dependencies: @@ -3639,9 +3684,32 @@ snapshots: balanced-match@1.0.2: {} + bare-events@2.4.2: + optional: true + + bare-fs@2.3.1: + dependencies: + bare-events: 2.4.2 + bare-path: 2.1.3 + bare-stream: 2.1.3 + optional: true + + bare-os@2.4.0: + optional: true + + bare-path@2.1.3: + dependencies: + bare-os: 2.4.0 + optional: true + + bare-stream@2.1.3: + dependencies: + streamx: 2.18.0 + optional: true + base64-js@1.5.1: {} - basic-ftp@5.0.3: {} + basic-ftp@5.0.5: {} bcrypt-pbkdf@1.0.2: dependencies: @@ -3715,11 +3783,12 @@ snapshots: char-regex@1.0.2: {} - chromium-bidi@0.4.33(devtools-protocol@0.0.1203626): + chromium-bidi@0.5.24(devtools-protocol@0.0.1299070): dependencies: - devtools-protocol: 0.0.1203626 + devtools-protocol: 0.0.1299070 mitt: 3.0.1 - urlpattern-polyfill: 9.0.0 + urlpattern-polyfill: 10.0.0 + zod: 3.23.8 ci-info@3.9.0: {} @@ -3765,15 +3834,25 @@ snapshots: js-yaml: 4.1.0 parse-json: 5.2.0 path-type: 4.0.0 + optionalDependencies: typescript: 4.9.5 - create-jest@29.7.0(@types/node@20.8.10)(ts-node@10.9.1): + cosmiconfig@9.0.0(typescript@4.9.5): + dependencies: + env-paths: 2.2.1 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + parse-json: 5.2.0 + optionalDependencies: + typescript: 4.9.5 + + create-jest@29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1) + jest-config: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -3788,12 +3867,6 @@ snapshots: dependencies: cross-spawn: 7.0.3 - cross-fetch@4.0.0: - dependencies: - node-fetch: 2.7.0 - transitivePeerDependencies: - - encoding - cross-spawn@7.0.3: dependencies: path-key: 3.1.1 @@ -3817,7 +3890,7 @@ snapshots: dependencies: assert-plus: 1.0.0 - data-uri-to-buffer@6.0.1: {} + data-uri-to-buffer@6.0.2: {} data-urls@1.1.0: dependencies: @@ -3833,6 +3906,10 @@ snapshots: dependencies: ms: 2.1.2 + debug@4.3.5: + dependencies: + ms: 2.1.2 + dedent@1.5.1: {} deep-is@0.1.4: {} @@ -3861,7 +3938,7 @@ snapshots: detect-newline@3.1.0: {} - devtools-protocol@0.0.1203626: {} + devtools-protocol@0.0.1299070: {} diff-sequences@29.6.3: {} @@ -3900,6 +3977,8 @@ snapshots: dependencies: once: 1.4.0 + env-paths@2.2.1: {} + error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 @@ -3962,7 +4041,7 @@ snapshots: is-date-object: 1.0.5 is-symbol: 1.0.4 - escalade@3.1.1: {} + escalade@3.1.2: {} escape-string-regexp@1.0.5: {} @@ -3995,10 +4074,11 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint@8.7.0): + eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0(eslint@8.7.0)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint@8.7.0): dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.7.0)(typescript@4.9.5) debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 5.62.0(eslint@8.7.0)(typescript@4.9.5) eslint: 8.7.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: @@ -4010,9 +4090,8 @@ snapshots: eslint-utils: 2.1.0 regexpp: 3.2.0 - eslint-plugin-import@2.29.0(@typescript-eslint/parser@5.62.0)(eslint@8.7.0): + eslint-plugin-import@2.29.0(@typescript-eslint/parser@5.62.0(eslint@8.7.0)(typescript@4.9.5))(eslint@8.7.0): dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.7.0)(typescript@4.9.5) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -4021,7 +4100,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.7.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint@8.7.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0(eslint@8.7.0)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint@8.7.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -4031,6 +4110,8 @@ snapshots: object.values: 1.1.7 semver: 6.3.1 tsconfig-paths: 3.14.2 + optionalDependencies: + '@typescript-eslint/parser': 5.62.0(eslint@8.7.0)(typescript@4.9.5) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -4175,7 +4256,7 @@ snapshots: get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: - '@types/yauzl': 2.10.2 + '@types/yauzl': 2.10.3 transitivePeerDependencies: - supports-color @@ -4230,7 +4311,7 @@ snapshots: dependencies: chalk: 4.1.2 commander: 5.1.0 - debug: 4.3.4 + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -4269,11 +4350,11 @@ snapshots: fs-exists-sync@0.1.0: {} - fs-extra@8.1.0: + fs-extra@11.2.0: dependencies: graceful-fs: 4.2.11 - jsonfile: 4.0.0 - universalify: 0.1.2 + jsonfile: 6.1.0 + universalify: 2.0.1 fs.realpath@1.0.0: {} @@ -4317,12 +4398,12 @@ snapshots: call-bind: 1.0.5 get-intrinsic: 1.2.2 - get-uri@6.0.2: + get-uri@6.0.3: dependencies: - basic-ftp: 5.0.3 - data-uri-to-buffer: 6.0.1 + basic-ftp: 5.0.5 + data-uri-to-buffer: 6.0.2 debug: 4.3.4 - fs-extra: 8.1.0 + fs-extra: 11.2.0 transitivePeerDependencies: - supports-color @@ -4425,9 +4506,9 @@ snapshots: html-escaper@2.0.2: {} - http-proxy-agent@7.0.0: + http-proxy-agent@7.0.2: dependencies: - agent-base: 7.1.0 + agent-base: 7.1.1 debug: 4.3.4 transitivePeerDependencies: - supports-color @@ -4438,9 +4519,9 @@ snapshots: jsprim: 1.4.2 sshpk: 1.18.0 - https-proxy-agent@7.0.2: + https-proxy-agent@7.0.4: dependencies: - agent-base: 7.1.0 + agent-base: 7.1.1 debug: 4.3.4 transitivePeerDependencies: - supports-color @@ -4482,12 +4563,13 @@ snapshots: hasown: 2.0.0 side-channel: 1.0.4 + ip-address@9.0.5: + dependencies: + jsbn: 1.1.0 + sprintf-js: 1.1.3 + ip-regex@2.1.0: {} - ip@1.1.8: {} - - ip@2.0.0: {} - is-array-buffer@3.0.2: dependencies: call-bind: 1.0.5 @@ -4600,7 +4682,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.4 + debug: 4.3.5 istanbul-lib-coverage: 3.2.0 source-map: 0.6.1 transitivePeerDependencies: @@ -4643,16 +4725,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@20.8.10)(ts-node@10.9.1): + jest-cli@29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.1) + '@jest/core': 29.7.0(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1) + create-jest: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1) + jest-config: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -4662,12 +4744,11 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@20.8.10)(ts-node@10.9.1): + jest-config@29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)): dependencies: '@babel/core': 7.23.2 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.8.10 babel-jest: 29.7.0(@babel/core@7.23.2) chalk: 4.1.2 ci-info: 3.9.0 @@ -4687,6 +4768,8 @@ snapshots: pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 20.8.10 ts-node: 10.9.1(@types/node@20.8.10)(typescript@4.9.5) transitivePeerDependencies: - babel-plugin-macros @@ -4820,14 +4903,14 @@ snapshots: jest-util: 29.7.0 jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): - dependencies: + optionalDependencies: jest-resolve: 29.7.0 - jest-puppeteer@9.0.1(puppeteer@21.5.0)(typescript@4.9.5): + jest-puppeteer@9.0.1(puppeteer@22.12.0(typescript@4.9.5))(typescript@4.9.5): dependencies: expect-puppeteer: 9.0.1 jest-environment-puppeteer: 9.0.1(typescript@4.9.5) - puppeteer: 21.5.0(typescript@4.9.5) + puppeteer: 22.12.0(typescript@4.9.5) transitivePeerDependencies: - debug - supports-color @@ -4981,12 +5064,12 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@20.8.10)(ts-node@10.9.1): + jest@29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.1) + '@jest/core': 29.7.0(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1) + jest-cli: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -5016,6 +5099,8 @@ snapshots: jsbn@0.1.1: {} + jsbn@1.1.0: {} + jsdom@15.2.1: dependencies: abab: 2.0.6 @@ -5068,7 +5153,9 @@ snapshots: json5@2.2.3: {} - jsonfile@4.0.0: + jsonfile@6.1.0: + dependencies: + universalify: 2.0.1 optionalDependencies: graceful-fs: 4.2.11 @@ -5156,8 +5243,6 @@ snapshots: mitt@3.0.1: {} - mkdirp-classic@0.5.3: {} - ms@2.1.2: {} ms@2.1.3: {} @@ -5168,10 +5253,6 @@ snapshots: netmask@2.0.2: {} - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - node-int64@0.4.0: {} node-releases@2.0.13: {} @@ -5261,20 +5342,19 @@ snapshots: pac-proxy-agent@7.0.1: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 - agent-base: 7.1.0 + agent-base: 7.1.1 debug: 4.3.4 - get-uri: 6.0.2 - http-proxy-agent: 7.0.0 - https-proxy-agent: 7.0.2 - pac-resolver: 7.0.0 - socks-proxy-agent: 8.0.2 + get-uri: 6.0.3 + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.4 + pac-resolver: 7.0.1 + socks-proxy-agent: 8.0.3 transitivePeerDependencies: - supports-color - pac-resolver@7.0.0: + pac-resolver@7.0.1: dependencies: degenerator: 5.0.1 - ip: 1.1.8 netmask: 2.0.2 parent-module@1.0.1: @@ -5345,16 +5425,16 @@ snapshots: kleur: 3.0.3 sisteransi: 1.0.5 - proxy-agent@6.3.1: + proxy-agent@6.4.0: dependencies: - agent-base: 7.1.0 + agent-base: 7.1.1 debug: 4.3.4 - http-proxy-agent: 7.0.0 - https-proxy-agent: 7.0.2 + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.4 lru-cache: 7.18.3 pac-proxy-agent: 7.0.1 proxy-from-env: 1.1.0 - socks-proxy-agent: 8.0.2 + socks-proxy-agent: 8.0.3 transitivePeerDependencies: - supports-color @@ -5369,28 +5449,26 @@ snapshots: punycode@2.3.1: {} - puppeteer-core@21.5.0: + puppeteer-core@22.12.0: dependencies: - '@puppeteer/browsers': 1.8.0 - chromium-bidi: 0.4.33(devtools-protocol@0.0.1203626) - cross-fetch: 4.0.0 - debug: 4.3.4 - devtools-protocol: 0.0.1203626 - ws: 8.14.2 + '@puppeteer/browsers': 2.2.3 + chromium-bidi: 0.5.24(devtools-protocol@0.0.1299070) + debug: 4.3.5 + devtools-protocol: 0.0.1299070 + ws: 8.17.1 transitivePeerDependencies: - bufferutil - - encoding - supports-color - utf-8-validate - puppeteer@21.5.0(typescript@4.9.5): + puppeteer@22.12.0(typescript@4.9.5): dependencies: - '@puppeteer/browsers': 1.8.0 - cosmiconfig: 8.3.6(typescript@4.9.5) - puppeteer-core: 21.5.0 + '@puppeteer/browsers': 2.2.3 + cosmiconfig: 9.0.0(typescript@4.9.5) + devtools-protocol: 0.0.1299070 + puppeteer-core: 22.12.0 transitivePeerDependencies: - bufferutil - - encoding - supports-color - typescript - utf-8-validate @@ -5514,6 +5592,10 @@ snapshots: dependencies: lru-cache: 6.0.0 + semver@7.6.0: + dependencies: + lru-cache: 6.0.0 + set-function-length@1.1.1: dependencies: define-data-property: 1.1.1 @@ -5549,17 +5631,17 @@ snapshots: smart-buffer@4.2.0: {} - socks-proxy-agent@8.0.2: + socks-proxy-agent@8.0.3: dependencies: - agent-base: 7.1.0 + agent-base: 7.1.1 debug: 4.3.4 - socks: 2.7.1 + socks: 2.8.3 transitivePeerDependencies: - supports-color - socks@2.7.1: + socks@2.8.3: dependencies: - ip: 2.0.0 + ip-address: 9.0.5 smart-buffer: 4.2.0 source-map-support@0.5.13: @@ -5576,6 +5658,8 @@ snapshots: sprintf-js@1.0.3: {} + sprintf-js@1.1.3: {} + sshpk@1.18.0: dependencies: asn1: 0.2.6 @@ -5594,10 +5678,13 @@ snapshots: stealthy-require@1.1.1: {} - streamx@2.15.2: + streamx@2.18.0: dependencies: fast-fifo: 1.3.2 queue-tick: 1.0.1 + text-decoder: 1.1.0 + optionalDependencies: + bare-events: 2.4.2 string-length@4.0.2: dependencies: @@ -5656,17 +5743,19 @@ snapshots: symbol-tree@3.2.4: {} - tar-fs@3.0.4: + tar-fs@3.0.5: dependencies: - mkdirp-classic: 0.5.3 pump: 3.0.0 - tar-stream: 3.1.6 + tar-stream: 3.1.7 + optionalDependencies: + bare-fs: 2.3.1 + bare-path: 2.1.3 - tar-stream@3.1.6: + tar-stream@3.1.7: dependencies: - b4a: 1.6.4 + b4a: 1.6.6 fast-fifo: 1.3.2 - streamx: 2.15.2 + streamx: 2.18.0 test-exclude@6.0.0: dependencies: @@ -5674,6 +5763,10 @@ snapshots: glob: 7.2.3 minimatch: 3.1.2 + text-decoder@1.1.0: + dependencies: + b4a: 1.6.6 + text-table@0.2.0: {} through@2.3.8: {} @@ -5697,20 +5790,17 @@ snapshots: psl: 1.9.0 punycode: 2.3.1 - tr46@0.0.3: {} - tr46@1.0.1: dependencies: punycode: 2.3.1 tree-kill@1.2.2: {} - ts-jest@29.1.1(@babel/core@7.23.2)(jest@29.7.0)(typescript@4.9.5): + ts-jest@29.1.1(@babel/core@7.23.2)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.2))(jest@29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)))(typescript@4.9.5): dependencies: - '@babel/core': 7.23.2 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1) + jest: 29.7.0(@types/node@20.8.10)(ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -5718,6 +5808,10 @@ snapshots: semver: 7.5.4 typescript: 4.9.5 yargs-parser: 21.1.1 + optionalDependencies: + '@babel/core': 7.23.2 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.23.2) ts-node@10.9.1(@types/node@20.8.10)(typescript@4.9.5): dependencies: @@ -5748,6 +5842,8 @@ snapshots: tslib@2.6.2: {} + tslib@2.6.3: {} + tsutils@3.21.0(typescript@4.9.5): dependencies: tslib: 1.14.1 @@ -5820,19 +5916,19 @@ snapshots: undici-types@5.26.5: {} - universalify@0.1.2: {} + universalify@2.0.1: {} update-browserslist-db@1.0.13(browserslist@4.22.1): dependencies: browserslist: 4.22.1 - escalade: 3.1.1 + escalade: 3.1.2 picocolors: 1.0.0 uri-js@4.4.1: dependencies: punycode: 2.3.1 - urlpattern-polyfill@9.0.0: {} + urlpattern-polyfill@10.0.0: {} uuid@3.4.0: {} @@ -5876,8 +5972,6 @@ snapshots: dependencies: makeerror: 1.0.12 - webidl-conversions@3.0.1: {} - webidl-conversions@4.0.2: {} whatwg-encoding@1.0.5: @@ -5886,11 +5980,6 @@ snapshots: whatwg-mimetype@2.3.0: {} - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - whatwg-url@7.1.0: dependencies: lodash.sortby: 4.7.0 @@ -5938,7 +6027,7 @@ snapshots: ws@7.5.9: {} - ws@8.14.2: {} + ws@8.17.1: {} xml-name-validator@3.0.0: {} @@ -5955,7 +6044,7 @@ snapshots: yargs@17.7.2: dependencies: cliui: 8.0.1 - escalade: 3.1.1 + escalade: 3.1.2 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 @@ -5970,3 +6059,5 @@ snapshots: yn@3.1.1: {} yocto-queue@0.1.0: {} + + zod@3.23.8: {} diff --git a/src/NeoScraper.ts b/src/NeoScraper.ts index b07bfb1..9271f41 100644 --- a/src/NeoScraper.ts +++ b/src/NeoScraper.ts @@ -16,6 +16,7 @@ export default class NeoScraper { new engines.Gelbooru(), new engines.Inkbunny(), new engines.Moebooru(), + new engines.Nozomi(), new engines.Philomena(), new engines.Pixiv(), new engines.Reddit(), diff --git a/src/ScrapeEngine.ts b/src/ScrapeEngine.ts index 452074f..97eb453 100644 --- a/src/ScrapeEngine.ts +++ b/src/ScrapeEngine.ts @@ -5,6 +5,7 @@ export type ContentType = "image" | "video"; export type UploadMode = "content" | "url"; export class ScrapedPost { + name: string | undefined = undefined; contentUrl = ""; pageUrl = ""; contentType: ContentType = "image"; @@ -17,6 +18,7 @@ export class ScrapedPost { referrer: string | undefined; extraContentUrl: string | undefined; cookies: Cookies | undefined; + uploadMode: UploadMode = "url"; } export class ScrapedTag { @@ -30,7 +32,7 @@ export class ScrapedTag { } export class ScrapedNote { - constructor(public text: string, public polygon: number[][]) {} + constructor(public text: string, public polygon: number[][]) { } } export class ScrapeResult { @@ -82,8 +84,6 @@ export interface ScrapeEngine { notes: string[]; supportedHosts: string[]; - get uploadMode(): UploadMode; - canImport(url: Location): boolean; scrapeDocument(document: Document): ScrapeResult; } @@ -94,10 +94,6 @@ export abstract class ScrapeEngineBase implements ScrapeEngine { abstract notes: string[]; abstract supportedHosts: string[]; - get uploadMode(): UploadMode { - return "url"; - } - canImport(url: Location): boolean { return this.supportedHosts.indexOf(url.host) != -1; } diff --git a/src/engines/Danbooru.ts b/src/engines/Danbooru.ts index 5712c3f..9cf4efb 100644 --- a/src/engines/Danbooru.ts +++ b/src/engines/Danbooru.ts @@ -1,4 +1,4 @@ -import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature, UploadMode } from "../ScrapeEngine.js"; +import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js"; import { TagCategory } from "../BooruTypes.js"; import { createNoteFromDanbooruArticle, guessContentType } from "../Utility.js"; @@ -8,13 +8,10 @@ export default class Danbooru extends ScrapeEngineBase { notes = []; supportedHosts = ["danbooru.donmai.us", "safebooru.donmai.us"]; - override get uploadMode(): UploadMode { - return "content"; - } - scrapeDocument(document: Document): ScrapeResult { const result = new ScrapeResult(this.name); const post = new ScrapedPost(); + post.uploadMode = "content"; post.pageUrl = document.location.href; // Set image url diff --git a/src/engines/Ehentai.ts b/src/engines/Ehentai.ts index 68bd792..1089d01 100644 --- a/src/engines/Ehentai.ts +++ b/src/engines/Ehentai.ts @@ -1,4 +1,4 @@ -import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapeEngineFeature, UploadMode } from "../ScrapeEngine.js"; +import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapeEngineFeature } from "../ScrapeEngine.js"; import { parseResolutionString } from "../Utility.js"; import Cookies from "js-cookie"; @@ -8,10 +8,6 @@ export default class Ehentai extends ScrapeEngineBase { notes = ["Rating is assumed to be unsafe."]; supportedHosts = ["e-hentai.org", "exhentai.org"]; - override get uploadMode(): UploadMode { - return "content"; - } - scrapeDocument(document: Document): ScrapeResult { const result = new ScrapeResult(this.name); const post = new ScrapedPost(); diff --git a/src/engines/Fallback.ts b/src/engines/Fallback.ts index 1b6695e..c47abe1 100644 --- a/src/engines/Fallback.ts +++ b/src/engines/Fallback.ts @@ -6,7 +6,7 @@ class MediaElement { public readonly contentType: ContentType, public readonly contentUrl: string, public readonly size: number - ) {} + ) { } } export default class Fallback extends ScrapeEngineBase { @@ -27,7 +27,7 @@ export default class Fallback extends ScrapeEngineBase { post.pageUrl = document.location.href; post.contentUrl = document.location.href; post.contentType = "video"; - result.posts.push(post); + result.tryAddPost(post); return result; } @@ -50,10 +50,16 @@ export default class Fallback extends ScrapeEngineBase { if (largestMediaElement) { const post = new ScrapedPost(); + post.name = "Upload as URL"; post.pageUrl = document.location.href; post.contentUrl = largestMediaElement.contentUrl; post.contentType = largestMediaElement.contentType; - result.posts.push(post); + result.tryAddPost(post); + + const clone = Object.assign({}, post); + clone.name = "Upload as content"; + clone.uploadMode = "content"; + result.tryAddPost(clone); } return result; diff --git a/src/engines/Nozomi.ts b/src/engines/Nozomi.ts new file mode 100644 index 0000000..08d3991 --- /dev/null +++ b/src/engines/Nozomi.ts @@ -0,0 +1,49 @@ +import { ScrapeEngineBase, ScrapeResult, ScrapedPost, ScrapedTag, ScrapeEngineFeature } from "../ScrapeEngine.js"; +import { TagCategory } from "../BooruTypes.js"; + +export default class e621 extends ScrapeEngineBase { + name = "nozomi"; + features: ScrapeEngineFeature[] = ["content", "tags", "tag_category"]; + notes = ["Image preview might not work due to hotlink protection."]; + supportedHosts = ["nozomi.la"]; + + scrapeDocument(document: Document): ScrapeResult { + const result = new ScrapeResult(this.name); + const post = new ScrapedPost(); + post.pageUrl = document.location.href; + + // Set image url + const downloadEl = document.querySelector(".post a") as HTMLAnchorElement; + post.contentUrl = downloadEl?.href; + + // Set tags + const tagEls = Array.from(document.querySelectorAll(".sidebar li")).map((x) => x as HTMLLIElement); + + for (const el of tagEls) { + const tagName = el.innerText; + let category: TagCategory | undefined; + + switch (el.querySelector("a")?.className) { + // https://e621.net/help/api#tags_listing + case "copyright": + category = "copyright"; + break; + case "character": + category = "character"; + break; + case "artist": + category = "artist"; + break; + } + + if (tagName) { + const tag = new ScrapedTag(tagName, category); + post.tags.push(tag); + } + } + + result.tryAddPost(post); + + return result; + } +} diff --git a/src/engines/Twitter.ts b/src/engines/Twitter.ts index 83ea9bc..b78f05d 100644 --- a/src/engines/Twitter.ts +++ b/src/engines/Twitter.ts @@ -15,7 +15,7 @@ export default class Twitter extends ScrapeEngineBase { name = "twitter"; features: ScrapeEngineFeature[] = ["content"]; notes = []; - supportedHosts = ["twitter.com", "mobile.twitter.com"]; + supportedHosts = ["twitter.com", "mobile.twitter.com", "x.com"]; scrapeDocument(document: Document): ScrapeResult { const result = new ScrapeResult(this.name); diff --git a/src/engines/index.ts b/src/engines/index.ts index 1eab8a6..f07d6e8 100644 --- a/src/engines/index.ts +++ b/src/engines/index.ts @@ -7,6 +7,7 @@ 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 Nozomi } from "./Nozomi.js"; export { default as Philomena } from "./Philomena.js"; export { default as Pixiv } from "./Pixiv.js"; export { default as Reddit } from "./Reddit.js";