diff --git a/src/Javinizer/Private/Convert-HTMLCharacter.ps1 b/src/Javinizer/Private/Convert-HTMLCharacter.ps1 index 93533f9e..293c098b 100644 --- a/src/Javinizer/Private/Convert-HTMLCharacter.ps1 +++ b/src/Javinizer/Private/Convert-HTMLCharacter.ps1 @@ -19,7 +19,7 @@ function Convert-HTMLCharacter { -replace ''', '' $newString = $String.Trim() - # Write-JLog -Level Debug -Message "Begin String: [$String]; End string: [$newString]" + # Write-JVLog -Level Debug -Message "Begin String: [$String]; End string: [$newString]" Write-Output $newString } } diff --git a/src/Javinizer/Private/Convert-JVTitle.ps1 b/src/Javinizer/Private/Convert-JVTitle.ps1 index 61252a7a..295515d3 100644 --- a/src/Javinizer/Private/Convert-JVTitle.ps1 +++ b/src/Javinizer/Private/Convert-JVTitle.ps1 @@ -86,7 +86,7 @@ function Convert-JVTitle { $id = ($file | Select-String $RegexString).Matches.Groups[$RegexIdMatch].Value $partNum = ($file | Select-String $RegexString).Matches.Groups[$RegexPtMatch].Value } catch { - Write-JLog -Level Debug -Message "File [$file] not matched by regex" + Write-JVLog -Level Debug -Message "File [$file] not matched by regex" break } if ($fileBaseNameUpper -eq 1) { @@ -198,7 +198,7 @@ function Convert-JVTitle { <# #Match ID-###-A, ID-###-B, etc. elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}[-][a-iA-I]$") { - Write-JLog -Level Debug -Message "Match 3" + Write-JVLog -Level Debug -Message "Match 3" $fileP1, $fileP2, $fileP3, $fileP4 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6})[-]([a-zA-Z])" $fileBaseNameUpperCleaned += $fileP1 + $fileP2 + $fileP3 } diff --git a/src/Javinizer/Private/Get-JVUrlLocation.ps1 b/src/Javinizer/Private/Get-JVUrlLocation.ps1 index 863d343a..7e848640 100644 --- a/src/Javinizer/Private/Get-JVUrlLocation.ps1 +++ b/src/Javinizer/Private/Get-JVUrlLocation.ps1 @@ -70,7 +70,7 @@ function Get-JVUrlLocation { Source = 'jav321' } } else { - Write-JLog -Level Warning -Message "[$($MyInvocation.MyCommand.Name)] [Url - $Url] not matched" + Write-JVLog -Level Warning -Message "[$($MyInvocation.MyCommand.Name)] [Url - $Url] not matched" } } Write-Output $testUrlObject diff --git a/src/Javinizer/Private/Write-JLog.ps1 b/src/Javinizer/Private/Write-JVLog.ps1 similarity index 94% rename from src/Javinizer/Private/Write-JLog.ps1 rename to src/Javinizer/Private/Write-JVLog.ps1 index 8a1273f6..7cd1cf92 100644 --- a/src/Javinizer/Private/Write-JLog.ps1 +++ b/src/Javinizer/Private/Write-JVLog.ps1 @@ -1,4 +1,4 @@ -function Write-JLog { +function Write-JVLog { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] diff --git a/src/Javinizer/Public/Get-DmmData.ps1 b/src/Javinizer/Public/Get-DmmData.ps1 index f37ee5a0..85f1f63e 100644 --- a/src/Javinizer/Public/Get-DmmData.ps1 +++ b/src/Javinizer/Public/Get-DmmData.ps1 @@ -10,10 +10,10 @@ function Get-DmmData { $dmmUrl = $Url try { - Write-JLog -Level Debug -Message "Performing [GET] on URL [$dmmUrl]" + Write-JVLog -Level Debug -Message "Performing [GET] on URL [$dmmUrl]" $webRequest = Invoke-WebRequest -Uri $dmmUrl -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "Error [GET] on URL [$dmmUrl]: $PSItem" + Write-JVLog -Level Error -Message "Error [GET] on URL [$dmmUrl]: $PSItem" } $movieDataObject = [PSCustomObject]@{ @@ -38,7 +38,7 @@ function Get-DmmData { #TrailerUrl = Get-DmmTrailerUrl -WebRequest $webRequest } - Write-JLog -Level Debug -Message "DMM data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Level Debug -Message "DMM data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } diff --git a/src/Javinizer/Public/Get-DmmUrl.ps1 b/src/Javinizer/Public/Get-DmmUrl.ps1 index f33ecb0b..c6afbb90 100644 --- a/src/Javinizer/Public/Get-DmmUrl.ps1 +++ b/src/Javinizer/Public/Get-DmmUrl.ps1 @@ -12,7 +12,7 @@ function Get-DmmUrl { if ($r18Url) { $r18Id = (($r18Url -split 'id=')[1] -split '\/')[0] $directUrl = "https://www.dmm.co.jp/digital/videoa/-/detail/=/cid=$r18Id" - Write-JLog -Level Debug -Message "Converting R18 Id to Dmm: [$r18Id] -> [$directUrl]" + Write-JVLog -Level Debug -Message "Converting R18 Id to Dmm: [$r18Id] -> [$directUrl]" } else { # Convert the movie Id (ID-###) to content Id (ID00###) to match dmm naming standards if ($Id -match '([a-zA-Z|tT28|rR18]+-\d+z{0,1}Z{0,1}e{0,1}E{0,1})') { @@ -23,10 +23,10 @@ function Get-DmmUrl { $searchUrl = "https://www.dmm.co.jp/search/?redirect=1&enc=UTF-8&category=&searchstr=$Id" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$searchUrl]" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$searchUrl]" } $retryCount = 3 @@ -38,19 +38,19 @@ function Get-DmmUrl { } if ($numResults -ge 1) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$retryCount] of [$numResults] results for [$Id]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$retryCount] of [$numResults] results for [$Id]" $count = 1 foreach ($result in $searchResults) { try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-WebRequest -Uri $result -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" } $resultId = Get-DmmContentId -WebRequest $webRequest - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" if ($resultId -match $Id) { $directUrl = $result break @@ -66,7 +66,7 @@ function Get-DmmUrl { } if ($null -eq $directUrl) { - Write-JLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on DMM" + Write-JVLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on DMM" return } else { $urlObject = [PSCustomObject]@{ diff --git a/src/Javinizer/Public/Get-JVAggregatedData.ps1 b/src/Javinizer/Public/Get-JVAggregatedData.ps1 index a04915f5..6fb53ced 100644 --- a/src/Javinizer/Public/Get-JVAggregatedData.ps1 +++ b/src/Javinizer/Public/Get-JVAggregatedData.ps1 @@ -177,7 +177,7 @@ function Get-JVAggregatedData { } else { $aggregatedDataObject.$field = $sourceData.$field } - Write-JLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [$field - $priority] Set to [$($sourceData.$field | ConvertTo-Json -Compress)]" + Write-JVLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [$field - $priority] Set to [$($sourceData.$field | ConvertTo-Json -Compress)]" } } } @@ -219,7 +219,7 @@ function Get-JVAggregatedData { $aggregatedDataObject.Actress[$x].LastName = $actressCsv[$matched[0].Index].LastName } - Write-JLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [Alias - $aliasString] replaced by [$actressString]" + Write-JVLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [Alias - $aliasString] replaced by [$actressString]" } } @@ -236,7 +236,7 @@ function Get-JVAggregatedData { $aggregatedDataObject.Actress[$x].ThumbUrl = $matchedActress.ThumbUrl $aggregatedDataObject.Actress[$x].JapaneseName = $matchedActress.JapaneseName $actressString = "$($aggregatedDataObject.Actress[$x].LastName) $($aggregatedDataObject.Actress[$x].FirstName)".Trim() - Write-JLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" + Write-JVLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" } # Check if JapaneseName matches the thumb csv } elseif ($matched = Compare-Object -ReferenceObject $actressCsv -DifferenceObject $aggregatedDataObject.Actress[$x] -IncludeEqual -ExcludeDifferent -PassThru -Property @('JapaneseName')) { @@ -252,7 +252,7 @@ function Get-JVAggregatedData { $aggregatedDataObject.Actress[$x].LastName = $matchedActress.LastName $aggregatedDataObject.Actress[$x].ThumbUrl = $matchedActress.ThumbUrl $actressString = "$($aggregatedDataObject.Actress[$x].JapaneseName)".Trim() - Write-JLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" + Write-JVLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" } # Check if FirstName matches the thumb csv for single-word names } elseif ($null -eq $aggregatedDataObject.Actress[$x].LastName -and $null -ne $aggregatedDataObject.Actress[$x].FirstName) { @@ -269,12 +269,12 @@ function Get-JVAggregatedData { $aggregatedDataObject.Actress[$x].ThumbUrl = $matchedActress.ThumbUrl $aggregatedDataObject.Actress[$x].JapaneseName = $matchedActress.JapaneseName $actressString = "$($aggregatedDataObject.Actress[$x].FirstName)".Trim() - Write-JLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" + Write-JVLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" } } } } else { - Write-JLog -Level Warning -Message "[$($Data[0].Id)] Thumbnail csv file is missing or cannot be found at path [$thumbCsvPath]" + Write-JVLog -Level Warning -Message "[$($Data[0].Id)] Thumbnail csv file is missing or cannot be found at path [$thumbCsvPath]" } } @@ -292,7 +292,7 @@ function Get-JVAggregatedData { $aggregatedDataObject.Description = $translatedDescription } } else { - Write-JLog -Level Warning -Message "[$($Data[0].Id)] Translation language is missing" + Write-JVLog -Level Warning -Message "[$($Data[0].Id)] Translation language is missing" } } diff --git a/src/Javinizer/Public/Get-JVData.ps1 b/src/Javinizer/Public/Get-JVData.ps1 index ef1e554c..7a800175 100644 --- a/src/Javinizer/Public/Get-JVData.ps1 +++ b/src/Javinizer/Public/Get-JVData.ps1 @@ -70,7 +70,7 @@ function Get-JVData { $jvModulePath = Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'Javinizer.psm1' if ($R18) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching R18" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching R18" Start-ThreadJob -Name "$Id-R18" -ScriptBlock { Import-Module $using:jvModulePath Get-R18Url -Id $using:Id -Language en | Get-R18Data @@ -78,7 +78,7 @@ function Get-JVData { } if ($R18Zh) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching R18Zh" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching R18Zh" Start-ThreadJob -Name "$Id-R18Zh" -ScriptBlock { Import-Module $using:jvModulePath Get-R18Url -Id $using:Id -Language zh | Get-R18Data @@ -86,7 +86,7 @@ function Get-JVData { } if ($Javlibrary) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Javlibrary" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Javlibrary" Start-ThreadJob -Name "$Id-Javlibrary" -ScriptBlock { Import-Module $using:jvModulePath Get-JavlibraryUrl -Id $using:Id -Language en | Get-JavlibraryData @@ -94,7 +94,7 @@ function Get-JVData { } if ($JavlibraryJa) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavlibraryJa" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavlibraryJa" Start-ThreadJob -Name "$Id-JavlibraryJa" -ScriptBlock { Import-Module $using:jvModulePath Get-JavlibraryUrl -Id $using:Id -Language ja | Get-JavlibraryData @@ -102,7 +102,7 @@ function Get-JVData { } if ($JavlibraryZh) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavlibraryZh" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavlibraryZh" Start-ThreadJob -Name "$Id-JavlibraryZh" -ScriptBlock { Import-Module $using:jvModulePath Get-JavlibraryUrl -Id $using:Id -Language zh | Get-JavlibraryData @@ -110,7 +110,7 @@ function Get-JVData { } if ($Dmm) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Dmm" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Dmm" Start-ThreadJob -Name "$Id-Dmm" -ScriptBlock { Import-Module $using:jvModulePath Get-DmmUrl -Id $using:Id | Get-DmmData @@ -118,7 +118,7 @@ function Get-JVData { } if ($Javbus) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Javbus" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Javbus" Start-ThreadJob -Name "$Id-Javbus" -ScriptBlock { Import-Module $using:jvModulePath Get-JavbusUrl -Id $using:Id -Language en | Get-JavbusData @@ -126,7 +126,7 @@ function Get-JVData { } if ($JavbusJa) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavbusJa" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavbusJa" Start-ThreadJob -Name "$Id-JavbusJa" -ScriptBlock { Import-Module $using:jvModulePath Get-JavbusUrl -Id $using:Id -Language ja | Get-JavbusData @@ -134,7 +134,7 @@ function Get-JVData { } if ($JavbusZh) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavbusZh" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavbusZh" Start-ThreadJob -Name "$Id-JavbusZh" -ScriptBlock { Import-Module $using:jvModulePath Get-JavbusUrl -Id $using:Id -Language zh | Get-JavbusData @@ -142,7 +142,7 @@ function Get-JVData { } if ($Jav321) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Jav321" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Jav321" Start-ThreadJob -Name "$Id-Jav321" -ScriptBlock { Import-Module $using:jvModulePath Get-Jav321Url -Id $using:Id | Get-Jav321Data @@ -158,7 +158,7 @@ function Get-JVData { $javinizerDataObject = Get-Job -Id $jobId | Receive-Job $hasData = ($javinizerDataObject | Select-Object Source).Source - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Data successfully retrieved from sources [$hasData]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Data successfully retrieved from sources [$hasData]" $dataObject = [PSCustomObject]@{ Data = $javinizerDataObject @@ -167,11 +167,11 @@ function Get-JVData { Write-Output $dataObject } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured during scraper jobs: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured during scraper jobs: $PSItem" } finally { # Remove all completed or running jobs before exiting this script # If jobs remain after closure, it may cause issues in concurrent runs - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Stopping/removing all completed/running jobs" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Stopping/removing all completed/running jobs" Get-Job | Remove-Job -Force } } diff --git a/src/Javinizer/Public/Get-Jav321Data.ps1 b/src/Javinizer/Public/Get-Jav321Data.ps1 index 8fd0ccd3..891e99c3 100644 --- a/src/Javinizer/Public/Get-Jav321Data.ps1 +++ b/src/Javinizer/Public/Get-Jav321Data.ps1 @@ -9,10 +9,10 @@ function Get-Jav321Data { $movieDataObject = @() try { - Write-JLog -Level Debug -Message "Performing [GET] on URL [$Url]" + Write-JVLog -Level Debug -Message "Performing [GET] on URL [$Url]" $webRequest = Invoke-RestMethod -Uri $Url -Verbose:$false } catch { - Write-JLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" } $movieDataObject = [PSCustomObject]@{ @@ -31,7 +31,7 @@ function Get-Jav321Data { ScreenshotUrl = Get-Jav321ScreenshotUrl -WebRequest $webRequest } - Write-JLog -Level Debug -Message "Jav321 data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Level Debug -Message "Jav321 data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } diff --git a/src/Javinizer/Public/Get-Jav321Url.ps1 b/src/Javinizer/Public/Get-Jav321Url.ps1 index 448b8fbd..7b7288a0 100644 --- a/src/Javinizer/Public/Get-Jav321Url.ps1 +++ b/src/Javinizer/Public/Get-Jav321Url.ps1 @@ -9,10 +9,10 @@ function Get-Jav321Url { $searchUrl = "https://jp.jav321.com/search" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Post -Body "sn=$Id" -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" } @@ -30,16 +30,16 @@ function Get-Jav321Url { } if ($numResults -ge 1) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$Tries] of [$numResults] results for [$Id]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$Tries] of [$numResults] results for [$Id]" $count = 1 foreach ($result in $searchResults) { $result = "https://jp.jav321.com/video/$result" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-RestMethod -Uri $result -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" } $resultId = Get-Jav321Id -WebRequest $webRequest @@ -48,7 +48,7 @@ function Get-Jav321Url { break } - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" if ($count -eq $Tries) { break } @@ -57,7 +57,7 @@ function Get-Jav321Url { } if ($null -eq $directUrl) { - Write-JLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on Jav321" + Write-JVLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on Jav321" return } else { $urlObject = [PSCustomObject]@{ @@ -67,7 +67,7 @@ function Get-Jav321Url { Write-Output $urlObject } } else { - Write-JLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on Jav321" + Write-JVLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on Jav321" return } } diff --git a/src/Javinizer/Public/Get-JavbusData.ps1 b/src/Javinizer/Public/Get-JavbusData.ps1 index ac27413f..f424d9f6 100644 --- a/src/Javinizer/Public/Get-JavbusData.ps1 +++ b/src/Javinizer/Public/Get-JavbusData.ps1 @@ -9,10 +9,10 @@ function Get-JavbusData { $movieDataObject = @() try { - Write-JLog -Level Debug -Message "Performing [GET] on URL [$Url]" + Write-JVLog -Level Debug -Message "Performing [GET] on URL [$Url]" $webRequest = Invoke-RestMethod -Uri $Url -Verbose:$false } catch { - Write-JLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" } $movieDataObject = [PSCustomObject]@{ @@ -34,7 +34,7 @@ function Get-JavbusData { ScreenshotUrl = Get-JavbusScreenshotUrl -WebRequest $webRequest } - Write-JLog -Level Debug -Message "JavBus data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Level Debug -Message "JavBus data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } diff --git a/src/Javinizer/Public/Get-JavbusUrl.ps1 b/src/Javinizer/Public/Get-JavbusUrl.ps1 index eee36c99..3b52df1d 100644 --- a/src/Javinizer/Public/Get-JavbusUrl.ps1 +++ b/src/Javinizer/Public/Get-JavbusUrl.ps1 @@ -13,20 +13,20 @@ function Get-JavbusUrl { $searchUrl = "https://www.javbus.com/search/$Id&type=0&parent=uc" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-RestMethod -Uri $searchUrl -Method Get -Verbose:$false } catch { try { $searchUrl = "https://www.javbus.com/uncensored/search/$Id&type=0&parent=uc" - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-RestMethod -Uri $searchUrl -Method Get -Verbose:$false } catch { try { $searchUrl = "https://www.javbus.org/search/$Id&type=0&parent=uc" - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-RestMethod -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JLog -Level Warning -Message "[$Id] not matched on JavBus" + Write-JVLog -Level Warning -Message "[$Id] not matched on JavBus" return } } @@ -46,15 +46,15 @@ function Get-JavbusUrl { } if ($numResults -ge 1) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$Tries] of [$numResults] results for [$Id]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$Tries] of [$numResults] results for [$Id]" $count = 1 foreach ($result in $searchResults) { try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-RestMethod -Uri $result -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" } $resultId = Get-JavbusId -WebRequest $webRequest if ($resultId -eq $Id) { @@ -66,7 +66,7 @@ function Get-JavbusUrl { break } - Write-JLog -Level Debug -Message "Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "Result [$count] is [$resultId]" if ($count -eq $Tries) { break @@ -76,7 +76,7 @@ function Get-JavbusUrl { } if ($null -eq $directUrl) { - Write-JLog -Level Warning -Message "[$Id] not matched on JavBus" + Write-JVLog -Level Warning -Message "[$Id] not matched on JavBus" return } else { $urlObject = [PSCustomObject]@{ diff --git a/src/Javinizer/Public/Get-JavlibraryData.ps1 b/src/Javinizer/Public/Get-JavlibraryData.ps1 index 51eb3101..ede4f09b 100644 --- a/src/Javinizer/Public/Get-JavlibraryData.ps1 +++ b/src/Javinizer/Public/Get-JavlibraryData.ps1 @@ -9,10 +9,10 @@ function Get-JavlibraryData { $movieDataObject = @() try { - Write-JLog -Level Debug -Message "Performing [GET] on URL [$Url] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Level Debug -Message "Performing [GET] on URL [$Url] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" $webRequest = Invoke-WebRequest -Uri $Url -Method Get -WebSession $Session -UserAgent $Session.UserAgent -Verbose:$false } catch { - Write-JLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" } $movieDataObject = [PSCustomObject]@{ @@ -34,7 +34,7 @@ function Get-JavlibraryData { ScreenshotUrl = Get-JavlibraryScreenshotUrl -WebRequest $webRequest } - Write-JLog -Level Debug -Message "JAVLibrary data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Level Debug -Message "JAVLibrary data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } diff --git a/src/Javinizer/Public/Get-JavlibraryUrl.ps1 b/src/Javinizer/Public/Get-JavlibraryUrl.ps1 index 4ef34fa3..43c64da5 100644 --- a/src/Javinizer/Public/Get-JavlibraryUrl.ps1 +++ b/src/Javinizer/Public/Get-JavlibraryUrl.ps1 @@ -13,10 +13,10 @@ function Get-JavlibraryUrl { $searchUrl = "http://www.javlibrary.com/en/vl_searchbyid.php?keyword=$Id" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -WebSession $Session -UserAgent $Session.UserAgent -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" } # Check if the search uniquely matched a video page @@ -24,14 +24,14 @@ function Get-JavlibraryUrl { $searchResultUrl = $webRequest.BaseResponse.RequestMessage.RequestUri.AbsoluteUri if ($searchResultUrl -match 'http:\/\/www\.javlibrary\.com\/en\/\?v=') { try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchResultUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchResultUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" $webRequest = Invoke-WebRequest -Uri $searchResultUrl -Method Get -WebSession $Session -UserAgent $Session.UserAgent -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchResultUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchResultUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" } $resultId = Get-JavlibraryId -WebRequest $webRequest - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result is [$resultId]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result is [$resultId]" if ($resultId -eq $Id) { $javlibraryUrl = $searchResultUrl } @@ -53,14 +53,14 @@ function Get-JavlibraryUrl { $directUrl = "http://www.javlibrary.com/en/?v=$videoId" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$directUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$directUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" $webRequest = Invoke-WebRequest -Uri $directUrl -Method Get -WebSession $Session -UserAgent $Session.UserAgent -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$directUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$directUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" } $resultId = Get-JavlibraryId -WebRequest $webRequest - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" if ($resultId -eq $Id) { $javlibraryUrl = (Get-JVUrlLocation -Url $webRequest.BaseResponse.RequestMessage.RequestUri.AbsoluteUri).Url @@ -77,7 +77,7 @@ function Get-JavlibraryUrl { } if ($null -eq $javlibraryUrl) { - Write-JLog -Level Warning -Message "[$Id] not matched on JavLibrary" + Write-JVLog -Level Warning -Message "[$Id] not matched on JavLibrary" return } else { if ($Language -eq 'ja') { diff --git a/src/Javinizer/Public/Get-R18Data.ps1 b/src/Javinizer/Public/Get-R18Data.ps1 index 29834aad..7eee29d0 100644 --- a/src/Javinizer/Public/Get-R18Data.ps1 +++ b/src/Javinizer/Public/Get-R18Data.ps1 @@ -57,10 +57,10 @@ function Get-R18Data { } try { - Write-JLog -Level Debug -Message "Performing [GET] on URL [$Url]" + Write-JVLog -Level Debug -Message "Performing [GET] on URL [$Url]" $webRequest = Invoke-WebRequest -Uri $Url -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" } $movieDataObject = [PSCustomObject]@{ @@ -85,7 +85,7 @@ function Get-R18Data { TrailerUrl = Get-R18TrailerUrl -WebRequest $webRequest } - Write-JLog -Level Debug -Message "R18 data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Level Debug -Message "R18 data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } diff --git a/src/Javinizer/Public/Get-R18Url.ps1 b/src/Javinizer/Public/Get-R18Url.ps1 index 8f13907b..f3165282 100644 --- a/src/Javinizer/Public/Get-R18Url.ps1 +++ b/src/Javinizer/Public/Get-R18Url.ps1 @@ -16,7 +16,7 @@ function Get-R18Url { # If contentId is given, convert it back to standard movie ID to validate if ($Id -match '(?:\d{1,5})?([a-zA-Z]{2,10}|[tT]28|[rR]18)(\d{1,5})') { - Write-JLog -Level Debug -Message "Content ID [$Id] detected" + Write-JVLog -Level Debug -Message "Content ID [$Id] detected" $splitId = $Id | Select-String -Pattern '([a-zA-Z|tT28|rR18]{1,10})(\d{1,5})' $studioName = $splitId.Matches.Groups[1].Value $rawStudioId = $splitId.Matches.Groups[2].Value @@ -34,10 +34,10 @@ function Get-R18Url { # Try matching the video with Video ID try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" } $retryCount = 3 @@ -49,19 +49,19 @@ function Get-R18Url { } if ($numResults -ge 1) { - Write-JLog -Level Debug -Message "Searching [$retryCount] of [$numResults] results for [$Id]" + Write-JVLog -Level Debug -Message "Searching [$retryCount] of [$numResults] results for [$Id]" $count = 1 foreach ($result in $searchResults) { try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-WebRequest -Uri $result -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" } $resultId = Get-R18Id -WebRequest $webRequest - Write-JLog -Level Debug -Message "Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "Result [$count] is [$resultId]" if ($resultId -eq $Id) { $directUrl = $result break @@ -80,10 +80,10 @@ function Get-R18Url { $searchUrl = "https://www.r18.com/common/search/searchword=$contentId/" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" } $retryCount = 5 @@ -97,14 +97,14 @@ function Get-R18Url { $count = 1 foreach ($result in $altSearchResults) { try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-WebRequest -Uri $result -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" } $resultId = Get-R18Id -WebRequest $webRequest - Write-JLog -Level Debug -Message "Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "Result [$count] is [$resultId]" if ($resultId -eq $Id) { $directUrl = $result break @@ -123,7 +123,7 @@ function Get-R18Url { $testUrl = "https://www.r18.com/videos/vod/movies/detail/-/id=$contentId/" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on Uri [$testUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on Uri [$testUrl]" $webRequest = Invoke-WebRequest -Uri $testUrl -Method Get -Verbose:$false } catch { $webRequest = $null @@ -131,7 +131,7 @@ function Get-R18Url { if ($null -ne $webRequest) { $resultId = Get-R18Id -WebRequest $webRequest - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result is [$resultId]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result is [$resultId]" if ($resultId -eq $Id) { $directUrl = $testUrl } @@ -139,7 +139,7 @@ function Get-R18Url { } if ($null -eq $directUrl) { - Write-JLog -Level Warning -Message "[$Id] not matched on R18" + Write-JVLog -Level Warning -Message "[$Id] not matched on R18" return } else { if ($Language -eq 'zh') { diff --git a/src/Javinizer/Public/Javinizer.ps1 b/src/Javinizer/Public/Javinizer.ps1 index ef32044f..d0a41739 100644 --- a/src/Javinizer/Public/Javinizer.ps1 +++ b/src/Javinizer/Public/Javinizer.ps1 @@ -358,7 +358,7 @@ function Javinizer { } } } catch { - Write-JLog -Level Error -Message $_ + Write-JVLog -Level Error -Message $_ } #> } @@ -474,7 +474,7 @@ function Javinizer { try { Invoke-Item -LiteralPath $logPath } catch { - Write-JLog -Level Error -Message "Error occurred when opening log file [$logPath]: $PSItem" + Write-JVLog -Level Error -Message "Error occurred when opening log file [$logPath]: $PSItem" } } } @@ -484,7 +484,7 @@ function Javinizer { try { Invoke-Item -Path $settingsPath } catch { - Write-JLog -Level Error -Message "Error occurred when opening settings file [$settingsPath]: $PSItem" + Write-JVLog -Level Error -Message "Error occurred when opening settings file [$settingsPath]: $PSItem" } } } @@ -496,7 +496,7 @@ function Javinizer { } try { - Write-JLog -Level Debug -Message "Getting owned movies on JAVLibrary" + Write-JVLog -Level Debug -Message "Getting owned movies on JAVLibrary" $request = Invoke-WebRequest -Uri "https://www.javlibrary.com/en/mv_owned_print.php" -Verbose:$false -Headers @{ "method" = "GET" "authority" = "www.javlibrary.com" @@ -517,14 +517,14 @@ function Javinizer { $javlibraryOwnedMovies = ($request.content -split '