Skip to content

Commit

Permalink
fix(Lidl_cz BF): topmonks#2654 - mironet.cz - input with generic urls…
Browse files Browse the repository at this point in the history
… array
  • Loading branch information
oleksandravalko committed Nov 27, 2024
1 parent e604ef1 commit 15a2e95
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions actors/mironet-daily/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ function allCategoriesRequests(buffer) {
}

/**
* @param {{type:ActorType, bfUrl:string}}
* @param {{type:ActorType, urls:array}}
* @returns {{url: string, userData: {label: Labels, baseUrl?: string}}}
*/
function startingRequest({ type, bfUrl }) {
function startingRequest({ type, urls }) {
switch (type) {
case ActorType.BlackFriday:
return {
url: bfUrl,
url: urls.length? urls[0] : 'https://www.mironet.cz/vyprodej/?v=black-friday',
userData: {
label: Labels.SaleCategory
}
Expand Down Expand Up @@ -165,7 +165,7 @@ async function main() {
maxRequestRetries,
proxyGroups,
type = ActorType.Full,
bfUrl = "https://www.mironet.cz/vyprodej/?v=black-friday"
urls
} = await getInput();
const rootUrl = "https://www.mironet.cz";
const shop = shopName(rootUrl);
Expand Down Expand Up @@ -284,7 +284,7 @@ async function main() {
}
});

const request = startingRequest({ type, bfUrl });
const request = startingRequest({ type, urls });
log.info("ACTOR - run crawler");
await crawler.run([request]);

Expand Down

0 comments on commit 15a2e95

Please sign in to comment.