Skip to content

Commit

Permalink
Add thumburl scraper to javbus (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Jun 14, 2020
1 parent 07ecace commit 0d6a368
Showing 1 changed file with 30 additions and 18 deletions.
48 changes: 30 additions & 18 deletions src/Javinizer/Private/Get-JavbusDataObject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,25 @@ function Get-JavbusDataObject {
if ($null -ne $javbusUrl) {
try {
Write-Debug "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Performing [GET] on Uri [$javbusUrl]"
$webRequest = Invoke-RestMethod -Uri $javbusUrl
$webRequest = Invoke-RestMethod -Uri $javbusUrl -Verbose:$false
$movieDataObject = [pscustomobject]@{
Source = 'javbus'
Url = $javbusUrl
Id = Get-JavbusId -WebRequest $webRequest
Title = Get-JavbusTitle -WebRequest $webRequest
Date = Get-JavbusReleaseDate -WebRequest $webRequest
Year = Get-JavbusReleaseYear -WebRequest $webRequest
Runtime = Get-JavbusRuntime -WebRequest $webRequest
Director = Get-JavbusDirector -WebRequest $webRequest
Maker = Get-JavbusMaker -WebRequest $webRequest
Label = Get-JavbusLabel -WebRequest $webRequest
Series = Get-JavbusSeries -WebRequest $webRequest
Rating = Get-JavbusRating -WebRequest $webRequest
Actress = Get-JavbusActress -WebRequest $webRequest
Genre = Get-JavbusGenre -WebRequest $webRequest
CoverUrl = Get-JavbusCoverUrl -WebRequest $webRequest
ScreenshotUrl = Get-JavbusScreenshotUrl -WebRequest $webRequest
Source = 'javbus'
Url = $javbusUrl
Id = Get-JavbusId -WebRequest $webRequest
Title = Get-JavbusTitle -WebRequest $webRequest
Date = Get-JavbusReleaseDate -WebRequest $webRequest
Year = Get-JavbusReleaseYear -WebRequest $webRequest
Runtime = Get-JavbusRuntime -WebRequest $webRequest
Director = Get-JavbusDirector -WebRequest $webRequest
Maker = Get-JavbusMaker -WebRequest $webRequest
Label = Get-JavbusLabel -WebRequest $webRequest
Series = Get-JavbusSeries -WebRequest $webRequest
Rating = Get-JavbusRating -WebRequest $webRequest
Actress = (Get-JavbusActress -WebRequest $webRequest).Name
ActressThumbUrl = (Get-JavbusActress -WebRequest $webRequest).ThumbUrl
Genre = Get-JavbusGenre -WebRequest $webRequest
CoverUrl = Get-JavbusCoverUrl -WebRequest $webRequest
ScreenshotUrl = Get-JavbusScreenshotUrl -WebRequest $webRequest
}
} catch {
throw $_
Expand Down Expand Up @@ -272,11 +273,22 @@ function Get-JavbusActress {
ForEach-Object { $_.Groups[3].Value } |
Where-Object { $_ -ne '' } |
Select-Object -Unique

$actressThumb = ($WebRequest | ForEach-Object { $_ -split '\n' } |
Select-String '<a href="(.*)\/star\/(.*)"><img src="(.*)" title="(.*)"><\/a>').Matches |
ForEach-Object { $_.Groups[3].Value} |
Where-Object { $_ -ne ''}


$movieActressObject = [pscustomobject]@{
Name = $actress
ThumbUrl = $actressThumb
}
} catch {
return
}

Write-Output $actress
Write-Output $movieActressObject
}
}

Expand Down

0 comments on commit 0d6a368

Please sign in to comment.