From 4a3674feac79c20f7f5d0f4998dd12cf8c278d67 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sun, 2 Jul 2023 05:07:38 +0200 Subject: [PATCH] Added dedicated Arch Angel scraper. --- assets/components/campaigns/campaign.vue | 12 ++ assets/components/entities/entity.vue | 16 ++- assets/components/home/home.vue | 2 +- assets/components/releases/releases.vue | 122 +++++++++------- assets/js/releases/actions.js | 7 +- migrations/20190325001339_releases.js | 4 + package-lock.json | 14 +- package.json | 2 +- seeds/00_tags.js | 4 + seeds/02_sites.js | 5 - src/actors.js | 1 + src/scrapers/archangel.js | 173 +++++++++++++++++++++++ src/scrapers/scrapers.js | 5 +- src/scrapers/traxxx.js | 2 +- 14 files changed, 291 insertions(+), 78 deletions(-) create mode 100755 src/scrapers/archangel.js diff --git a/assets/components/campaigns/campaign.vue b/assets/components/campaigns/campaign.vue index 2a24e9d1..730b17e0 100755 --- a/assets/components/campaigns/campaign.vue +++ b/assets/components/campaigns/campaign.vue @@ -63,6 +63,10 @@ function entityCampaign() { return randomCampaign; } + if (this.allowGeneric) { + return this.genericCampaign(); + } + this.$emit('campaign', null); return null; @@ -84,6 +88,10 @@ function tagCampaign() { return randomCampaign; } + if (this.allowGeneric) { + return this.genericCampaign(); + } + this.$emit('campaign', null); return null; @@ -134,6 +142,10 @@ export default { type: Number, default: null, }, + allowGeneric: { + type: Boolean, + default: false, + }, maxRatio: { type: Number, default: null, diff --git a/assets/components/entities/entity.vue b/assets/components/entities/entity.vue index aee25c97..a823e4c9 100755 --- a/assets/components/entities/entity.vue +++ b/assets/components/entities/entity.vue @@ -114,6 +114,7 @@
@@ -157,14 +158,17 @@ async function fetchEntity(scroll = true) { const campaign = entity.campaigns.find((campaignX) => !campaignX.banner) || entity.parent?.campaigns.find((campaignX) => !campaignX.banner); - const { searchParams, pathname, origin } = new URL(entity.url); + if (entity.url) { + const { searchParams, pathname, origin } = new URL(entity.url); - const affiliateParams = new URLSearchParams({ - ...(entity.url && Object.fromEntries(searchParams)), // preserve any query in entity URL, e.g. ?siteId=5 - ...(campaign?.affiliate?.parameters && Object.fromEntries(new URLSearchParams(campaign.affiliate.parameters))), // append affiliate parameters - }).toString(); + const affiliateParams = new URLSearchParams({ + ...(entity.url && Object.fromEntries(searchParams)), // preserve any query in entity URL, e.g. ?siteId=5 + ...(campaign?.affiliate?.parameters && Object.fromEntries(new URLSearchParams(campaign.affiliate.parameters))), // append affiliate parameters + }).toString(); + + this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${origin}${pathname}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`; + } - this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${origin}${pathname}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`; this.done = true; if (scroll && this.$refs.filter?.$el) { diff --git a/assets/components/home/home.vue b/assets/components/home/home.vue index 07cf5d50..4022a056 100755 --- a/assets/components/home/home.vue +++ b/assets/components/home/home.vue @@ -76,7 +76,7 @@ export default { releases: [], networks: [], pageTitle: null, - limit: 30, + limit: 29, // reserve one campaign spot totalCount: 0, from: null, done: false, diff --git a/assets/components/releases/releases.vue b/assets/components/releases/releases.vue index ba1983d6..5db2ce93 100755 --- a/assets/components/releases/releases.vue +++ b/assets/components/releases/releases.vue @@ -12,18 +12,34 @@ :key="sfw" class="nolist tiles" > -
  • - -
  • + -