Restored Mike Adriano scraper.
This commit is contained in:
@@ -37,8 +37,6 @@ async function scrapeScene({ query }, url) {
|
||||
const pathname = new URL(url).pathname;
|
||||
release.entryId = pathname.match(/\/view\/(\d+)/)?.[1] || pathname.match(/\/view\/([\w-]+)/)?.[1];
|
||||
|
||||
console.log(release);
|
||||
|
||||
release.title = query.cnt('.content-page-info .title');
|
||||
release.description = query.cnt('.content-page-info .desc');
|
||||
release.date = query.date('.content-page-info .date, .content-page-info .hide, .post-date', 'Do MMM YYYY');
|
||||
@@ -73,29 +71,23 @@ async function fetchScene(url, channel) {
|
||||
const cookieJar = http.cookieJar();
|
||||
const session = http.session({ cookieJar });
|
||||
|
||||
console.log(cookieJar);
|
||||
|
||||
/* not working
|
||||
const resA = await http.get(url, {
|
||||
session,
|
||||
extract: {
|
||||
cookieJar,
|
||||
// runScripts: 'dangerously',
|
||||
runScripts: 'dangerously',
|
||||
},
|
||||
});
|
||||
|
||||
console.log(resA.headers, cookieJar.getCookiesSync(url));
|
||||
const cookie = cookieJar.getCookieStringSync(url);
|
||||
cookieJar.setCookieSync(http.toughCookie.Cookie.parse(resA.document.cookie), url);
|
||||
|
||||
console.log(cookie);
|
||||
console.log(res.req);
|
||||
*/
|
||||
|
||||
const res = await http.get(url, {
|
||||
headers: {
|
||||
cookie,
|
||||
},
|
||||
session,
|
||||
});
|
||||
|
||||
// console.log(res.req);
|
||||
|
||||
if (res.ok) {
|
||||
const item = qu.init(res.document);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user