Skip to content

Commit

Permalink
feat: add url to video page response to align with video search
Browse files Browse the repository at this point in the history
  • Loading branch information
pionxzh committed Jul 20, 2023
1 parent 6f888b9 commit d6d585f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/Page.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ console.log(video)

```json5
{
"id": "phxxxxx",
"url": "https://www.pornhub.com/view_video.php?viewkey=phxxxxx",
"title": "Susie sheep fucks peppa pig",
"views": 49517,
"voteUp": 352,
Expand Down
2 changes: 2 additions & 0 deletions src/scrapers/pages/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { CheerioAPI } from 'cheerio'

export interface VideoPage {
id: string
url: string
title: string
views: number
vote: {
Expand Down Expand Up @@ -49,6 +50,7 @@ export async function videoPage(engine: Engine, urlOrId: string): Promise<VideoP

return {
id,
url,
...parseByDom(html, $),
}
}
Expand Down

0 comments on commit d6d585f

Please sign in to comment.