-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Projectjav #21525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Projectjav #21525
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { Route } from '@/types'; | ||
Check failureCode scanning / oxlint simple-import-sort(imports) Error
Run autofix to sort these imports!
|
||
| import cache from '@/utils/cache'; | ||
| import { rootUrl, processItems } from './utils'; | ||
|
|
||
| export const route: Route = { | ||
| path: ['/actress/:id', '/actress/:id/'], | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use only one route path |
||
| categories: ['multimedia'], | ||
| example: '/projectjav/actress/rima-arai-22198', | ||
| parameters: { id: 'Actress ID or slug, can be found in the actress page URL' }, | ||
| features: { | ||
| requireConfig: false, | ||
| requirePuppeteer: false, | ||
| antiCrawler: false, | ||
| supportBT: false, | ||
| supportPodcast: false, | ||
| supportScihub: false, | ||
| nsfw: true, | ||
| }, | ||
| radar: [ | ||
| { | ||
| source: ['projectjav.com/actress/:id'], | ||
| target: '/actress/:id', | ||
| }, | ||
| ], | ||
| name: 'Actress', | ||
| maintainers: ['Exat1979'], | ||
| handler, | ||
| url: 'projectjav.com/', | ||
| description: 'Fetches the latest movies from a specific actress page on ProjectJAV.', | ||
| }; | ||
|
|
||
| async function handler(ctx) { | ||
| const id = ctx.req.param('id'); | ||
| const currentUrl = `${rootUrl}/actress/${id}`; | ||
| return await processItems(currentUrl, cache.tryGet); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The whole |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import type { Namespace } from '@/types'; | ||
|
|
||
| export const namespace: Namespace = { | ||
| name: 'ProjectJAV', | ||
| url: 'projectjav.com', | ||
| description: 'ProjectJAV provides adult video content information and streaming.', | ||
| lang: 'en', | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| import got from '@/utils/got'; | ||
Check failureCode scanning / oxlint simple-import-sort(imports) Error
Run autofix to sort these imports!
|
||
| import { load } from 'cheerio'; | ||
| import { parseDate } from '@/utils/parse-date'; | ||
| import type { DataItem } from '@/types'; | ||
|
|
||
| const rootUrl = 'https://projectjav.com'; | ||
| const processItems = async (currentUrl: string, tryGet) => { | ||
| const response = await got({ | ||
| method: 'get', | ||
| url: currentUrl, | ||
| }); | ||
|
|
||
| const $ = load(response.data); | ||
|
|
||
| let items: DataItem[] = $('div.video-item') | ||
| .toArray() | ||
| .map((element) => { | ||
| const item = $(element); | ||
| const link = item.find('a').attr('href'); | ||
| return { | ||
| title: item.find('div.name span').text() || '', | ||
| link: link?.startsWith('http') ? link : `${rootUrl}${link}`, | ||
| }; | ||
| }) | ||
| .filter((item) => item.link && /\/movie\/.*/.test(item.link)); | ||
|
|
||
| items = await Promise.all( | ||
| items.map((item) => | ||
| tryGet(item.link!, async () => { | ||
| const detailResponse = await got({ | ||
| method: 'get', | ||
| url: item.link, | ||
| }); | ||
|
|
||
| const content = load(detailResponse.data); | ||
|
|
||
| // Remove ads | ||
| content('div.top-banner-ads, div.bottom-content-ads').remove(); | ||
|
|
||
| // Get main content | ||
| const mainContent = content('main'); | ||
|
|
||
| // Extract title | ||
| const h1Title = mainContent.find('h1').text().trim(); | ||
| if (h1Title) { | ||
| item.title = h1Title; | ||
| } | ||
|
|
||
| // Extract categories | ||
| const categories = mainContent | ||
| .find('div.badge a') | ||
| .toArray() | ||
| .map((v) => content(v).text().trim()) | ||
| .filter(Boolean); | ||
| if (categories.length > 0) { | ||
| item.category = categories; | ||
| } | ||
|
|
||
| // Extract author/actress (support multiple actresses) | ||
| const actresses = mainContent | ||
| .find('div.actress-item a') | ||
| .toArray() | ||
| .map((v) => content(v).text().trim()) | ||
| .filter(Boolean); | ||
| if (actresses.length > 0) { | ||
| item.author = actresses.join(', '); | ||
| } | ||
|
|
||
| // Extract date | ||
| let dateText: string | null = null; | ||
| mainContent | ||
| .find('div.second-main~div.row>div.col-3') | ||
| .toArray() | ||
| .some((el) => { | ||
| if (content(el).text().includes('Date added')) { | ||
| dateText = content(el).next().text().trim(); | ||
| return true; | ||
| } | ||
| return false; | ||
| }); | ||
| if (dateText) { | ||
| // ProjectJAV uses DD/MM/YYYY format | ||
| item.pubDate = parseDate(dateText, 'DD/MM/YYYY'); | ||
| } | ||
|
|
||
| // Get description | ||
| item.description = mainContent.html() || ''; | ||
|
|
||
| return item; | ||
| }) | ||
| ) | ||
| ); | ||
|
|
||
| return { | ||
| title: $('title').text() || 'ProjectJAV', | ||
| link: currentUrl, | ||
| item: items, | ||
| }; | ||
| }; | ||
|
|
||
| export { processItems, rootUrl }; | ||
Check failure
Code scanning / oxlint
typescript-eslint(consistent-type-imports) Error