Added sorting env to ManyVids seed, changed default to followers instead of top.

This commit is contained in:
DebaucheryLibrarian
2026-07-09 00:16:07 +02:00
parent c3dad0b523
commit a3ae82dcd3

View File

@@ -4,12 +4,13 @@ const unprint = require('unprint');
const slugify = require('../src/utils/slugify');
const limit = Number(process.env.MV_LIMIT) || 1000;
const sorting = process.env.MV_SORT || 'followers'; // followers, top, mostActive, newest, trending
async function fetchCreators(page = 1, acc = []) {
console.log(`Fetching creators ${acc.length}/${limit}`);
// size seems to be capped at 70
const res = await unprint.get(`https://api.manyvids.com/search/creators/list?contentPref=1,2,3&sort=top&size=50&from=${(page - 1) * 50}`);
const res = await unprint.get(`https://api.manyvids.com/search/creators/list?contentPref=1,2,3&sort=${sorting}&size=50&from=${(page - 1) * 50}`);
if (res.ok && res.data?.creators) {
const creators = acc.concat(res.data.creators.map((creator) => ({