Skip to content

Commit

Permalink
Fix actress on R18Zh (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Jul 28, 2021
1 parent d8ddcc1 commit 449a785
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
22 changes: 17 additions & 5 deletions src/Javinizer/Private/Scraper.R18.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ function Get-R18Actress {
[Parameter(Position = 1, ValueFromPipeline = $true)]
[Object]$AltWebrequest,

[Parameter()]
[Switch]$Zh,

[Parameter()]
[String]$Url
)
Expand All @@ -248,11 +251,20 @@ function Get-R18Actress {

if ($Webrequest.data.actresses) {
for ($x = 0; $x -lt $Webrequest.data.actresses.count; $x++) {
$movieActressObject += [PSCustomObject]@{
LastName = ($Webrequest.data.actresses[$x].name -split ' ')[1] -replace '\\', ''
FirstName = ($Webrequest.data.actresses[$x].name -split ' ')[0] -replace '\\', ''
JapaneseName = $ALtWebrequest.data.actresses[$x].name -replace '(.*)', '' -replace '&', '&'
ThumbUrl = $Webrequest.data.actresses[$x].image_url
if ($Zh) {
$movieActressObject += [PSCustomObject]@{
LastName = ($AltWebrequest.data.actresses[$x].name -split ' ')[1] -replace '\\', ''
FirstName = ($AltWebrequest.data.actresses[$x].name -split ' ')[0] -replace '\\', ''
JapaneseName = $Webrequest.data.actresses[$x].name -replace '(.*)', '' -replace '&', '&'
ThumbUrl = $Webrequest.data.actresses[$x].image_url
}
} else {
$movieActressObject += [PSCustomObject]@{
LastName = ($Webrequest.data.actresses[$x].name -split ' ')[1] -replace '\\', ''
FirstName = ($Webrequest.data.actresses[$x].name -split ' ')[0] -replace '\\', ''
JapaneseName = $AltWebrequest.data.actresses[$x].name -replace '(.*)', '' -replace '&', '&'
ThumbUrl = $Webrequest.data.actresses[$x].image_url
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/Javinizer/Public/Get-R18Data.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function Get-R18Data {
}

if ($Url -match 'lg=zh') {
$Zh = $true
try {
Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$zhApiUrl]"
$webRequest = (Invoke-WebRequest -Uri $zhApiUrl -Method Get -Verbose:$false).Content | ConvertFrom-Json
Expand Down Expand Up @@ -58,7 +59,7 @@ function Get-R18Data {
Maker = Get-R18Maker -WebRequest $webRequest
Label = Get-R18Label -WebRequest $webRequest -Replace $replaceHashTable
Series = Get-R18Series -WebRequest $webRequest -Replace $replaceHashTable
Actress = Get-R18Actress -WebRequest $webRequest -Url $Url -AltWebrequest $altWebRequest
Actress = Get-R18Actress -WebRequest $webRequest -Url $Url -AltWebrequest $altWebRequest -Zh:$Zh
Genre = Get-R18Genre -WebRequest $webRequest -Replace $replaceHashTable
CoverUrl = Get-R18CoverUrl -WebRequest $webRequest
ScreenshotUrl = Get-R18ScreenshotUrl -WebRequest $webRequest
Expand Down

0 comments on commit 449a785

Please sign in to comment.