Major API change for 'q', renamed to 'qu', refactored modules. Fixed Gamma URL entry ID regex.

This commit is contained in:
2020-03-09 02:02:29 +01:00
parent 7d71cf3a8c
commit 6cbb7f9c1e
21 changed files with 611 additions and 561 deletions

View File

@@ -79,32 +79,32 @@ function scrapeUpcoming(html, site) {
*/
function scrapeScene(html, url, _site) {
const { q, qa, qu, qi, qt } = ex(html, '.playerSection');
const { qu } = ex(html, '.playerSection');
const release = {};
[release.shootId] = q('.vdoTags + .vdoCast', true).match(/\w+$/);
[release.shootId] = qu.q('.vdoTags + .vdoCast', true).match(/\w+$/);
[release.entryId] = url.split('/')[3].match(/\d+$/);
release.title = q('.ps-vdoHdd h1', true);
release.description = q('.vdoDesc', true);
release.title = qu.q('.ps-vdoHdd h1', true);
release.description = qu.q('.vdoDesc', true);
release.actors = qa('a[href*="/model"]', true);
release.tags = qa('.vdoTags a', true);
release.actors = qu.all('a[href*="/model"]', true);
release.tags = qu.all('.vdoTags a', true);
release.stars = Number(q('div[class*="like"]', true).match(/^\d+/)[0]) / 20;
release.stars = Number(qu.q('div[class*="like"]', true).match(/^\d+/)[0]) / 20;
const poster = qi('img#player-overlay-image');
const poster = qu.img('img#player-overlay-image');
release.poster = [
poster,
poster.replace('/big_trailer', '/members/450x340'), // load error fallback
];
release.trailer = { src: qt() };
release.trailer = { src: qu.trailer() };
// all scenes seem to have 12 album photos available, not always included on the page
const firstPhotoUrl = ex(html).qi('img[data-slider-index="1"]');
const firstPhotoUrl = ex(html).qu.img('img[data-slider-index="1"]');
release.photos = Array.from({ length: 12 }, (val, index) => firstPhotoUrl.replace(/big\d+/, `big${index + 1}`));
const [channel] = qu('a[href*="/websites"]').match(/\w+$/);
const [channel] = qu.url('a[href*="/websites"]').match(/\w+$/);
release.channel = channel === 'bangcasting' ? 'bangbroscasting' : channel;
return release;