yande.re hotlink protection workaround

pull/17/head
neobooru 2024-07-11 22:55:02 +02:00
parent 17c84b16db
commit 593c4cef0d
3 changed files with 19 additions and 2 deletions

View File

@ -23,3 +23,16 @@ Scrape a booru-like post object from the DOM.
| twitter | twitter.com, mobile.twitter.com | content | |
| zerochan | www.zerochan.net | content, resolution, tags, tag_category | Rating is assumed to be safe. |
| fallback | | content | Tries to find the largest image or video on the current page. |
## Development
Build SzuruChrome with your local version of neo-scraper.
```sh
cd neo-scraper
pnpm install
pnpm build # or pnpm watch in another terminal
pnpm link --global
cd ../SzuruChrome
pnpm dev
```

View File

@ -1,6 +1,6 @@
{
"name": "neo-scraper",
"version": "0.9.0",
"version": "0.9.1",
"description": "Scrape a booru-like post object from the DOM.",
"type": "module",
"main": "dist/index.js",

View File

@ -13,6 +13,10 @@ export default class Moebooru extends ScrapeEngineBase {
const post = new ScrapedPost();
post.pageUrl = document.location.href;
if (document.location.host == "yande.re") {
post.uploadMode = "content";
}
// Set image url
const originalImageElement = document.querySelector("#highres") as HTMLAnchorElement;
if (originalImageElement) {