Skip to content

Commit

Permalink
Fix javbus and jav321 scrapers
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Sep 7, 2020
1 parent 73317bd commit 03bc562
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
27 changes: 14 additions & 13 deletions src/Javinizer/Public/Get-JVData.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function Get-JVData {
Import-Module $using:jvModulePath
if ($using:R18Url) {
$using:R18Url | Get-R18Data
} else {
} elseif ($using:jvR18Url) {
$jvR18Url = $using:jvR18Url
if ($jvR18Url) {
$jvR18Url.En | Get-R18Data
Expand All @@ -120,7 +120,7 @@ function Get-JVData {
Import-Module $using:jvModulePath
if ($using:R18ZhUrl) {
$using:R18ZhUrl | Get-R18Data
} else {
} elseif ($using:jvR18Url) {
$jvR18Url = $using:jvR18Url
if ($jvR18Url) {
$jvR18Url.Zh | Get-R18Data
Expand All @@ -138,7 +138,7 @@ function Get-JVData {
Import-Module $using:jvModulePath
if ($using:JavlibraryUrl) {
$using:JavlibraryUrl | Get-JavlibraryData
} else {
} elseif ($using:jvJavlibraryUrl) {
$jvJavlibraryUrl = $using:jvJavlibraryUrl
if ($jvJavlibraryUrl) {
$jvJavlibraryUrl.En | Get-JavlibraryData
Expand All @@ -153,7 +153,7 @@ function Get-JVData {
Import-Module $using:jvModulePath
if ($using:JavlibraryJaUrl) {
$using:JavlibraryJaUrl | Get-JavlibraryData
} else {
} elseif ($using:jvJavlibraryUrl) {
$jvJavlibraryUrl = $using:jvJavlibraryUrl
if ($jvJavlibraryUrl) {
$jvJavlibraryUrl.Ja | Get-JavlibraryData
Expand All @@ -168,7 +168,7 @@ function Get-JVData {
Import-Module $using:jvModulePath
if ($using:JavlibraryZhUrl) {
$using:JavlibraryZhUrl | Get-JavlibraryData
} else {
} elseif ($using:jvJavlibraryUrl) {
$jvJavlibraryUrl = $using:jvJavlibraryUrl
if ($jvJavlibraryUrl) {
$jvJavlibraryUrl.Zh | Get-JavlibraryData
Expand All @@ -185,20 +185,20 @@ function Get-JVData {
Import-Module $using:jvModulePath
if ($using:DmmUrl) {
$using:DmmUrl | Get-DmmData
} else {
} elseif ($using:jvDmmUrl) {
$using:jvDmmUrl | Get-DmmData
}
} | Out-Null
}

if ($Javbus) {
if ($Javbus -or $JavbusJa -or $JavbusZh) {
$jvJavbusUrl = Get-JavbusUrl -Id $Id
Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] [Search - Javbus] [Url - $JavbusUrl]"
Start-ThreadJob -Name "jvdata-Javbus" -ThrottleLimit 100 -ScriptBlock {
Import-Module $using:jvModulePath
if ($using:JavbusUrl) {
$using:JavbusUrl | Get-JavbusData
} else {
} elseif ($using:jvJavbusUrl) {
$jvJavbusUrl = $using:jvJavbusUrl
if ($jvJavbusUrl) {
$jvJavbusUrl.En | Get-JavbusData
Expand All @@ -212,7 +212,7 @@ function Get-JVData {
Import-Module $using:jvModulePath
if ($using:JavbusJaUrl) {
$using:JavbusJaUrl | Get-JavbusData
} else {
} elseif ($using:jvJavbusUrl) {
$jvJavbusUrl = $using:jvJavbusUrl
if ($jvJavbusUrl) {
$jvJavbusUrl.Ja | Get-JavbusData
Expand All @@ -227,7 +227,7 @@ function Get-JVData {
Import-Module $using:jvModulePath
if ($using:JavbusZhUrl) {
$using:JavbusZhUrl | Get-JavbusData
} else {
} elseif ($using:jvJavbusUrl) {
$jvJavbusUrl = $using:jvJavbusUrl
if ($jvJavbusUrl) {
$jvJavbusUrl.Zh | Get-JavbusData
Expand All @@ -238,14 +238,15 @@ function Get-JVData {
}

if ($Jav321) {
$jvJav321Url = Get-Jav321Url -Id $using:Id
$jvJav321Url = Get-Jav321Url -Id $Id
Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] [Search - Jav321] [$Url - $Jav321Url]"
Start-ThreadJob -Name "jvdata-Jav321" -ThrottleLimit 100 -ScriptBlock {
Import-Module $using:jvModulePath
if ($using:Jav321Url) {
$using:Jav321Url | Get-Jav321Data
} else {
$using:jvJav321Url | Get-Jav321Data
} elseif ($using:jvJav321Url) {
$jvJav321Url = $using:jvJav321Url
$jvJav321Url.Ja | Get-Jav321Data
}
} | Out-Null
}
Expand Down
3 changes: 1 addition & 2 deletions src/Javinizer/Public/Get-Jav321Url.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ function Get-Jav321Url {
return
} else {
$urlObject = [PSCustomObject]@{
Url = $directUrl
Language = 'ja'
Ja = $directUrl
}
Write-Output $urlObject
}
Expand Down
2 changes: 1 addition & 1 deletion src/Javinizer/Public/Get-JavbusData.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function Get-JavbusData {
}

$movieDataObject = [PSCustomObject]@{
Source = if ($Url -match '/ja') { 'javbusja' } elseif ($Url -match '/zh') { 'javbuszh' } else { 'javbuszh' }
Source = if ($Url -match '/ja') { 'javbusja' } elseif ($Url -match '/zh') { 'javbuszh' } else { 'javbus' }
Url = $Url
Id = Get-JavbusId -WebRequest $webRequest
Title = Get-JavbusTitle -WebRequest $webRequest
Expand Down
4 changes: 2 additions & 2 deletions src/Javinizer/Public/Get-JavbusUrl.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function Get-JavbusUrl {
$resultId = Get-JavbusId -WebRequest $webRequest
if ($resultId -eq $Id) {
$directUrlZh = "https://" + ($result -split '/')[-2] + "/" + ($result -split '/')[-1]
$directUrlJa = "https://" + ($result -split '/')[-2] + "/$ja/" + ($result -split '/')[-1]
$directUrl = "https://" + ($result -split '/')[-2] + "/$en/" + ($result -split '/')[-1]
$directUrlJa = "https://" + ($result -split '/')[-2] + "/ja/" + ($result -split '/')[-1]
$directUrl = "https://" + ($result -split '/')[-2] + "/en/" + ($result -split '/')[-1]
break
}

Expand Down

0 comments on commit 03bc562

Please sign in to comment.