Added mobile album scraping to Blowpass, improved wrapper.
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
const bhttp = require('bhttp');
|
||||
// const bhttp = require('bhttp');
|
||||
|
||||
const { fetchLatest, fetchUpcoming, scrapeScene, fetchProfile } = require('./gamma');
|
||||
const { fetchScene, fetchLatest, fetchUpcoming, fetchProfile } = require('./gamma');
|
||||
|
||||
async function fetchScene(url, site) {
|
||||
// const res = await bhttp.get(url);
|
||||
const res = await bhttp.get(`https://www.blowpass.com/en/video/${site.id}/${new URL(url).pathname.split('/').slice(-2).join('/')}`);
|
||||
async function fetchSceneWrapper(url, site, baseRelease) {
|
||||
const release = await fetchScene(url, site, baseRelease);
|
||||
|
||||
const release = await scrapeScene(res.body.toString(), url, site);
|
||||
release.channel = release.$('.siteNameSpan')
|
||||
.text()
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace('.com', '');
|
||||
if (site.isFallback && release.channel) {
|
||||
const channelUrl = url.replace('blowpass.com', `${release.channel}.com`);
|
||||
|
||||
if (['onlyteenblowjobs.com', 'mommyblowsbest.com'].includes(release.channel)) release.url = url.replace(/video\/\w+\//, 'scene/');
|
||||
else release.url = url.replace(/video\/\w+\//, 'video/');
|
||||
if (['onlyteenblowjobs', 'mommyblowsbest'].includes(release.channel)) {
|
||||
release.url = channelUrl.replace(/video\/\w+\//, 'scene/');
|
||||
return release;
|
||||
}
|
||||
|
||||
release.url = channelUrl.replace(/video\/\w+\//, 'video/');
|
||||
}
|
||||
|
||||
return release;
|
||||
}
|
||||
@@ -33,5 +33,5 @@ module.exports = {
|
||||
fetchLatest,
|
||||
fetchProfile: networkFetchProfile,
|
||||
fetchUpcoming,
|
||||
fetchScene,
|
||||
fetchScene: fetchSceneWrapper,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user