Set user who submitted the art as the artists on furaffinity

pull/16/head
neobooru 2022-08-10 14:00:27 +02:00
parent d127ec755b
commit 73ffee047e
2 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,7 @@ test("get furaffinity.net post 23281942", async () => {
expect(res.posts[0]).toHaveTag("zac");
expect(res.posts[0]).toHaveTag("riven");
expect(res.posts[0]).toHaveTag("pool");
expect(res.posts[0]).toHaveTag("nielsdejong", "artist");
expect(res.posts[0]).toHaveResolution([1280, 1279]);
expect(res.posts[0].pageUrl).toBe(pageUrl);
expect(res.posts[0].contentUrl).toBe(

View File

@ -51,6 +51,12 @@ export default class FurAffinity extends ScrapeEngineBase {
.map((x) => (x as HTMLSpanElement).innerText)
.map((x) => new ScrapedTag(x));
// Set user who submitted the art as the artist
const submissionUser = document.querySelector<HTMLElement>(".submission-id-sub-container > a > strong")?.innerText;
if (submissionUser) {
post.tags.push(new ScrapedTag(submissionUser, "artist"));
}
result.tryAddPost(post);
return result;