Fixed deprecated unprint cookie handling in Dorcel scraper.

This commit is contained in:
DebaucheryLibrarian
2026-08-07 02:46:01 +02:00
parent ad56e7b9e0
commit 5b9c635ed1

View File

@@ -1,7 +1,6 @@
'use strict';
const unprint = require('unprint');
const cookie = require('cookie');
const slugify = require('../utils/slugify');
@@ -54,16 +53,14 @@ function scrapeAll(scenes, channel) {
async function beforeFetchLatest(channel) {
// scene page only seems to accept language preferences from session
const { res } = await unprint.get(`${channel.url}/en/news-videos-x-marc-dorcel`, {
const { cookies } = await unprint.get(`${channel.url}/en/news-videos-x-marc-dorcel`, {
headers: {
'X-Requested-With': 'XMLHttpRequest',
'Accept-Language': 'en-US,en', // fetch English rather than French titles
},
});
const sessionCookie = cookie.parse(res.headers['set-cookie'][0])?.dorcelclub;
return `dorcelclub=${sessionCookie}`;
return `dorcelclub=${cookies.dorcelclub}`;
}
async function fetchLatest(channel, page = 1, _options, { beforeFetchLatest: sessionCookie }) {