Separated media request limits.

This commit is contained in:
DebaucheryLibrarian
2024-10-29 22:42:30 +01:00
parent 070ef182db
commit ea02ec3943
8 changed files with 75 additions and 13 deletions

View File

@@ -91,7 +91,9 @@ function scrapeProfile({ query }, url, channel) {
async function fetchLatest(channel, page) {
// const res = await unprint.get(`https://www.analvids.com/new-videos/${page}`, { selectAll: '.card-scene' }); // analvids as channel
const res = await unprint.get(`${channel.url}/latest/${page}`, { selectAll: '.card-scene' }); // studios as channels
const res = await unprint.get(`${channel.url}/latest/${page}`, {
selectAll: '.card-scene', // studios as channels
});
if (res.ok) {
return scrapeAll(res.context, channel);
@@ -100,6 +102,39 @@ async function fetchLatest(channel, page) {
return res.status;
}
/*
async function fetchLatest(channel, page) {
// const res = await unprint.get(`https://www.analvids.com/new-videos/${page}`, { selectAll: '.card-scene' }); // analvids as channel
// const res = await unprint.get(`${channel.url}/latest/${page}`, { selectAll: '.card-scene' }); // studios as channels
const url = `${channel.url}/latest/${page}`; // studios as channels
const { tab } = await http.getBrowserSession('analvids', {
bypass: {
headless: false,
},
});
const res = await tab.goto(url);
const status = res.status();
console.log('STATUS', status);
if (status === 200) {
const html = await tab.content();
const context = unprint.initAll(html, '.card-scene'); // studios as channels
const scenes = scrapeAll(context, channel);
tab.close();
return scenes;
}
return res.status;
}
*/
async function getActorUrl(actor, channel) {
if (actor.url) {
return actor.url;