From 9b3a6a1d970714dc8d09050e2cd085353e156348 Mon Sep 17 00:00:00 2001 From: jvlflame Date: Tue, 22 Sep 2020 16:40:33 -0700 Subject: [PATCH 01/36] Update coverage threshold to 0 --- src/Javinizer.build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Javinizer.build.ps1 b/src/Javinizer.build.ps1 index 7d2dd0d9..f4a678fd 100644 --- a/src/Javinizer.build.ps1 +++ b/src/Javinizer.build.ps1 @@ -214,7 +214,7 @@ Add-BuildTask Test { Assert-Build($numberFails -eq 0) ('Failed "{0}" unit tests.' -f $numberFails) # Ensure our builds fail until if below a minimum defined code test coverage threshold - $coverageThreshold = 50 + $coverageThreshold = 0 if ($testResults.CodeCoverage.NumberOfCommandsExecuted -ne 0) { $coveragePercent = '{0:N2}' -f ($testResults.CodeCoverage.NumberOfCommandsExecuted / $testResults.CodeCoverage.NumberOfCommandsAnalyzed * 100) From f9eaa38351cb2bd009ab00358cb3ecb2c6b92015 Mon Sep 17 00:00:00 2001 From: jvlflame Date: Tue, 22 Sep 2020 18:24:06 -0700 Subject: [PATCH 02/36] Fix dmm URL on id with suffix of z and e (#107) --- src/Javinizer/Public/Get-DmmUrl.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Javinizer/Public/Get-DmmUrl.ps1 b/src/Javinizer/Public/Get-DmmUrl.ps1 index 86e4aa3b..e53ae8cd 100644 --- a/src/Javinizer/Public/Get-DmmUrl.ps1 +++ b/src/Javinizer/Public/Get-DmmUrl.ps1 @@ -83,7 +83,7 @@ function Get-DmmUrl { $splitJaIdNum = (($jaId | Select-String -Pattern '\d{5}[zZ]?[eE]?').Matches.Groups[0].Value) -replace '^0*', '' if (($splitJaIdNum)[-1] -match '\D') { - $appendChar = ($splitIdJaIdNum)[-1] + $appendChar = ($splitJaIdNum)[-1] $splitJaIdNum = $splitJaIdNum -replace '\D', '' } From 33e1999c0bfc837d6c34bba51944f65ef2d0755b Mon Sep 17 00:00:00 2001 From: jvlflame Date: Tue, 22 Sep 2020 18:25:40 -0700 Subject: [PATCH 03/36] Fix nfo name when sort.renamefile is false (#102) --- src/Javinizer/Public/Set-JVMovie.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Javinizer/Public/Set-JVMovie.ps1 b/src/Javinizer/Public/Set-JVMovie.ps1 index 3ef291e3..2e8b6f2b 100644 --- a/src/Javinizer/Public/Set-JVMovie.ps1 +++ b/src/Javinizer/Public/Set-JVMovie.ps1 @@ -158,7 +158,11 @@ function Set-JVMovie { $ActressLanguageJa = $Settings.'sort.metadata.nfo.actresslanguageja' } - $fileName = Convert-JVString -Data $Data -Format $FileFormat -PartNumber $PartNumber -MaxTitleLength $MaxTitleLength -Delimiter $DelimiterFormat -ActressLanguageJa:$ActressLanguageJa -FirstNameOrder:$FirstNameOrder + if ($RenameFile) { + $fileName = Convert-JVString -Data $Data -Format $FileFormat -PartNumber $PartNumber -MaxTitleLength $MaxTitleLength -Delimiter $DelimiterFormat -ActressLanguageJa:$ActressLanguageJa -FirstNameOrder:$FirstNameOrder + } else { + $fileName = (Get-Item -LiteralPath $Path).BaseName + } $folderName = Convert-JVString -Data $Data -Format $FolderFormat -MaxTitleLength $MaxTitleLength -Delimiter $DelimiterFormat -ActressLanguageJa:$ActressLanguageJa -FirstNameOrder:$FirstNameOrder $thumbName = Convert-JVString -Data $Data -Format $ThumbnailFormat -MaxTitleLength $MaxTitleLength -Delimiter $DelimiterFormat -ActressLanguageJa:$ActressLanguageJa -FirstNameOrder:$FirstNameOrder $trailerName = Convert-JVString -Data $Data -Format $TrailerFormat -MaxTitleLength $MaxTitleLength -Delimiter $DelimiterFormat -ActressLanguageJa:$ActressLanguageJa -FirstNameOrder:$FirstNameOrder From 144ed297d6ca167a0ec1dc518841dc3613403787 Mon Sep 17 00:00:00 2001 From: jvlflame Date: Tue, 22 Sep 2020 18:59:39 -0700 Subject: [PATCH 04/36] Add fallback for actor name if selected language is blank in displayname (#103) --- src/Javinizer/Private/Convert-JVString.ps1 | 28 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/Javinizer/Private/Convert-JVString.ps1 b/src/Javinizer/Private/Convert-JVString.ps1 index 124046d7..905b7d75 100644 --- a/src/Javinizer/Private/Convert-JVString.ps1 +++ b/src/Javinizer/Private/Convert-JVString.ps1 @@ -58,14 +58,32 @@ function Convert-JVString { $actressObject = @() if ($ActressLanguageJa) { - $actressObject = $Data.Actress.JapaneseName + if ($null -ne $Data.Actress.Japanese) { + $actressObject = $Data.Actress.JapaneseName + } elseif ($FirstNameOrder) { + foreach ($actress in $Data.Actress) { + $actressObject += "$($actress.FirstName) $($actress.LastName)".Trim() + } + } else { + foreach ($actress in $Data.Actress) { + $actressObject += "$($actress.LastName) $($actress.FirstName)".Trim() + } + } } elseif ($FirstNameOrder) { - foreach ($actress in $Data.Actress) { - $actressObject += "$($actress.FirstName) $($actress.LastName)".Trim() + if ($null -ne $Data.Actress.FirstName) { + foreach ($actress in $Data.Actress) { + $actressObject += "$($actress.FirstName) $($actress.LastName)".Trim() + } + } else { + $actressObject = $Data.Actress.JapaneseName } } else { - foreach ($actress in $Data.Actress) { - $actressObject += "$($actress.LastName) $($actress.FirstName)".Trim() + if ($null -ne $Data.Actress.FirstName) { + foreach ($actress in $Data.Actress) { + $actressObject += "$($actress.LastName) $($actress.FirstName)".Trim() + } + } else { + $actressObject = $Data.Actress.JapaneseName } } From b15ec372bab69699866c49b3970238a8229b3011 Mon Sep 17 00:00:00 2001 From: jvlflame Date: Tue, 22 Sep 2020 19:30:06 -0700 Subject: [PATCH 05/36] Add setting to insert unknown actress to aggregated data object (#105) --- src/Javinizer/Public/Get-JVAggregatedData.ps1 | 20 +++++++++++++++++-- src/Javinizer/jvSettings.json | 3 ++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/Javinizer/Public/Get-JVAggregatedData.ps1 b/src/Javinizer/Public/Get-JVAggregatedData.ps1 index a343a7f6..d19b34c5 100644 --- a/src/Javinizer/Public/Get-JVAggregatedData.ps1 +++ b/src/Javinizer/Public/Get-JVAggregatedData.ps1 @@ -126,8 +126,12 @@ function Get-JVAggregatedData { [Boolean]$ActressLanguageJa, [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] - [Alias('sort.emtadata.thumbcsv.autoadd')] - [Boolean]$ThumbCsvAutoAdd + [Alias('sort.metadata.thumbcsv.autoadd')] + [Boolean]$ThumbCsvAutoAdd, + + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] + [Alias('sort.metadata.nfo.addunknownactress')] + [Boolean]$AddUnknownActress ) process { @@ -159,6 +163,7 @@ function Get-JVAggregatedData { $ActressLanguageJa = $Settings.'sort.metadata.nfo.actresslanguageja' $ThumbCsvAutoAdd = $Settings.'sort.metadata.thumbcsv.autoadd' $FirstNameOrder = $Settings.'sort.metadata.nfo.firstnameorder' + $AddUnknownActress = $Settings.'sort.metadata.nfo.addunknownactress' if ($Settings.'location.genrecsv' -ne '') { $GenreCsvPath = $Settings.'location.genrecsv' } @@ -445,6 +450,17 @@ function Get-JVAggregatedData { } } + if ($AddUnknownActress) { + if ($null -eq $aggregatedDataObject.Actress) { + $aggregatedDataObject.Actress += [PSCustomObject]@{ + LastName = $null + FirstName = 'Unknown' + JapaneseName = 'Unknown' + ThumbUrl = $null + } + } + } + if ($ReplaceGenre) { if (Test-Path -LiteralPath $GenreCsvPath) { try { diff --git a/src/Javinizer/jvSettings.json b/src/Javinizer/jvSettings.json index 3e6ccde1..f2bfdff7 100644 --- a/src/Javinizer/jvSettings.json +++ b/src/Javinizer/jvSettings.json @@ -32,7 +32,7 @@ ], "match.excludedfilestring": ["^.*-trailer*", "^.*-5\\."], "match.regex": 0, - "match.regex.string": "([a-zA-Z|tT28]+-\\d+z{0,1}Z{0,1}e{0,1}E{0,1})(?:-pt){0,1}(\\d{1,2})?", + "match.regex.string": "([a-zA-Z|tT28]+-\\d+[zZ]?[eE]?)(?:-pt)?(\\d{1,2})?", "match.regex.idmatch": 1, "match.regex.ptmatch": 2, "sort.movetofolder": 1, @@ -61,6 +61,7 @@ "sort.metadata.nfo.seriesastag": 1, "sort.metadata.nfo.firstnameorder": 0, "sort.metadata.nfo.actresslanguageja": 0, + "sort.metadata.nfo.addunknownactress": 1, "sort.metadata.thumbcsv": 1, "sort.metadata.thumbcsv.autoadd": 1, "sort.metadata.thumbcsv.convertalias": 1, From e8d815487527c34663ae9aa40b6a8baae35aefe8 Mon Sep 17 00:00:00 2001 From: jvlflame Date: Tue, 22 Sep 2020 20:02:55 -0700 Subject: [PATCH 06/36] Change unknown actress setting name (#105) --- src/Javinizer/Public/Get-JVAggregatedData.ps1 | 6 +++--- src/Javinizer/jvSettings.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Javinizer/Public/Get-JVAggregatedData.ps1 b/src/Javinizer/Public/Get-JVAggregatedData.ps1 index d19b34c5..09a4381a 100644 --- a/src/Javinizer/Public/Get-JVAggregatedData.ps1 +++ b/src/Javinizer/Public/Get-JVAggregatedData.ps1 @@ -130,8 +130,8 @@ function Get-JVAggregatedData { [Boolean]$ThumbCsvAutoAdd, [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] - [Alias('sort.metadata.nfo.addunknownactress')] - [Boolean]$AddUnknownActress + [Alias('sort.metadata.nfo.unknownactress')] + [Boolean]$UnknownActress ) process { @@ -163,7 +163,7 @@ function Get-JVAggregatedData { $ActressLanguageJa = $Settings.'sort.metadata.nfo.actresslanguageja' $ThumbCsvAutoAdd = $Settings.'sort.metadata.thumbcsv.autoadd' $FirstNameOrder = $Settings.'sort.metadata.nfo.firstnameorder' - $AddUnknownActress = $Settings.'sort.metadata.nfo.addunknownactress' + $AddUnknownActress = $Settings.'sort.metadata.nfo.unknownactress' if ($Settings.'location.genrecsv' -ne '') { $GenreCsvPath = $Settings.'location.genrecsv' } diff --git a/src/Javinizer/jvSettings.json b/src/Javinizer/jvSettings.json index f2bfdff7..a6efd454 100644 --- a/src/Javinizer/jvSettings.json +++ b/src/Javinizer/jvSettings.json @@ -61,7 +61,7 @@ "sort.metadata.nfo.seriesastag": 1, "sort.metadata.nfo.firstnameorder": 0, "sort.metadata.nfo.actresslanguageja": 0, - "sort.metadata.nfo.addunknownactress": 1, + "sort.metadata.nfo.unknownactress": 1, "sort.metadata.thumbcsv": 1, "sort.metadata.thumbcsv.autoadd": 1, "sort.metadata.thumbcsv.convertalias": 1, From baa59b1612d35810c1ab86ef91d4bdaa50ac57f6 Mon Sep 17 00:00:00 2001 From: jvlflame Date: Tue, 22 Sep 2020 20:20:13 -0700 Subject: [PATCH 07/36] Fix variable name for unknownactress --- src/Javinizer/Public/Get-JVAggregatedData.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Javinizer/Public/Get-JVAggregatedData.ps1 b/src/Javinizer/Public/Get-JVAggregatedData.ps1 index 09a4381a..7fb3844e 100644 --- a/src/Javinizer/Public/Get-JVAggregatedData.ps1 +++ b/src/Javinizer/Public/Get-JVAggregatedData.ps1 @@ -163,7 +163,7 @@ function Get-JVAggregatedData { $ActressLanguageJa = $Settings.'sort.metadata.nfo.actresslanguageja' $ThumbCsvAutoAdd = $Settings.'sort.metadata.thumbcsv.autoadd' $FirstNameOrder = $Settings.'sort.metadata.nfo.firstnameorder' - $AddUnknownActress = $Settings.'sort.metadata.nfo.unknownactress' + $UnknownActress = $Settings.'sort.metadata.nfo.unknownactress' if ($Settings.'location.genrecsv' -ne '') { $GenreCsvPath = $Settings.'location.genrecsv' } @@ -450,7 +450,7 @@ function Get-JVAggregatedData { } } - if ($AddUnknownActress) { + if ($UnknownActress) { if ($null -eq $aggregatedDataObject.Actress) { $aggregatedDataObject.Actress += [PSCustomObject]@{ LastName = $null From abead29d1c863374bd7289af174795fe752f265f Mon Sep 17 00:00:00 2001 From: jvlflame Date: Tue, 22 Sep 2020 21:17:27 -0700 Subject: [PATCH 08/36] Add tag and tagline to aggregated dataobject (#106) --- src/Javinizer/Private/Test-JVSettings.ps1 | 4 ++- src/Javinizer/Public/Get-JVAggregatedData.ps1 | 34 ++++++++++++++++++- src/Javinizer/Public/Get-JVNfo.ps1 | 16 +++++---- src/Javinizer/Public/Javinizer.ps1 | 2 +- src/Javinizer/Public/Set-JVMovie.ps1 | 7 +--- src/Javinizer/jvSettings.json | 3 +- 6 files changed, 50 insertions(+), 16 deletions(-) diff --git a/src/Javinizer/Private/Test-JVSettings.ps1 b/src/Javinizer/Private/Test-JVSettings.ps1 index 20ddc63c..43f92291 100644 --- a/src/Javinizer/Private/Test-JVSettings.ps1 +++ b/src/Javinizer/Private/Test-JVSettings.ps1 @@ -93,11 +93,11 @@ function Test-JVSettings { 'sort.metadata.genrecsv', 'sort.metadata.nfo.actresslanguageja', 'sort.metadata.nfo.firstnameorder', - 'sort.metadata.nfo.seriesastag', 'sort.metadata.nfo.translatedescription', 'sort.metadata.thumbcsv.convertalias', 'sort.metadata.thumbcsv.autoadd', 'sort.metadata.thumbcsv', + 'sort.metadata.unknownactress', 'sort.movetofolder', 'sort.renamefile' ) | Test-JVSettingsGroup -Settings $Settings -Type Boolean @@ -127,6 +127,7 @@ function Test-JVSettings { 'sort.format.thumbimg', 'sort.format.trailervid', 'sort.metadata.nfo.displayname', + 'sort.metadata.nfo.format.tagline', 'sort.metadata.nfo.translatedescription.language' ) | Test-JVSettingsGroup -Settings $Settings -Type String @@ -135,6 +136,7 @@ function Test-JVSettings { 'match.includedfileextension', 'sort.format.posterimg', 'sort.metadata.genre.ignore', + 'sort.metadata.nfo.format.tag', 'sort.metadata.priority.actress', 'sort.metadata.priority.alternatetitle', 'sort.metadata.priority.coverurl', diff --git a/src/Javinizer/Public/Get-JVAggregatedData.ps1 b/src/Javinizer/Public/Get-JVAggregatedData.ps1 index 7fb3844e..90fa140b 100644 --- a/src/Javinizer/Public/Get-JVAggregatedData.ps1 +++ b/src/Javinizer/Public/Get-JVAggregatedData.ps1 @@ -131,7 +131,15 @@ function Get-JVAggregatedData { [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] [Alias('sort.metadata.nfo.unknownactress')] - [Boolean]$UnknownActress + [Boolean]$UnknownActress, + + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] + [Alias('sort.metadata.nfo.format.tag')] + [Array]$Tag, + + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] + [Alias('sort.metadata.nfo.format.tagline')] + [String]$Tagline ) process { @@ -164,6 +172,8 @@ function Get-JVAggregatedData { $ThumbCsvAutoAdd = $Settings.'sort.metadata.thumbcsv.autoadd' $FirstNameOrder = $Settings.'sort.metadata.nfo.firstnameorder' $UnknownActress = $Settings.'sort.metadata.nfo.unknownactress' + $Tag = $Settings.'sort.metadata.nfo.format.tag' + $Tagline = $Settings.'sort.metadata.nfo.format.tagline' if ($Settings.'location.genrecsv' -ne '') { $GenreCsvPath = $Settings.'location.genrecsv' } @@ -185,6 +195,8 @@ function Get-JVAggregatedData { Maker = $null Label = $null Series = $null + Tag = $null + Tagline = $null Actress = $null Genre = $null CoverUrl = $null @@ -513,6 +525,26 @@ function Get-JVAggregatedData { } } + if ($null -ne $Tag[0]) { + $aggregatedDataObject.Tag = @() + foreach ($entry in $Tag) { + $tagString = (Convert-JVString -Data $aggregatedDataObject -FormatString $entry -Delimiter $DelimiterFormat -ActressLanguageJa:$ActressLanguageJa -FirstNameOrder:$FirstNameOrder) + if ($null -ne $tagString -and $tagstring -ne '') { + $aggregatedDataObject.Tag += $tagString + } + } + if ($null -eq $aggregatedDataObject.Tag[0]) { + $aggregatedDataObject.Tag = $null + } + } + + if ($null -ne $Tagline) { + $taglineString = (Convert-JVString -Data $aggregatedDataObject -FormatString $Tagline -Delimiter $DelimiterFormat -ActressLanguageJa:$ActressLanguageJa -FirstNameOrder:$FirstNameOrder) + if ($null -ne $taglineString -and $taglineString -ne '') { + $aggregatedDataObject.Tagline += $taglineString + } + } + $dataObject = [PSCustomObject]@{ Data = $aggregatedDataObject } diff --git a/src/Javinizer/Public/Get-JVNfo.ps1 b/src/Javinizer/Public/Get-JVNfo.ps1 index 40191298..fdab9100 100644 --- a/src/Javinizer/Public/Get-JVNfo.ps1 +++ b/src/Javinizer/Public/Get-JVNfo.ps1 @@ -66,14 +66,17 @@ function Get-JVNfo { [AllowEmptyString()] [String]$TrailerUrl, - [Parameter()] - [Boolean]$ActressLanguageJa, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Array]$Tag, + + [Parameter(ValueFromPipelineByPropertyName = $true)] + [String]$Tagline, [Parameter()] - [Boolean]$NameOrder, + [Boolean]$ActressLanguageJa, [Parameter()] - [Boolean]$AddTag + [Boolean]$NameOrder ) process { @@ -117,13 +120,14 @@ function Get-JVNfo { $Runtime $TrailerUrl XXX + $Tagline $Series "@ - if ($AddTag) { + foreach ($item in $Tag) { $tagNfoString = @" - $Series + $item "@ $nfoString = $nfoString + $tagNfoString diff --git a/src/Javinizer/Public/Javinizer.ps1 b/src/Javinizer/Public/Javinizer.ps1 index e38f6b3d..b3ceee2a 100644 --- a/src/Javinizer/Public/Javinizer.ps1 +++ b/src/Javinizer/Public/Javinizer.ps1 @@ -517,7 +517,7 @@ function Javinizer { } if ($Nfo) { - $nfoData = $data.Data | Get-JVNfo -ActressLanguageJa:$Settings.'sort.metadata.nfo.actresslanguageja' -NameOrder:$Settings.'sort.metadata.nfo.firstnameorder' -AddTag:$Settings.'sort.metadata.nfo.seriesastag' + $nfoData = $data.Data | Get-JVNfo -ActressLanguageJa:$Settings.'sort.metadata.nfo.actresslanguageja' -NameOrder:$Settings.'sort.metadata.nfo.firstnameorder' Write-Output $nfoData } else { Write-Output $data.Data diff --git a/src/Javinizer/Public/Set-JVMovie.ps1 b/src/Javinizer/Public/Set-JVMovie.ps1 index 2e8b6f2b..d0eef3df 100644 --- a/src/Javinizer/Public/Set-JVMovie.ps1 +++ b/src/Javinizer/Public/Set-JVMovie.ps1 @@ -104,10 +104,6 @@ function Set-JVMovie { [Alias('sort.metadata.nfo.displayname')] [String]$DisplayName, - [Parameter(ValueFromPipelineByPropertyName = $true)] - [Alias('sort.metadata.nfo.seriesastag')] - [Boolean]$AddTag, - [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('sort.metadata.nfo.firstnameorder')] [Boolean]$FirstNameOrder, @@ -152,7 +148,6 @@ function Set-JVMovie { $ScreenshotFolderFormat = $Settings.'sort.format.screenshotfolder' $ActorFolderFormat = $Settings.'sort.format.actressimgfolder' $DisplayName = $Settings.'sort.metadata.nfo.displayname' - $AddTag = $Settings.'sort.metadata.nfo.seriesastag' $FirstNameOrder = $Settings.'sort.metadata.nfo.firstnameorder' $DelimiterFormat = $Settings.'sort.format.delimiter' $ActressLanguageJa = $Settings.'sort.metadata.nfo.actresslanguageja' @@ -220,7 +215,7 @@ function Set-JVMovie { if ($CreateNfo) { try { $nfoPath = Join-Path -Path $folderPath -ChildPath "$nfoName.nfo" - $nfoContents = $Data | Get-JVNfo -NameOrder $FirstNameOrder -AddTag $AddTag -ActressLanguageJa:$ActressLanguageJa + $nfoContents = $Data | Get-JVNfo -NameOrder $FirstNameOrder -ActressLanguageJa:$ActressLanguageJa $nfoContents | Out-File -LiteralPath $nfoPath -Force:$Force Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] [Nfo] created at path [$nfoPath]" } catch { diff --git a/src/Javinizer/jvSettings.json b/src/Javinizer/jvSettings.json index a6efd454..6798f704 100644 --- a/src/Javinizer/jvSettings.json +++ b/src/Javinizer/jvSettings.json @@ -58,10 +58,11 @@ "sort.metadata.nfo.translatedescription": 0, "sort.metadata.nfo.translatedescription.language": "en", "sort.metadata.nfo.displayname": "[] ", - "sort.metadata.nfo.seriesastag": 1, "sort.metadata.nfo.firstnameorder": 0, "sort.metadata.nfo.actresslanguageja": 0, "sort.metadata.nfo.unknownactress": 1, + "sort.metadata.nfo.format.tag": ["<SET>"], + "sort.metadata.nfo.format.tagline": "", "sort.metadata.thumbcsv": 1, "sort.metadata.thumbcsv.autoadd": 1, "sort.metadata.thumbcsv.convertalias": 1, From bca5e242ca99838e65c2dfbe8e7015acb1bf8597 Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Tue, 22 Sep 2020 21:38:00 -0700 Subject: [PATCH 09/36] Fix error when tagline setting is empty (#106) --- src/Javinizer/Public/Get-JVAggregatedData.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Javinizer/Public/Get-JVAggregatedData.ps1 b/src/Javinizer/Public/Get-JVAggregatedData.ps1 index 90fa140b..34b813be 100644 --- a/src/Javinizer/Public/Get-JVAggregatedData.ps1 +++ b/src/Javinizer/Public/Get-JVAggregatedData.ps1 @@ -538,7 +538,7 @@ function Get-JVAggregatedData { } } - if ($null -ne $Tagline) { + if ($Tagline -ne '') { $taglineString = (Convert-JVString -Data $aggregatedDataObject -FormatString $Tagline -Delimiter $DelimiterFormat -ActressLanguageJa:$ActressLanguageJa -FirstNameOrder:$FirstNameOrder) if ($null -ne $taglineString -and $taglineString -ne '') { $aggregatedDataObject.Tagline += $taglineString From 271f28563379e1430eccd26ba2b3003f59056816 Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Wed, 23 Sep 2020 00:05:20 -0700 Subject: [PATCH 10/36] Add initial dlgetchu scraper functions (#51) --- src/Javinizer/Private/Scraper.DLgetchu.ps1 | 179 +++++++++++++++++++++ src/Javinizer/Public/Get-DLgetchuData.ps1 | 41 +++++ 2 files changed, 220 insertions(+) create mode 100644 src/Javinizer/Private/Scraper.DLgetchu.ps1 create mode 100644 src/Javinizer/Public/Get-DLgetchuData.ps1 diff --git a/src/Javinizer/Private/Scraper.DLgetchu.ps1 b/src/Javinizer/Private/Scraper.DLgetchu.ps1 new file mode 100644 index 00000000..d7ac909b --- /dev/null +++ b/src/Javinizer/Private/Scraper.DLgetchu.ps1 @@ -0,0 +1,179 @@ +function Get-DLgetchuId { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + + process { + try { + $id = ($Webrequest.Content | Select-String -Pattern '作品ID:(\d*)').Matches.Groups[1].Value + } catch { + return + } + Write-Output $id + } +} + +function Get-DLgetchuTitle { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + process { + try { + $title = ($Webrequest.Content -split '\n' | Select-String -Pattern '<meta property="og:title" content="(.*)" />').Matches.Groups[1].Value + } catch { + return + } + Write-Output $title + } +} + +function Get-DLgetchuDescription { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + + process { + try { + $descriptionBlock = ((($Webrequest.Content -split '作品内容<\/td>')[1] -split '<\/td>')[0] -replace '<[^>]*>', '').Trim() + } catch { + return + } + + $description = $descriptionBlock -split '\n' -join ' ' + Write-Output $description + } +} + +function Get-DLgetchuReleaseDate { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + + process { + try { + $releaseDate = ($Webrequest.Content | Select-String -Pattern '<td bgcolor="white" width="449">(\d{4}\/\d{2}\/\d{2})<\/td>').Matches.Groups[1].Value + } catch { + return + } + Write-Output $releaseDate + } +} + +function Get-DLgetchuReleaseYear { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + + process { + $releaseYear = Get-DLgetchuReleaseDate -WebRequest $Webrequest + $releaseYear = ($releaseYear -split '-')[0] + Write-Output $releaseYear + } +} + +function Get-DLgetchuRuntime { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + + process { + $unicodeReplace = @{ + '0' = '0' + '1' = '1' + '2' = '2' + '3' = '3' + '4' = '4' + '5' = '5' + '6' = '6' + '7' = '7' + '8' = '8' + '9' = '9' + } + + try { + $length = ($WebRequest.Content | Select-String -Pattern '([0123456789]?\s?[0123456789]?\s?[0123456789]?)分').Matches.Groups[1].Value + } catch { + return + } + + foreach ($unicode in $unicodeReplace.GetEnumerator()) { + $length = $length -replace $unicode.Name, $unicode.Value + } + + Write-Output $length + } +} + +function Get-DLgetchuMaker { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + + process { + $maker = ($Webrequest.Content | Select-String -Pattern '<a href=".*dojin_circle_detail.php\?id=\d*.*">(.*)<\/a><\/td>').Matches.Groups[1].Value + Write-Output $maker + } +} + + +function Get-DLgetchuGenre { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + + process { + try { + $genreHtml = (($Webrequest.Content -split '<td class="bluetext" align="center" bgcolor="#f0f8ff" width="100">趣向</td>')[1] -split '<\/tr>')[0] + $genre = ($genreHtml | Select-String -Pattern '<a href=".*genre_id=(\d*).*">(.*)<\/a>' -AllMatches).Matches | ForEach-Object { $_.Groups[2].Value } + } catch { + return + } + + if ($genre.Count -eq 0) { + $genre = $null + } + + Write-Output $genre + } +} + +function Get-DLgetchuCoverUrl { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + + process { + try { + $coverUrl = "http://dl.getchu.com" + ($Webrequest.Content | Select-String -Pattern '\/data\/item_img\/.*\/.*\/\d*top\.jpg').Matches.Groups[0].Value + } catch { + return + } + + Write-Output $coverUrl + } +} + +function Get-DLgetchuScreenshotUrl { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + + process { + try { + $screenshotUrl = ($Webrequest.Content | Select-String -Pattern '"(\/data\/item_img\/.*\/.*\/.*\.jpg)" class="highslide"' -AllMatches).Matches | ForEach-Object { "http://dl.getchu.com" + $_.Groups[1].Value } + } catch { + return + } + Write-Output $screenshotUrl + } +} diff --git a/src/Javinizer/Public/Get-DLgetchuData.ps1 b/src/Javinizer/Public/Get-DLgetchuData.ps1 new file mode 100644 index 00000000..667cec01 --- /dev/null +++ b/src/Javinizer/Public/Get-DLgetchuData.ps1 @@ -0,0 +1,41 @@ +#Requires -PSEdition Core + +function Get-DLgetchuData { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [String]$Url + ) + + process { + $movieDataObject = @() + + try { + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$Url]" + $webRequest = Invoke-WebRequest -Uri $Url -Method Get -Verbose:$false + } catch [Microsoft.PowerShell.Commands.HttpResponseException] { + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Warning -Message "[$($MyInvocation.MyCommand.Name)] Not found on DMM [$Url]" + continue + } catch { + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" + } + + $movieDataObject = [PSCustomObject]@{ + Source = 'dlgetchuja' + Url = $Url + Id = Get-DLgetchuId -WebRequest $webRequest + Title = Get-DLgetchuTitle -WebRequest $webRequest + Description = Get-DLgetchuDescription -WebRequest $webRequest + ReleaseDate = Get-DLgetchuReleaseDate -WebRequest $webRequest + ReleaseYear = Get-DLgetchuReleaseYear -WebRequest $webRequest + Runtime = Get-DLgetchuRuntime -WebRequest $webRequest + Maker = Get-DLgetchuMaker -WebRequest $webRequest + Genre = Get-DLgetchuGenre -WebRequest $webRequest + CoverUrl = Get-DLgetchuCoverUrl -WebRequest $webRequest + ScreenshotUrl = Get-DLgetchuScreenshotUrl -WebRequest $webRequest + } + + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] DMM data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-Output $movieDataObject + } +} From ddd996e083831e96232f9d99f9f4cfc4c78ce5ec Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Wed, 23 Sep 2020 18:36:46 -0700 Subject: [PATCH 11/36] Remove extra html elements from dmm description --- src/Javinizer/Private/Scraper.Dmm.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Javinizer/Private/Scraper.Dmm.ps1 b/src/Javinizer/Private/Scraper.Dmm.ps1 index 0cc4da37..21bf0983 100644 --- a/src/Javinizer/Private/Scraper.Dmm.ps1 +++ b/src/Javinizer/Private/Scraper.Dmm.ps1 @@ -46,7 +46,7 @@ function Get-DmmDescription { if ($null -eq $description -or $description -eq '') { $description = (((($Webrequest.Content -join "`r`n") -split '<div class="mg-b20 lh4">')[1]) -split '\n')[6] - $description = ($description -replace '<p class=".*">.*<\/p>', '').Trim() + $description = ($description -replace '<p class=".*">.*<\/p>', '', '<br>').Trim() } Write-Output $description From 580386182eca7f7a7887ee54fc984354ea5f2bd4 Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Wed, 23 Sep 2020 19:14:20 -0700 Subject: [PATCH 12/36] Fix amateur r18 videos and uncensor functionality (#108) --- src/Javinizer/Private/Scraper.R18.ps1 | 32 +++++++++++++++++++++------ src/Javinizer/Public/Get-R18Data.ps1 | 2 +- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/Javinizer/Private/Scraper.R18.ps1 b/src/Javinizer/Private/Scraper.R18.ps1 index 5b576fbe..c08307d8 100644 --- a/src/Javinizer/Private/Scraper.R18.ps1 +++ b/src/Javinizer/Private/Scraper.R18.ps1 @@ -48,8 +48,10 @@ function Get-R18Title { $title = Convert-HtmlCharacter -String $title if ($Replace) { foreach ($string in $Replace) { - $title = $title -replace [regex]::Escape($string.Original), $string.Replacement - $title = $title -replace ' ', ' ' + if (($title -split ' ') -eq $string.Original) { + $title = $title -replace [regex]::Escape($string.Original), $string.Replacement + $title = $title -replace ' ', ' ' + } } } @@ -188,12 +190,26 @@ function Get-R18Maker { function Get-R18Label { param ( [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] - [Object]$Webrequest + [Object]$Webrequest, + + [Parameter()] + [Object]$Replace ) process { - $label = (((($Webrequest.Content -split '<dd itemprop="productionCompany" itemscope itemtype="http:\/\/schema.org\/Organization\">')[1] -split '<\/dl>')[0] -split '<dd>')[1] -split '<br>')[0] - $label = Convert-HtmlCharacter -String $label + try { + $label = ((($Webrequest.Content -split '<dt>(Label:|廠牌:)<\/dt>')[2] -split '</dd>')[0] -replace '<[^>]*>' , '').Trim() + } catch { + return + } + + if ($Replace) { + foreach ($string in $Replace.GetEnumerator()) { + if (($label -split ' ') -eq $string.Original) { + $label = $label -replace [regex]::Escape($string.Original), $string.Replacement + } + } + } if ($label -eq '----') { $label = $null @@ -261,11 +277,13 @@ function Get-R18Genre { foreach ($genre in $genreHtml) { $genre = $genre.trim() - if ($genre -notmatch 'https:\/\/www\.r18\.com\/videos\/vod\/movies\/list\/id=(.*)' -and $genre -ne '') { + if ($genre -notmatch 'https:\/\/www\.r18\.com\/videos\/vod\/(movies|amateur)\/list\/id=(.*)' -and $genre -ne '') { $genre = Convert-HtmlCharacter -String $genre if ($Replace) { foreach ($string in $Replace.GetEnumerator()) { - $genre = $genre -replace [regex]::Escape($string.Original), $string.Replacement + if (($genre -split ' ') -eq $string.Original) { + $genre = $genre -replace [regex]::Escape($string.Original), $string.Replacement + } } } $genreArray += $genre diff --git a/src/Javinizer/Public/Get-R18Data.ps1 b/src/Javinizer/Public/Get-R18Data.ps1 index 3fe9cadb..c4a89376 100644 --- a/src/Javinizer/Public/Get-R18Data.ps1 +++ b/src/Javinizer/Public/Get-R18Data.ps1 @@ -37,7 +37,7 @@ function Get-R18Data { Runtime = Get-R18Runtime -WebRequest $webRequest Director = Get-R18Director -WebRequest $webRequest Maker = Get-R18Maker -WebRequest $webRequest - Label = Get-R18Label -WebRequest $webRequest + Label = Get-R18Label -WebRequest $webRequest -Replace $replaceHashTable Series = Get-R18Series -WebRequest $webRequest -Replace $replaceHashTable Actress = Get-R18Actress -WebRequest $webRequest Genre = Get-R18Genre -WebRequest $webRequest -Replace $replaceHashTable From 656a968e2690199cbfaeee7846bac020d78e7260 Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Wed, 23 Sep 2020 23:28:03 -0700 Subject: [PATCH 13/36] Clean up extra html on dmm description --- src/Javinizer/Private/Scraper.Dmm.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Javinizer/Private/Scraper.Dmm.ps1 b/src/Javinizer/Private/Scraper.Dmm.ps1 index 21bf0983..c853fa47 100644 --- a/src/Javinizer/Private/Scraper.Dmm.ps1 +++ b/src/Javinizer/Private/Scraper.Dmm.ps1 @@ -46,7 +46,7 @@ function Get-DmmDescription { if ($null -eq $description -or $description -eq '') { $description = (((($Webrequest.Content -join "`r`n") -split '<div class="mg-b20 lh4">')[1]) -split '\n')[6] - $description = ($description -replace '<p class=".*">.*<\/p>', '', '<br>').Trim() + $description = ($description -replace '<p class=".*">.*<\/p>', '' -replace '<br>', '').Trim() } Write-Output $description From 4d6d28b475f7eeccf222db362b2f5b2b0ade3f13 Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Wed, 23 Sep 2020 23:28:47 -0700 Subject: [PATCH 14/36] Remove deprecated javlibrary session debug output --- src/Javinizer/Public/Get-JavlibraryData.ps1 | 2 +- src/Javinizer/Public/Get-JavlibraryUrl.ps1 | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Javinizer/Public/Get-JavlibraryData.ps1 b/src/Javinizer/Public/Get-JavlibraryData.ps1 index deafb804..31a07f89 100644 --- a/src/Javinizer/Public/Get-JavlibraryData.ps1 +++ b/src/Javinizer/Public/Get-JavlibraryData.ps1 @@ -14,7 +14,7 @@ function Get-JavlibraryData { $movieDataObject = @() try { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$Url] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$Url]" $webRequest = Invoke-WebRequest -Uri $Url -Method Get -WebSession $Session -UserAgent $Session.UserAgent -Verbose:$false } catch { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" diff --git a/src/Javinizer/Public/Get-JavlibraryUrl.ps1 b/src/Javinizer/Public/Get-JavlibraryUrl.ps1 index c8fc91a4..266e17d6 100644 --- a/src/Javinizer/Public/Get-JavlibraryUrl.ps1 +++ b/src/Javinizer/Public/Get-JavlibraryUrl.ps1 @@ -19,10 +19,10 @@ function Get-JavlibraryUrl { $searchUrl = "$BaseUrl/en/vl_searchbyid.php?keyword=$Id" try { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" } # Check if the search uniquely matched a video page @@ -30,10 +30,10 @@ function Get-JavlibraryUrl { $searchResultUrl = $webRequest.BaseResponse.RequestMessage.RequestUri.AbsoluteUri if ($searchResultUrl -match "$BaseUrl?v=") { try { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchResultUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchResultUrl]" $webRequest = Invoke-WebRequest -Uri $searchResultUrl -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchResultUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchResultUrl]: $PSItem" } $resultId = Get-JavlibraryId -WebRequest $webRequest @@ -59,10 +59,10 @@ function Get-JavlibraryUrl { $directUrl = "$BaseUrl/en/?v=$videoId" try { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$directUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$directUrl]" $webRequest = Invoke-WebRequest -Uri $directUrl -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$directUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$directUrl]: $PSItem" } $resultId = Get-JavlibraryId -WebRequest $webRequest From a6487fa7ca038480bef22c79383f0b129349e34d Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Wed, 23 Sep 2020 23:30:20 -0700 Subject: [PATCH 15/36] Fix error messages when failing to opening external files --- src/Javinizer/Public/Javinizer.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Javinizer/Public/Javinizer.ps1 b/src/Javinizer/Public/Javinizer.ps1 index b3ceee2a..ca32cfd1 100644 --- a/src/Javinizer/Public/Javinizer.ps1 +++ b/src/Javinizer/Public/Javinizer.ps1 @@ -548,7 +548,7 @@ function Javinizer { Write-Host "[$($MyInvocation.MyCommand.Name)] [ThumbCsvPath - $thumbCsvPath]" Invoke-Item -LiteralPath $thumbCsvPath } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error occurred when opening thumbcsv file [$]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error occurred when opening thumbcsv file [$thumbCsvPath]: $PSItem" } } @@ -557,16 +557,16 @@ function Javinizer { Write-Host "[$($MyInvocation.MyCommand.Name)] [GenreCsvPath - $genreCsvPath]" Invoke-Item -LiteralPath $genreCsvPath } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error occurred when opening thumbcsv file [$]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error occurred when opening thumbcsv file [$genreCsvPath]: $PSItem" } } if ($OpenUncensor) { try { - Write-Host "[$($MyInvocation.MyCommand.Name)] [UncensorCsvPath - $uncensorCsvPath']" + Write-Host "[$($MyInvocation.MyCommand.Name)] [UncensorCsvPath - $uncensorCsvPath]" Invoke-Item -LiteralPath $uncensorCsvPath } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error occurred when opening thumbcsv file [$]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error occurred when opening thumbcsv file [$uncensorCsvPath]: $PSItem" } } } From b3e2c882105dd8f155bc7ed146fe5bd35ad231eb Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Wed, 23 Sep 2020 23:44:55 -0700 Subject: [PATCH 16/36] Set Javinizer to continue on scraper error (#109) --- src/Javinizer/Public/Get-DLgetchuData.ps1 | 2 +- src/Javinizer/Public/Get-DmmData.ps1 | 2 +- src/Javinizer/Public/Get-DmmUrl.ps1 | 4 ++-- src/Javinizer/Public/Get-Jav321Data.ps1 | 2 +- src/Javinizer/Public/Get-Jav321Url.ps1 | 4 ++-- src/Javinizer/Public/Get-JavbusData.ps1 | 2 +- src/Javinizer/Public/Get-JavbusUrl.ps1 | 2 +- src/Javinizer/Public/Get-JavlibraryData.ps1 | 2 +- src/Javinizer/Public/Get-JavlibraryUrl.ps1 | 6 +++--- src/Javinizer/Public/Get-R18Data.ps1 | 2 +- src/Javinizer/Public/Get-R18Url.ps1 | 8 ++++---- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Javinizer/Public/Get-DLgetchuData.ps1 b/src/Javinizer/Public/Get-DLgetchuData.ps1 index 667cec01..10151010 100644 --- a/src/Javinizer/Public/Get-DLgetchuData.ps1 +++ b/src/Javinizer/Public/Get-DLgetchuData.ps1 @@ -17,7 +17,7 @@ function Get-DLgetchuData { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Warning -Message "[$($MyInvocation.MyCommand.Name)] Not found on DMM [$Url]" continue } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" -Action 'Continue' } $movieDataObject = [PSCustomObject]@{ diff --git a/src/Javinizer/Public/Get-DmmData.ps1 b/src/Javinizer/Public/Get-DmmData.ps1 index 8919fd08..1ce71407 100644 --- a/src/Javinizer/Public/Get-DmmData.ps1 +++ b/src/Javinizer/Public/Get-DmmData.ps1 @@ -38,7 +38,7 @@ function Get-DmmData { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Warning -Message "[$($MyInvocation.MyCommand.Name)] Not found on DMM [$Url]" continue } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" -Action 'Continue' } $movieDataObject = [PSCustomObject]@{ diff --git a/src/Javinizer/Public/Get-DmmUrl.ps1 b/src/Javinizer/Public/Get-DmmUrl.ps1 index e53ae8cd..0970aa01 100644 --- a/src/Javinizer/Public/Get-DmmUrl.ps1 +++ b/src/Javinizer/Public/Get-DmmUrl.ps1 @@ -34,7 +34,7 @@ function Get-DmmUrl { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$originalId] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$originalId] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$originalId] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$searchUrl]: $PSItem" -Action 'Continue' } $retryCount = 3 @@ -54,7 +54,7 @@ function Get-DmmUrl { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$originalId] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-WebRequest -Uri $result -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$originalId] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$originalId] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" -Action 'Continue' } $resultId = Get-DmmContentId -WebRequest $webRequest diff --git a/src/Javinizer/Public/Get-Jav321Data.ps1 b/src/Javinizer/Public/Get-Jav321Data.ps1 index 902e7a69..8ef98bd2 100644 --- a/src/Javinizer/Public/Get-Jav321Data.ps1 +++ b/src/Javinizer/Public/Get-Jav321Data.ps1 @@ -14,7 +14,7 @@ function Get-Jav321Data { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$Url]" $webRequest = Invoke-RestMethod -Uri $Url -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" -Action 'Continue' } $movieDataObject = [PSCustomObject]@{ diff --git a/src/Javinizer/Public/Get-Jav321Url.ps1 b/src/Javinizer/Public/Get-Jav321Url.ps1 index 4ffb6867..d31c2198 100644 --- a/src/Javinizer/Public/Get-Jav321Url.ps1 +++ b/src/Javinizer/Public/Get-Jav321Url.ps1 @@ -14,7 +14,7 @@ function Get-Jav321Url { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -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-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" -Action 'Continue' } @@ -41,7 +41,7 @@ function Get-Jav321Url { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-RestMethod -Uri $result -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" -Action 'Continue' } $resultId = Get-Jav321Id -WebRequest $webRequest diff --git a/src/Javinizer/Public/Get-JavbusData.ps1 b/src/Javinizer/Public/Get-JavbusData.ps1 index 996a5828..ddd8db92 100644 --- a/src/Javinizer/Public/Get-JavbusData.ps1 +++ b/src/Javinizer/Public/Get-JavbusData.ps1 @@ -14,7 +14,7 @@ function Get-JavbusData { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$Url]" $webRequest = Invoke-RestMethod -Uri $Url -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" -Action 'Continue' } $movieDataObject = [PSCustomObject]@{ diff --git a/src/Javinizer/Public/Get-JavbusUrl.ps1 b/src/Javinizer/Public/Get-JavbusUrl.ps1 index 6d862928..61e2249d 100644 --- a/src/Javinizer/Public/Get-JavbusUrl.ps1 +++ b/src/Javinizer/Public/Get-JavbusUrl.ps1 @@ -52,7 +52,7 @@ function Get-JavbusUrl { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-RestMethod -Uri $result -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" -Action 'Continue' } $resultId = Get-JavbusId -WebRequest $webRequest if ($resultId -eq $Id) { diff --git a/src/Javinizer/Public/Get-JavlibraryData.ps1 b/src/Javinizer/Public/Get-JavlibraryData.ps1 index 31a07f89..bf459400 100644 --- a/src/Javinizer/Public/Get-JavlibraryData.ps1 +++ b/src/Javinizer/Public/Get-JavlibraryData.ps1 @@ -17,7 +17,7 @@ function Get-JavlibraryData { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$Url]" $webRequest = Invoke-WebRequest -Uri $Url -Method Get -WebSession $Session -UserAgent $Session.UserAgent -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" -Action 'Continue' } $movieDataObject = [PSCustomObject]@{ diff --git a/src/Javinizer/Public/Get-JavlibraryUrl.ps1 b/src/Javinizer/Public/Get-JavlibraryUrl.ps1 index 266e17d6..04cd27c3 100644 --- a/src/Javinizer/Public/Get-JavlibraryUrl.ps1 +++ b/src/Javinizer/Public/Get-JavlibraryUrl.ps1 @@ -22,7 +22,7 @@ function Get-JavlibraryUrl { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" -Action 'Continue' } # Check if the search uniquely matched a video page @@ -33,7 +33,7 @@ function Get-JavlibraryUrl { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchResultUrl]" $webRequest = Invoke-WebRequest -Uri $searchResultUrl -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchResultUrl]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchResultUrl]: $PSItem" -Action 'Continue' } $resultId = Get-JavlibraryId -WebRequest $webRequest @@ -62,7 +62,7 @@ function Get-JavlibraryUrl { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$directUrl]" $webRequest = Invoke-WebRequest -Uri $directUrl -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$directUrl]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$directUrl]: $PSItem" -Action 'Continue' } $resultId = Get-JavlibraryId -WebRequest $webRequest diff --git a/src/Javinizer/Public/Get-R18Data.ps1 b/src/Javinizer/Public/Get-R18Data.ps1 index c4a89376..28a67e65 100644 --- a/src/Javinizer/Public/Get-R18Data.ps1 +++ b/src/Javinizer/Public/Get-R18Data.ps1 @@ -22,7 +22,7 @@ function Get-R18Data { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$Url]" $webRequest = Invoke-WebRequest -Uri $Url -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" -Action 'Continue' } $movieDataObject = [PSCustomObject]@{ diff --git a/src/Javinizer/Public/Get-R18Url.ps1 b/src/Javinizer/Public/Get-R18Url.ps1 index 1e82b10e..a641ed11 100644 --- a/src/Javinizer/Public/Get-R18Url.ps1 +++ b/src/Javinizer/Public/Get-R18Url.ps1 @@ -36,7 +36,7 @@ function Get-R18Url { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" -Action 'Continue' } $retryCount = 3 @@ -56,7 +56,7 @@ function Get-R18Url { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-WebRequest -Uri $result -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" -Action 'Continue' } $resultId = Get-R18Id -WebRequest $webRequest @@ -82,7 +82,7 @@ function Get-R18Url { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" -Action 'Continue' } $retryCount = 5 @@ -99,7 +99,7 @@ function Get-R18Url { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-WebRequest -Uri $result -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" -Action 'Continue' } $resultId = Get-R18Id -WebRequest $webRequest From 8e87fa8fe8cd261c4050a792aa5344f18424d6a6 Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Tue, 22 Sep 2020 16:37:05 +0900 Subject: [PATCH 17/36] Fixed an update bug for multipart files --- src/Javinizer/Private/Convert-JVTitle.ps1 | 93 ++++----------------- src/Tests/Unit/Javinizer-Function.Tests.ps1 | 47 +++++++++-- 2 files changed, 59 insertions(+), 81 deletions(-) diff --git a/src/Javinizer/Private/Convert-JVTitle.ps1 b/src/Javinizer/Private/Convert-JVTitle.ps1 index 21c31ef4..af628c52 100644 --- a/src/Javinizer/Private/Convert-JVTitle.ps1 +++ b/src/Javinizer/Private/Convert-JVTitle.ps1 @@ -145,6 +145,7 @@ function Convert-JVTitle { # Write modified filename to $fileBaseNameHyphen, inserting a '-' at the specified # index between the alphabetical and numerical character, and appending extension $fileBaseNameHyphen = ($file.Insert($x + 1, '-')) + break } } # Get index if file changed @@ -161,34 +162,17 @@ function Convert-JVTitle { # Clean any trailing text if not removed by $RemoveStrings for ($x = 0; $x -lt $fileBaseNameUpper.Length; $x++) { $filePartNumber = $null - #Match ID-###A, ID###B, etc. - if ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?[a-dA-D]") { - $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" - $fileBaseNameUpperCleaned += $fileP1 + $fileP2 - if ($fileP3 -eq 'A') { $filePartNumber = '1' } - elseif ($fileP3 -eq 'B') { $filePartNumber = '2' } - elseif ($fileP3 -eq 'C') { $filePartNumber = '3' } - elseif ($fileP3 -eq 'D') { $filePartNumber = '4' } - #elseif ($fileP3 -eq 'E') { $filePartNumber = '5' } - #elseif ($fileP3 -eq 'F') { $filePartNumber = '6' } - #elseif ($fileP3 -eq 'G') { $filePartNumber = '7' } - #elseif ($fileP3 -eq 'H') { $filePartNumber = '8' } - #elseif ($fileP3 -eq 'I') { $filePartNumber = '9' } - } + # Match ID-###A, ID###B, etc. # Match ID-###-A, ID-###-B, etc. - elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?[-][a-dA-D]") { + # Match ID-### - A, ID-### - B, etc. + if ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?\s?[-]?\s?[A-Z]$") { $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" - $fileBaseNameUpperCleaned += $fileP1 + $fileP2 - $fileP3 = $fileP3 -replace '-', '' - if ($fileP3 -eq 'A') { $filePartNumber = '1' } - elseif ($fileP3 -eq 'B') { $filePartNumber = '2' } - elseif ($fileP3 -eq 'C') { $filePartNumber = '3' } - elseif ($fileP3 -eq 'D') { $filePartNumber = '4' } - #elseif ($fileP3 -eq 'E') { $filePartNumber = '5' } - #elseif ($fileP3 -eq 'F') { $filePartNumber = '6' } - #elseif ($fileP3 -eq 'G') { $filePartNumber = '7' } - #elseif ($fileP3 -eq 'H') { $filePartNumber = '8' } - #elseif ($fileP3 -eq 'I') { $filePartNumber = '9' } + $fileBaseNameUpperCleaned += $fileP1 + "-" + (($fileP2 -replace '-', '') -replace '^0{1,5}', '').PadLeft(3, '0') + $fileP3 = ($fileP3 -replace '-', '').Trim() + $asciiP3 = [int][char]$fileP3 + if ($asciiP3 -gt 64 -and $asciiP3 -lt 91) { + $filePartNumber = $asciiP3 - 64 + } } <# #Match ID-###-A, ID-###-B, etc. @@ -199,60 +183,19 @@ function Convert-JVTitle { } #> # Match ID-###-1, ID-###-2, etc. - elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?[-]\d$") { - $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" - $fileBaseNameUpperCleaned += $fileP1 + $fileP2 - $filePartNum = ($fileP3 -replace '-', '')[1] - $filePartNumber = $filePartNum - } # Match ID-###-01, ID-###-02, etc. - elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?[-]0\d$") { - $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" - $fileBaseNameUpperCleaned += $fileP1 + $fileP2 - $filePartNum = (($fileP3 -replace '-', '') -replace '0', '')[1] - $filePartNumber = $filePartNum - } # Match ID-###-001, ID-###-002, etc. - elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?[-]00\d$") { - $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" - $fileBaseNameUpperCleaned += $fileP1 + $fileP2 - $filePartNum = (($fileP3 -replace '-', '') -replace '0', '')[1] - $filePartNumber = $filePartNum - } - # Match ID-### - pt1, ID-### - pt2, etc. - elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E? [-] pt|PT") { - $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" - $fileBaseNameUpperCleaned += $fileP1 + $fileP2 - $filePartNum = ((($fileP3 -replace '-', '') -replace '0', '') -replace 'pt', '')[1] - $filePartNumber = $filePartNum - } - # Match ID-### - part1, ID ### - part2, etc. - elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E? [-] part|PART") { - $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" - $fileBaseNameUpperCleaned += $fileP1 + $fileP2 - $filePartNum = ((($fileP3 -replace '-', '') -replace '0', '') -replace 'pt', '')[1] - $filePartNumber = $filePartNum - } # Match ID-###-pt1, ID-###-pt2, etc. - elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?[-]pt|PT") { - $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" - $fileBaseNameUpperCleaned += $fileP1 + $fileP2 - $filePartNum = ((($fileP3 -replace '-', '') -replace '0', '') -replace 'pt', '')[1] - $filePartNumber = $filePartNum - } + # Match ID-### - pt1, ID-### - pt2, etc. # Match ID-###-part1, ID-###-part2, etc. - elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?[-]part|PART") { - $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" - $fileBaseNameUpperCleaned += $fileP1 + $fileP2 - $filePartNum = ((($fileP3 -replace '-', '') -replace '0', '') -replace 'pt', '')[1] - $filePartNumber = $filePartNum - } + # Match ID-### - part1, ID ### - part2, etc. # Match ID-###-cd1, ID-###-cd2, etc. - elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?[-]cd|CD") { - $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" - $fileBaseNameUpperCleaned += $fileP1 + $fileP2 - $filePartNum = ((($fileP3 -replace '-', '') -replace '0', '') -replace 'cd', '')[1] - $filePartNumber = $filePartNum + # Match ID-### - cd1, ID-### - cd2, etc. + elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?\s?[-]\s?(cd|part|pt)?[-]?\d{1,3}") { + $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?\s?[-])" + $fileBaseNameUpperCleaned += $fileP1 + "-" + ($fileP2 -replace '-', '').Trim() + $filePartNum = ((($fileP3 -replace '-', '') -replace '^0{1,5}', '') -replace '(cd|part|pt)', '').Trim() + $filePartNumber = [int]$filePartNum } # Match everything else diff --git a/src/Tests/Unit/Javinizer-Function.Tests.ps1 b/src/Tests/Unit/Javinizer-Function.Tests.ps1 index d3063922..7b19f357 100644 --- a/src/Tests/Unit/Javinizer-Function.Tests.ps1 +++ b/src/Tests/Unit/Javinizer-Function.Tests.ps1 @@ -19,13 +19,48 @@ InModuleScope 'Javinizer' { $WarningPreference = "SilentlyContinue" #------------------------------------------------------------------------- Describe 'Javinizer Private Function Tests' -Tag Unit { - Context 'FunctionName' { - <# - It 'should ...' { + Context 'Convert-JVTitle' { + It 'Should convert multipart ID-### accordingly' { + $fileNames = @( + "bbi-094a.wmv", + "bbi-094-b.wmv", + "bbi-094 - c.wmv", + "bbi-094-4.wmv", + "bbi-094 - 5.wmv", + "bbi-094-06.wmv", + "bbi-094-007.wmv", + "bbi-094 - 008.wmv", + "bbi-094-pt9.wmv", + "bbi-094 - pt10.wmv", + "bbi-094-part11.wmv", + "bbi-094 - part12.wmv", + "bbi-094-cd13.wmv", + "bbi-094 - cd14.wmv", + "bbi00094o.wmv", + "bbi00094-p.wmv", + "bbi00094 - q.wmv" + ) + + Mock Get-ChildItem { + $files = @() + foreach($file in $fileNames) { + $file = [PSCustomObject]@{ + Name = $file + BaseName = $file.Substring(0, $file.Length - 4) + } + $files += $file + } + return $files + } + + $files = Get-ChildItem + $results = Convert-JVTitle $files + $results.ContentId | Should -Be (,"BBI00094" * $fileNames.Length) + $results.Id | Should -Be (,"BBI-094" * $fileNames.Length) + $results.PartNumber | Should -Be (1..$fileNames.Length) + } + } - }#it - #> - }#context_FunctionName }#describe_PrivateFunctions Describe 'Javinizer Public Function Tests' -Tag Unit { Context 'FunctionName' { From 51c5d569029d60fb33050a42d54add100c8c19db Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Wed, 23 Sep 2020 07:23:43 +0900 Subject: [PATCH 18/36] Added more use cases --- src/Javinizer/Private/Convert-JVTitle.ps1 | 7 ++++++- src/Tests/Unit/Javinizer-Function.Tests.ps1 | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Javinizer/Private/Convert-JVTitle.ps1 b/src/Javinizer/Private/Convert-JVTitle.ps1 index af628c52..1e62421b 100644 --- a/src/Javinizer/Private/Convert-JVTitle.ps1 +++ b/src/Javinizer/Private/Convert-JVTitle.ps1 @@ -81,6 +81,11 @@ function Convert-JVTitle { try { $id = ($file | Select-String $RegexString).Matches.Groups[$RegexIdMatch].Value $partNum = ($file | Select-String $RegexString).Matches.Groups[$RegexPtMatch].Value + + # If ID#### and there's no hypen, subsequent searches will fail + if($id -match '^([a-z]+)(\d+)$') { + $id = $Matches[1] + "-" + ($Matches[2] -replace '^0{1,5}', '').PadLeft(3, '0') + } } catch { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "File [$file] not matched by regex" break @@ -193,7 +198,7 @@ function Convert-JVTitle { # Match ID-### - cd1, ID-### - cd2, etc. elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?\s?[-]\s?(cd|part|pt)?[-]?\d{1,3}") { $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?\s?[-])" - $fileBaseNameUpperCleaned += $fileP1 + "-" + ($fileP2 -replace '-', '').Trim() + $fileBaseNameUpperCleaned += $fileP1 + "-" + (($fileP2 -replace '-', '') -replace '0{1,5}', '').Trim().PadLeft(3, '0') $filePartNum = ((($fileP3 -replace '-', '') -replace '^0{1,5}', '') -replace '(cd|part|pt)', '').Trim() $filePartNumber = [int]$filePartNum } diff --git a/src/Tests/Unit/Javinizer-Function.Tests.ps1 b/src/Tests/Unit/Javinizer-Function.Tests.ps1 index 7b19f357..d1a89639 100644 --- a/src/Tests/Unit/Javinizer-Function.Tests.ps1 +++ b/src/Tests/Unit/Javinizer-Function.Tests.ps1 @@ -38,7 +38,11 @@ InModuleScope 'Javinizer' { "bbi-094 - cd14.wmv", "bbi00094o.wmv", "bbi00094-p.wmv", - "bbi00094 - q.wmv" + "bbi00094 - q.wmv", + "bbi00094-pt18.wmv", + "bbi00094 - pt19.wmv", + "bbi00094-cd20.wmv", + "bbi00094 - cd21.wmv" ) Mock Get-ChildItem { @@ -54,7 +58,7 @@ InModuleScope 'Javinizer' { } $files = Get-ChildItem - $results = Convert-JVTitle $files + $results = Convert-JVTitle $files -RegexEnabled $false $results.ContentId | Should -Be (,"BBI00094" * $fileNames.Length) $results.Id | Should -Be (,"BBI-094" * $fileNames.Length) $results.PartNumber | Should -Be (1..$fileNames.Length) From 97d744b12487a789d003f4d3ee38c312b952c651 Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Thu, 24 Sep 2020 18:35:43 +0900 Subject: [PATCH 19/36] Regressed part support to A-D only --- src/Javinizer/Private/Convert-JVTitle.ps1 | 16 +-- src/Tests/Unit/Javinizer-Function.Tests.ps1 | 115 +++++++++++++++----- 2 files changed, 95 insertions(+), 36 deletions(-) diff --git a/src/Javinizer/Private/Convert-JVTitle.ps1 b/src/Javinizer/Private/Convert-JVTitle.ps1 index 1e62421b..19ebfb1d 100644 --- a/src/Javinizer/Private/Convert-JVTitle.ps1 +++ b/src/Javinizer/Private/Convert-JVTitle.ps1 @@ -92,7 +92,7 @@ function Convert-JVTitle { } if ($fileBaseNameUpper -eq 1) { if ($partNum -ne '') { - $fileBaseNameUpper = "$id-pt$PartNum" + $fileBaseNameUpper = "$id-PT$PartNum" } elseif ($id -ne '') { $fileBaseNameUpper = "$id" } else { @@ -100,7 +100,7 @@ function Convert-JVTitle { } } else { if ($partNum -ne '') { - $fileBaseNameUpper[$index] = "$id-pt$PartNum" + $fileBaseNameUpper[$index] = "$id-PT$PartNum" } elseif ($id -ne '') { $fileBaseNameUpper[$index] = "$id" } else { @@ -170,12 +170,12 @@ function Convert-JVTitle { # Match ID-###A, ID###B, etc. # Match ID-###-A, ID-###-B, etc. # Match ID-### - A, ID-### - B, etc. - if ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?\s?[-]?\s?[A-Z]$") { + if ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?R?\s?[-]?\s?[A-D]$") { $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?)" $fileBaseNameUpperCleaned += $fileP1 + "-" + (($fileP2 -replace '-', '') -replace '^0{1,5}', '').PadLeft(3, '0') $fileP3 = ($fileP3 -replace '-', '').Trim() $asciiP3 = [int][char]$fileP3 - if ($asciiP3 -gt 64 -and $asciiP3 -lt 91) { + if ($asciiP3 -gt 64 -and $asciiP3 -lt 69) { $filePartNumber = $asciiP3 - 64 } } @@ -196,17 +196,17 @@ function Convert-JVTitle { # Match ID-### - part1, ID ### - part2, etc. # Match ID-###-cd1, ID-###-cd2, etc. # Match ID-### - cd1, ID-### - cd2, etc. - elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?\s?[-]\s?(cd|part|pt)?[-]?\d{1,3}") { + elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}Z?E?R?\s?[-]\s?(cd|part|pt)?[-]?\d{1,3}") { $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6}Z?E?\s?[-])" - $fileBaseNameUpperCleaned += $fileP1 + "-" + (($fileP2 -replace '-', '') -replace '0{1,5}', '').Trim().PadLeft(3, '0') - $filePartNum = ((($fileP3 -replace '-', '') -replace '^0{1,5}', '') -replace '(cd|part|pt)', '').Trim() + $fileBaseNameUpperCleaned += $fileP1 + "-" + (($fileP2 -replace '-', '') -replace '^0{1,5}', '').Trim().PadLeft(3, '0') + $filePartNum = ((($fileP3.Trim() -replace '-', '') -replace '^0{1,5}', '') -replace '(cd|part|pt)', '') $filePartNumber = [int]$filePartNum } # Match everything else else { $fileP1, $fileP2, $fileP3 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6})" - if ($fileP3 -match '^Z' -or $fileP3 -match '^E') { + if ($fileP3 -match '^[ZER]') { $fileBaseNameUpperCleaned += $fileP1 + $fileP2 + $fileP3 } else { $fileBaseNameUpperCleaned += $fileP1 + $fileP2 diff --git a/src/Tests/Unit/Javinizer-Function.Tests.ps1 b/src/Tests/Unit/Javinizer-Function.Tests.ps1 index d1a89639..43e7982f 100644 --- a/src/Tests/Unit/Javinizer-Function.Tests.ps1 +++ b/src/Tests/Unit/Javinizer-Function.Tests.ps1 @@ -20,48 +20,107 @@ InModuleScope 'Javinizer' { #------------------------------------------------------------------------- Describe 'Javinizer Private Function Tests' -Tag Unit { Context 'Convert-JVTitle' { + It 'Should convert multipart ID-### accordingly' { $fileNames = @( "bbi-094a.wmv", "bbi-094-b.wmv", "bbi-094 - c.wmv", "bbi-094-4.wmv", - "bbi-094 - 5.wmv", - "bbi-094-06.wmv", - "bbi-094-007.wmv", - "bbi-094 - 008.wmv", - "bbi-094-pt9.wmv", - "bbi-094 - pt10.wmv", - "bbi-094-part11.wmv", - "bbi-094 - part12.wmv", - "bbi-094-cd13.wmv", - "bbi-094 - cd14.wmv", - "bbi00094o.wmv", - "bbi00094-p.wmv", - "bbi00094 - q.wmv", - "bbi00094-pt18.wmv", - "bbi00094 - pt19.wmv", - "bbi00094-cd20.wmv", - "bbi00094 - cd21.wmv" + "bbi-094 - 1.wmv", + "bbi-094-02.wmv", + "bbi-094-003.wmv", + "bbi-094 - 004.wmv", + "bbi-094-pt1.wmv", + "bbi-094 - pt2.wmv", + "bbi-094-part3.wmv", + "bbi-094 - part4.wmv", + "bbi-094-cd1.wmv", + "bbi-094 - cd2.wmv", + "bbi00094c.wmv", + "bbi00094-d.wmv", + "bbi00094 - a.wmv", + "bbi00094-pt2.wmv", + "bbi00094 - pt3.wmv", + "bbi00094-cd4.wmv", + "bbi00094 - cd1.wmv" ) - Mock Get-ChildItem { - $files = @() - foreach($file in $fileNames) { - $file = [PSCustomObject]@{ - Name = $file - BaseName = $file.Substring(0, $file.Length - 4) - } - $files += $file + $files = @() + foreach($file in $FileNames) { + $file = [PSCustomObject]@{ + Name = $file + BaseName = $file.Substring(0, $file.Length - 4) } - return $files + $files += $file } - $files = Get-ChildItem $results = Convert-JVTitle $files -RegexEnabled $false $results.ContentId | Should -Be (,"BBI00094" * $fileNames.Length) $results.Id | Should -Be (,"BBI-094" * $fileNames.Length) - $results.PartNumber | Should -Be (1..$fileNames.Length) + $results.PartNumber | Should -Be ((1..4) * [Math]::Ceiling($fileNames.Length / 4))[0..($fileNames.Length - 1)] + } + + It 'Should work fine for ID ending in E, Z and R' { + $fileNames = @( + "ibw-230z.mp4", + "ktra-213e.mp4", + "gesd-093r.mp4" + ) + + $files = @() + foreach($file in $FileNames) { + $file = [PSCustomObject]@{ + Name = $file + BaseName = $file.Substring(0, $file.Length - 4) + } + $files += $file + } + + $results = Convert-JVTitle $files -RegexEnabled $false + $results.ContentId | Should -Be ("IBW00230Z", "KTRA00213E", "GESD00093R") + $results.Id | Should -Be ("IBW-230Z", "KTRA-213E", "GESD-093R") + $results.PartNumber | Should -Be (,$null * $fileNames.Length) + } + + It 'Should work fine for multipart ID ending in E, Z and R' { + $fileNames = @( + "ibw-230za.mp4", + "ibw-230z-b.mp4", + "ibw-230z - c.mp4", + "ibw-230z-4.mp4", + "ibw-230z - 1.mp4", + "ibw-230z-02.mp4", + "ibw-230z-003.mp4", + "ibw-230z - 004.mp4", + "ibw-230z-pt1.mp4", + "ibw-230z - pt2.mp4", + "ibw-230z-part3.mp4", + "ibw-230z - part4.mp4", + "ibw-230z-cd1.mp4", + "ibw-230z - cd2.mp4", + "ibw00230zc.mp4", + "ibw00230z-d.mp4", + "ibw00230z - a.mp4", + "ibw00230z-pt2.mp4", + "ibw00230z - pt3.mp4", + "ibw00230z-cd4.mp4", + "ibw00230z - cd1.mp4" + ) + + $files = @() + foreach($file in $FileNames) { + $file = [PSCustomObject]@{ + Name = $file + BaseName = $file.Substring(0, $file.Length - 4) + } + $files += $file + } + + $results = Convert-JVTitle $files -RegexEnabled $false + $results.ContentId | Should -Be (,"IBW00230Z" * $fileNames.Length) + $results.Id | Should -Be (,"IBW-230Z" * $fileNames.Length) + $results.PartNumber | Should -Be ((1..4) * [Math]::Ceiling($fileNames.Length / 4))[0..($fileNames.Length - 1)] } } From 36672b3aec71c8eb691898e616cc4a048e828975 Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Thu, 24 Sep 2020 18:46:00 +0900 Subject: [PATCH 20/36] Added additional tests --- src/Tests/Unit/Javinizer-Function.Tests.ps1 | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Tests/Unit/Javinizer-Function.Tests.ps1 b/src/Tests/Unit/Javinizer-Function.Tests.ps1 index 43e7982f..569a0229 100644 --- a/src/Tests/Unit/Javinizer-Function.Tests.ps1 +++ b/src/Tests/Unit/Javinizer-Function.Tests.ps1 @@ -122,6 +122,28 @@ InModuleScope 'Javinizer' { $results.Id | Should -Be (,"IBW-230Z" * $fileNames.Length) $results.PartNumber | Should -Be ((1..4) * [Math]::Ceiling($fileNames.Length / 4))[0..($fileNames.Length - 1)] } + + It 'Should fail for multiparts > D except Z, E, R. Numerics are OK.' { + $fileNames = @( + "bbi-094f.wmv", + "bbi-094 - g.mp4", + "bbi-094-pt5.mp4" + ) + + $files = @() + foreach($file in $FileNames) { + $file = [PSCustomObject]@{ + Name = $file + BaseName = $file.Substring(0, $file.Length - 4) + } + $files += $file + } + + $results = Convert-JVTitle $files -RegexEnabled $false + $results.ContentId | Should -Be (,"BBI00094" * $fileNames.Length) + $results.Id | Should -Be (,"BBI-094" * $fileNames.Length) + $results.PartNumber | Should -Be ($null, $null, 5) + } } }#describe_PrivateFunctions From b047f6c123cb7388c0735dda1cece19187814247 Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Fri, 25 Sep 2020 09:20:23 +0900 Subject: [PATCH 21/36] Moved file loop to a function --- src/Tests/Unit/Javinizer-Function.Tests.ps1 | 46 ++++++++------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/src/Tests/Unit/Javinizer-Function.Tests.ps1 b/src/Tests/Unit/Javinizer-Function.Tests.ps1 index 569a0229..b74175bd 100644 --- a/src/Tests/Unit/Javinizer-Function.Tests.ps1 +++ b/src/Tests/Unit/Javinizer-Function.Tests.ps1 @@ -19,8 +19,22 @@ InModuleScope 'Javinizer' { $WarningPreference = "SilentlyContinue" #------------------------------------------------------------------------- Describe 'Javinizer Private Function Tests' -Tag Unit { - Context 'Convert-JVTitle' { + BeforeAll { + function Get-Files ($fileNames) { + $files = @() + foreach($file in $FileNames) { + $file = [PSCustomObject]@{ + Name = $file + BaseName = $file.Substring(0, $file.Length - 4) + } + $files += $file + } + return $files + } + } + + Context 'Convert-JVTitle' { It 'Should convert multipart ID-### accordingly' { $fileNames = @( "bbi-094a.wmv", @@ -46,15 +60,7 @@ InModuleScope 'Javinizer' { "bbi00094 - cd1.wmv" ) - $files = @() - foreach($file in $FileNames) { - $file = [PSCustomObject]@{ - Name = $file - BaseName = $file.Substring(0, $file.Length - 4) - } - $files += $file - } - + $files = Get-Files $fileNames $results = Convert-JVTitle $files -RegexEnabled $false $results.ContentId | Should -Be (,"BBI00094" * $fileNames.Length) $results.Id | Should -Be (,"BBI-094" * $fileNames.Length) @@ -108,15 +114,7 @@ InModuleScope 'Javinizer' { "ibw00230z - cd1.mp4" ) - $files = @() - foreach($file in $FileNames) { - $file = [PSCustomObject]@{ - Name = $file - BaseName = $file.Substring(0, $file.Length - 4) - } - $files += $file - } - + $files = Get-Files $fileNames $results = Convert-JVTitle $files -RegexEnabled $false $results.ContentId | Should -Be (,"IBW00230Z" * $fileNames.Length) $results.Id | Should -Be (,"IBW-230Z" * $fileNames.Length) @@ -130,15 +128,7 @@ InModuleScope 'Javinizer' { "bbi-094-pt5.mp4" ) - $files = @() - foreach($file in $FileNames) { - $file = [PSCustomObject]@{ - Name = $file - BaseName = $file.Substring(0, $file.Length - 4) - } - $files += $file - } - + $files = Get-Files $fileNames $results = Convert-JVTitle $files -RegexEnabled $false $results.ContentId | Should -Be (,"BBI00094" * $fileNames.Length) $results.Id | Should -Be (,"BBI-094" * $fileNames.Length) From f8473e6e504d2c621653be96d64aa4dbc27e0b52 Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Fri, 25 Sep 2020 16:41:31 +0900 Subject: [PATCH 22/36] Fixed a bug when Url is specified on rename for DmmJa --- src/Javinizer/Public/Get-JVData.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Javinizer/Public/Get-JVData.ps1 b/src/Javinizer/Public/Get-JVData.ps1 index 3557ddb6..d76b6f93 100644 --- a/src/Javinizer/Public/Get-JVData.ps1 +++ b/src/Javinizer/Public/Get-JVData.ps1 @@ -59,6 +59,7 @@ function Get-JVData { [Boolean]$DmmScrapeActress, [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')] + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Url')] [Alias('location.uncensorcsv')] [System.IO.FileInfo]$UncensorCsvPath = (Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'jvUncensor.csv'), @@ -67,7 +68,7 @@ function Get-JVData { [PSObject]$Settings, [Parameter(ParameterSetName = 'Url')] - [PSObject]$Url + [Array]$Url ) process { @@ -221,11 +222,11 @@ function Get-JVData { } if ($DmmJa) { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] [Search - Dmm] [Url - $DmmUrl]" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] [Search - DmmJa] [Url - $DmmJaUrl]" Start-ThreadJob -Name "jvdata-Dmm" -ThrottleLimit $throttleLimit -ScriptBlock { Import-Module $using:jvModulePath - if ($using:DmmUrl) { - $using:DmmUrl | Get-DmmData -ScrapeActress:$using:DmmScrapeActress + if ($using:DmmJaUrl) { + $using:DmmJaUrl | Get-DmmData -ScrapeActress:$using:DmmScrapeActress } elseif ($using:jvDmmUrl) { $jvDmmUrl = $using:jvDmmUrl $jvDmmUrl.Ja | Get-DmmData -ScrapeActress:$using:DmmScrapeActress From 4014a0dc9091337705d583c60f0e175be673ba70 Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Fri, 25 Sep 2020 23:39:11 +0900 Subject: [PATCH 23/36] Fixed poster grabbing for DMM's amateur site --- src/Javinizer/Private/Scraper.Dmm.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Javinizer/Private/Scraper.Dmm.ps1 b/src/Javinizer/Private/Scraper.Dmm.ps1 index c853fa47..6c31759e 100644 --- a/src/Javinizer/Private/Scraper.Dmm.ps1 +++ b/src/Javinizer/Private/Scraper.Dmm.ps1 @@ -371,7 +371,7 @@ function Get-DmmCoverUrl { process { try { - $coverUrl = ($Webrequest.Content | Select-String -Pattern '(https:\/\/pics\.dmm\.co\.jp\/(mono\/movie\/adult|digital\/video)\/(.*)/(.*)\.jpg)').Matches.Groups[1].Value -replace 'ps.jpg', 'pl.jpg' + $coverUrl = ($Webrequest.Content | Select-String -Pattern '(https:\/\/pics\.dmm\.co\.jp\/(mono\/movie\/adult|digital\/(?:video|amateur))\/(.*)\/(.*)\.jpg)').Matches.Groups[1].Value -replace 'ps.jpg', 'pl.jpg' } catch { return } From d90438fe5af247fb6d2b27bba7fec98491fd228f Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Sat, 26 Sep 2020 09:17:53 -0700 Subject: [PATCH 24/36] Add updated VSCode settings --- .vscode/settings.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b2ab8eee..f87c4a29 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,17 @@ "files.insertFinalNewline": true, "editor.insertSpaces": true, "editor.tabSize": 4, - "powershell.codeFormatting.preset": "OTBS" + "powershell.codeFormatting.preset": "OTBS", + "powershell.codeFormatting.autoCorrectAliases": true, + "powershell.codeFormatting.useCorrectCasing": true, + "powershell.codeFormatting.trimWhitespaceAroundPipe": true, + "powershell.codeFormatting.ignoreOneLineBlock": true, + "powershell.codeFormatting.alignPropertyValuePairs": true, + "powershell.codeFormatting.addWhitespaceAroundPipe": true, + "powershell.codeFolding.showLastLine": true, + "powershell.codeFormatting.pipelineIndentationStyle": "NoIndentation", + "powershell.codeFormatting.whitespaceAfterSeparator": true, + "powershell.codeFormatting.whitespaceAroundOperator": true, + "powershell.codeFormatting.whitespaceBeforeOpenBrace": true, + "powershell.codeFormatting.whitespaceBeforeOpenParen": true } From 6fa2ccb94e6e5d7c162733db7dc3eb5c4b60fb04 Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Sat, 26 Sep 2020 17:38:40 +0900 Subject: [PATCH 25/36] Convert DMM's ContentID to standard ID --- src/Javinizer/Private/Scraper.Dmm.ps1 | 22 ++++++++++++++++++++++ src/Javinizer/Public/Get-DmmData.ps1 | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Javinizer/Private/Scraper.Dmm.ps1 b/src/Javinizer/Private/Scraper.Dmm.ps1 index 6c31759e..4af18ad4 100644 --- a/src/Javinizer/Private/Scraper.Dmm.ps1 +++ b/src/Javinizer/Private/Scraper.Dmm.ps1 @@ -14,6 +14,28 @@ function Get-DmmContentId { } } +function Get-DmmId { + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [Object]$Webrequest + ) + + process { + try { + # Expects ###ID##### or ID##### + $contentId = Get-DmmContentId $Webrequest + $Id = $contentId + $m = ($contentId | Select-String -Pattern '\d*([a-z]+)(\d+)$' -AllMatches).Matches + if($m.Groups.Count -gt 2 -and $m.Groups[1] -and $m.Groups[2]) { + $Id = $m.Groups[1].Value.ToUpper() + "-" + ($m.Groups[2].Value -replace '^0{1,5}', '').PadLeft(3, '0') + } + } catch { + return + } + Write-Output $Id + } +} + function Get-DmmTitle { param ( [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] diff --git a/src/Javinizer/Public/Get-DmmData.ps1 b/src/Javinizer/Public/Get-DmmData.ps1 index 1ce71407..53ad44ff 100644 --- a/src/Javinizer/Public/Get-DmmData.ps1 +++ b/src/Javinizer/Public/Get-DmmData.ps1 @@ -44,7 +44,8 @@ function Get-DmmData { $movieDataObject = [PSCustomObject]@{ Source = if ($Url -match '/en/') { 'dmm' } else { 'dmmja' } Url = $Url - Id = Get-DmmContentId -WebRequest $webRequest + Id = Get-DmmId -WebRequest $webRequest + ContentId = Get-DmmContentId -WebRequest $webRequest Title = Get-DmmTitle -WebRequest $webRequest Description = Get-DmmDescription -WebRequest $webRequest ReleaseDate = Get-DmmReleaseDate -WebRequest $webRequest From 7b22c4419c76b4fc9f8ea4fe31b1c82c4a523739 Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Sun, 27 Sep 2020 14:03:14 +0900 Subject: [PATCH 26/36] Fixed regex for ID with suffix --- src/Javinizer/Private/Scraper.Dmm.ps1 | 5 +++-- src/Javinizer/Public/Get-DmmData.ps1 | 13 +++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Javinizer/Private/Scraper.Dmm.ps1 b/src/Javinizer/Private/Scraper.Dmm.ps1 index 4af18ad4..2dc8e113 100644 --- a/src/Javinizer/Private/Scraper.Dmm.ps1 +++ b/src/Javinizer/Private/Scraper.Dmm.ps1 @@ -25,9 +25,10 @@ function Get-DmmId { # Expects ###ID##### or ID##### $contentId = Get-DmmContentId $Webrequest $Id = $contentId - $m = ($contentId | Select-String -Pattern '\d*([a-z]+)(\d+)$' -AllMatches).Matches + $m = ($contentId | Select-String -Pattern '\d*([a-z]+)(\d+)(.*)$' -AllMatches).Matches + if($m.Groups.Count -gt 2 -and $m.Groups[1] -and $m.Groups[2]) { - $Id = $m.Groups[1].Value.ToUpper() + "-" + ($m.Groups[2].Value -replace '^0{1,5}', '').PadLeft(3, '0') + $Id = $m.Groups[1].Value.ToUpper() + "-" + ($m.Groups[2].Value -replace '^0{1,5}', '').PadLeft(3, '0') + $m.Groups[3].Value.ToUpper() } } catch { return diff --git a/src/Javinizer/Public/Get-DmmData.ps1 b/src/Javinizer/Public/Get-DmmData.ps1 index 53ad44ff..1ce5288d 100644 --- a/src/Javinizer/Public/Get-DmmData.ps1 +++ b/src/Javinizer/Public/Get-DmmData.ps1 @@ -12,8 +12,14 @@ function Get-DmmData { process { $movieDataObject = @() + $session = New-Object Microsoft.PowerShell.Commands.WebRequestSession + $cookie = New-Object System.Net.Cookie + $cookie.Name = 'age_check_done' + $cookie.Value = '1' + $cookie.Domain = 'dmm.co.jp' + $session.Cookies.Add($cookie) + if ($Url -match '/en/') { - $session = New-Object Microsoft.PowerShell.Commands.WebRequestSession $cookie = New-Object System.Net.Cookie $cookie.Name = 'ckcy' $cookie.Value = '2' @@ -24,11 +30,6 @@ function Get-DmmData { $cookie.Value = 'en' $cookie.Domain = 'dmm.co.jp' $session.Cookies.Add($cookie) - $cookie = New-Object System.Net.Cookie - $cookie.Name = 'age_check_done' - $cookie.Value = '1' - $cookie.Domain = 'dmm.co.jp' - $session.Cookies.Add($cookie) } try { From 7d90fbb552d6e3bfbb6b24dd0cac17eaed725222 Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Sun, 27 Sep 2020 14:12:42 +0900 Subject: [PATCH 27/36] Fixed bug for dmm-ja not extracting maker and label --- src/Javinizer/Private/Scraper.Dmm.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Javinizer/Private/Scraper.Dmm.ps1 b/src/Javinizer/Private/Scraper.Dmm.ps1 index 2dc8e113..a4e84a08 100644 --- a/src/Javinizer/Private/Scraper.Dmm.ps1 +++ b/src/Javinizer/Private/Scraper.Dmm.ps1 @@ -147,7 +147,7 @@ function Get-DmmMaker { process { try { - $maker = ($Webrequest.Content | Select-String -Pattern '<a href="(\/digital\/videoa\/|\/en\/mono\/dvd\/)-\/list\/=\/article=maker\/id=\d*\/">(.*)<\/a>').Matches.Groups[2].Value + $maker = ($Webrequest.Content | Select-String -Pattern '<a href="(\/digital\/videoa\/|(?:\/en)?\/mono\/dvd\/)-\/list\/=\/article=maker\/id=\d*\/">(.*)<\/a>').Matches.Groups[2].Value } catch { return } @@ -163,7 +163,7 @@ function Get-DmmLabel { process { try { - $label = ($Webrequest.Content | Select-String -Pattern '<a href="(\/digital\/videoa\/|\/en\/mono\/dvd\/)-\/list\/=\/article=label\/id=\d*\/">(.*)<\/a>').Matches.Groups[2].Value + $label = ($Webrequest.Content | Select-String -Pattern '<a href="(\/digital\/videoa\/|(?:\/en)?\/mono\/dvd\/)-\/list\/=\/article=label\/id=\d*\/">(.*)<\/a>').Matches.Groups[2].Value } catch { return } @@ -179,7 +179,7 @@ function Get-DmmSeries { process { try { - $series = ($Webrequest.Content | Select-String -Pattern '<a href="(\/digital\/videoa\/|\/en\/mono\/dvd\/)-\/list\/=\/article=series\/id=\d*\/">(.*)<\/a><\/td>').Matches.Groups[2].Value + $series = ($Webrequest.Content | Select-String -Pattern '<a href="(\/digital\/videoa\/|(?:\/en)?\/mono\/dvd\/)-\/list\/=\/article=series\/id=\d*\/">(.*)<\/a><\/td>').Matches.Groups[2].Value } catch { return } From 9e2d7e55bae0a7465447ce4e56252064fae49efe Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Sun, 27 Sep 2020 16:57:53 +0900 Subject: [PATCH 28/36] Added ContentId tag to aggregateData --- src/Javinizer/Private/Convert-JVString.ps1 | 1 + src/Javinizer/Private/Scraper.Dmm.ps1 | 1 - src/Javinizer/Public/Get-DmmData.ps1 | 7 +++-- src/Javinizer/Public/Get-JVAggregatedData.ps1 | 9 +++++- src/Javinizer/Public/Get-JVData.ps1 | 28 +++++++++++++------ src/Javinizer/Public/Get-R18Data.ps1 | 7 +++-- src/Javinizer/jvSettings.json | 3 ++ 7 files changed, 41 insertions(+), 15 deletions(-) diff --git a/src/Javinizer/Private/Convert-JVString.ps1 b/src/Javinizer/Private/Convert-JVString.ps1 index 905b7d75..2c9103ec 100644 --- a/src/Javinizer/Private/Convert-JVString.ps1 +++ b/src/Javinizer/Private/Convert-JVString.ps1 @@ -90,6 +90,7 @@ function Convert-JVString { $actresses = ($actressObject | Sort-Object) -join $Delimiter $convertedName = $FormatString ` -replace '<ID>', "$($Data.Id)" ` + -replace '<CONTENTID>', "$($Data.ContentId)" ` -replace '<TITLE>', "$($Data.Title)" ` -replace '<RELEASEDATE>', "$($Data.ReleaseDate)" ` -replace '<YEAR>', "$(($Data.ReleaseDate -split '-')[0])" ` diff --git a/src/Javinizer/Private/Scraper.Dmm.ps1 b/src/Javinizer/Private/Scraper.Dmm.ps1 index a4e84a08..8d72fe1d 100644 --- a/src/Javinizer/Private/Scraper.Dmm.ps1 +++ b/src/Javinizer/Private/Scraper.Dmm.ps1 @@ -24,7 +24,6 @@ function Get-DmmId { try { # Expects ###ID##### or ID##### $contentId = Get-DmmContentId $Webrequest - $Id = $contentId $m = ($contentId | Select-String -Pattern '\d*([a-z]+)(\d+)(.*)$' -AllMatches).Matches if($m.Groups.Count -gt 2 -and $m.Groups[1] -and $m.Groups[2]) { diff --git a/src/Javinizer/Public/Get-DmmData.ps1 b/src/Javinizer/Public/Get-DmmData.ps1 index 1ce5288d..413b1d80 100644 --- a/src/Javinizer/Public/Get-DmmData.ps1 +++ b/src/Javinizer/Public/Get-DmmData.ps1 @@ -7,7 +7,10 @@ function Get-DmmData { [String]$Url, [Parameter()] - [Boolean]$ScrapeActress + [Boolean]$ScrapeActress, + + [Parameter()] + [String]$IdPreference = "id" ) process { @@ -45,7 +48,7 @@ function Get-DmmData { $movieDataObject = [PSCustomObject]@{ Source = if ($Url -match '/en/') { 'dmm' } else { 'dmmja' } Url = $Url - Id = Get-DmmId -WebRequest $webRequest + Id = if ($IdPreference -eq "id") { Get-DmmId -WebRequest $webRequest } elseif ($IdPreference -eq "contentid") { Get-DmmContentId -WebRequest $webRequest } ContentId = Get-DmmContentId -WebRequest $webRequest Title = Get-DmmTitle -WebRequest $webRequest Description = Get-DmmDescription -WebRequest $webRequest diff --git a/src/Javinizer/Public/Get-JVAggregatedData.ps1 b/src/Javinizer/Public/Get-JVAggregatedData.ps1 index 34b813be..6fbd37e2 100644 --- a/src/Javinizer/Public/Get-JVAggregatedData.ps1 +++ b/src/Javinizer/Public/Get-JVAggregatedData.ps1 @@ -37,6 +37,10 @@ function Get-JVAggregatedData { [Alias('sort.metadata.priority.id')] [Array]$IdPriority, + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] + [Alias('sort.metadata.priority.contentid')] + [Array]$ContentIdPriority, + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] [Alias('sort.metadata.priority.label')] [Array]$LabelPriority, @@ -151,6 +155,7 @@ function Get-JVAggregatedData { $DirectorPriority = $Settings.'sort.metadata.priority.director' $GenrePriority = $Settings.'sort.metadata.priority.genre' $IdPriority = $Settings.'sort.metadata.priority.id' + $ContentIdPriority = $Settings.'sort.metadata.priority.contentid' $LabelPriority = $Settings.'sort.metadata.priority.label' $MakerPriority = $Settings.'sort.metadata.priority.maker' $RatingPriority = $Settings.'sort.metadata.priority.rating' @@ -184,6 +189,7 @@ function Get-JVAggregatedData { $aggregatedDataObject = [PSCustomObject]@{ Id = $null + ContentId = $null DisplayName = $null Title = $null AlternateTitle = $null @@ -220,7 +226,8 @@ function Get-JVAggregatedData { 'Series', 'ScreenshotUrl', 'Title', - 'TrailerUrl' + 'TrailerUrl', + 'ContentId' ) foreach ($field in $metadataFields) { diff --git a/src/Javinizer/Public/Get-JVData.ps1 b/src/Javinizer/Public/Get-JVData.ps1 index d76b6f93..6010beb3 100644 --- a/src/Javinizer/Public/Get-JVData.ps1 +++ b/src/Javinizer/Public/Get-JVData.ps1 @@ -58,6 +58,14 @@ function Get-JVData { [Alias('scraper.movie.dmm.scrapeactress')] [Boolean]$DmmScrapeActress, + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')] + [Alias('scraper.movie.dmm.idpreference')] + [String]$DmmIdPreference, + + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')] + [Alias('scraper.movie.dmm.r18preference')] + [String]$R18IdPreference, + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')] [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Url')] [Alias('location.uncensorcsv')] @@ -68,7 +76,7 @@ function Get-JVData { [PSObject]$Settings, [Parameter(ParameterSetName = 'Url')] - [Array]$Url + [PSObject]$Url ) process { @@ -96,6 +104,8 @@ function Get-JVData { $JavbusJa = $Settings.'scraper.movie.javbusja' $JavbusZh = $Settings.'scraper.movie.javbuszh' $DmmScrapeActress = $Settings.'scraper.option.dmm.scrapeactress' + $DmmIdPreference = $Settings.'scraper.option.dmm.idpreference' + $R18IdPreference = $Settings.'scraper.option.r18.idpreference' if ($Settings.'location.uncensorcsv' -ne '') { $UncensorCsvPath = $Settings.'location.uncensorcsv' } @@ -128,11 +138,11 @@ function Get-JVData { Start-ThreadJob -Name "jvdata-R18" -ThrottleLimit $throttleLimit -ScriptBlock { Import-Module $using:jvModulePath if ($using:R18Url) { - $using:R18Url | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath + $using:R18Url | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath -IdPreference:$using:R18IdPreference } elseif ($using:jvR18Url) { $jvR18Url = $using:jvR18Url if ($jvR18Url) { - $jvR18Url.En | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath + $jvR18Url.En | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath -IdPreference:$using:R18IdPreference } } } | Out-Null @@ -143,11 +153,11 @@ function Get-JVData { Start-ThreadJob -Name "jvdata-R18Zh" -ThrottleLimit $throttleLimit -ScriptBlock { Import-Module $using:jvModulePath if ($using:R18ZhUrl) { - $using:R18ZhUrl | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath + $using:R18ZhUrl | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath -IdPreference:$using:R18IdPreference } elseif ($using:jvR18Url) { $jvR18Url = $using:jvR18Url if ($jvR18Url) { - $jvR18Url.Zh | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath + $jvR18Url.Zh | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath -IdPreference:$using:R18IdPreference } } } | Out-Null @@ -213,10 +223,10 @@ function Get-JVData { Start-ThreadJob -Name "jvdata-Dmm" -ThrottleLimit $throttleLimit -ScriptBlock { Import-Module $using:jvModulePath if ($using:DmmUrl) { - $using:DmmUrl | Get-DmmData -ScrapeActress:$using:DmmScrapeActress + $using:DmmUrl | Get-DmmData -ScrapeActress:$using:DmmScrapeActress -IdPreference:$using:DmmIdPreference } elseif ($using:jvDmmUrl) { $jvDmmUrl = $using:jvDmmUrl - $jvDmmUrl.En | Get-DmmData -ScrapeActress:$using:DmmScrapeActress + $jvDmmUrl.En | Get-DmmData -ScrapeActress:$using:DmmScrapeActress -IdPreference:$using:DmmIdPreference } } | Out-Null } @@ -226,10 +236,10 @@ function Get-JVData { Start-ThreadJob -Name "jvdata-Dmm" -ThrottleLimit $throttleLimit -ScriptBlock { Import-Module $using:jvModulePath if ($using:DmmJaUrl) { - $using:DmmJaUrl | Get-DmmData -ScrapeActress:$using:DmmScrapeActress + $using:DmmJaUrl | Get-DmmData -ScrapeActress:$using:DmmScrapeActress -IdPreference:$using:DmmIdPreference } elseif ($using:jvDmmUrl) { $jvDmmUrl = $using:jvDmmUrl - $jvDmmUrl.Ja | Get-DmmData -ScrapeActress:$using:DmmScrapeActress + $jvDmmUrl.Ja | Get-DmmData -ScrapeActress:$using:DmmScrapeActress -IdPreference:$using:DmmIdPreference } } | Out-Null } diff --git a/src/Javinizer/Public/Get-R18Data.ps1 b/src/Javinizer/Public/Get-R18Data.ps1 index 28a67e65..5b28fa21 100644 --- a/src/Javinizer/Public/Get-R18Data.ps1 +++ b/src/Javinizer/Public/Get-R18Data.ps1 @@ -7,7 +7,10 @@ function Get-R18Data { [String]$Url, [Parameter()] - [System.IO.FileInfo]$UncensorCsvPath = (Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'jvUncensor.csv') + [System.IO.FileInfo]$UncensorCsvPath = (Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'jvUncensor.csv'), + + [Parameter()] + [String]$IdPreference = "id" ) process { @@ -29,7 +32,7 @@ function Get-R18Data { Source = if ($Url -match 'lg=zh') { 'r18zh' } else { 'r18' } Url = $Url ContentId = Get-R18ContentId -WebRequest $webRequest - Id = Get-R18Id -WebRequest $webRequest + Id = if ($IdPreference -eq "id") { Get-R18Id -WebRequest $webRequest } elseif ($IdPreference -eq "contentid") { Get-R18ContentId -WebRequest $webRequest } Title = Get-R18Title -WebRequest $webRequest -Replace $replaceHashTable Description = Get-R18Description -WebRequest $webRequest ReleaseDate = Get-R18ReleaseDate -WebRequest $webRequest diff --git a/src/Javinizer/jvSettings.json b/src/Javinizer/jvSettings.json index 6798f704..5d867698 100644 --- a/src/Javinizer/jvSettings.json +++ b/src/Javinizer/jvSettings.json @@ -18,6 +18,8 @@ "scraper.movie.r18": 1, "scraper.movie.r18zh": 0, "scraper.option.dmm.scrapeactress": 0, + "scraper.option.dmm.idpreference": "id", + "scraper.option.r18.idpreference": "id", "match.minimumfilesize": 0, "match.includedfileextension": [ ".asf", @@ -76,6 +78,7 @@ "sort.metadata.priority.director": ["r18", "javlibrary"], "sort.metadata.priority.genre": ["r18", "javlibrary"], "sort.metadata.priority.id": ["r18", "javlibrary"], + "sort.metadata.priority.contentid": ["r18", "dmmja"], "sort.metadata.priority.label": ["r18", "javlibrary"], "sort.metadata.priority.maker": ["r18", "javlibrary"], "sort.metadata.priority.releasedate": ["r18", "javlibrary", "dmmja"], From 7cc646dedd9e94f8188a3eff1ac956f3deaaaa7e Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Sun, 27 Sep 2020 15:40:10 -0700 Subject: [PATCH 29/36] Add MediaInfo (#94) --- src/Javinizer/Private/Convert-JVString.ps1 | 3 ++- src/Javinizer/Public/Get-JVAggregatedData.ps1 | 12 ++++++++- src/Javinizer/Public/Get-JVMediaInfo.ps1 | 22 ++++++++++++++++ src/Javinizer/Public/Get-JVNfo.ps1 | 26 +++++++++++++++++++ src/Javinizer/Public/Javinizer.ps1 | 12 +++++++-- src/Javinizer/jvSettings.json | 1 + 6 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 src/Javinizer/Public/Get-JVMediaInfo.ps1 diff --git a/src/Javinizer/Private/Convert-JVString.ps1 b/src/Javinizer/Private/Convert-JVString.ps1 index 905b7d75..beea68d0 100644 --- a/src/Javinizer/Private/Convert-JVString.ps1 +++ b/src/Javinizer/Private/Convert-JVString.ps1 @@ -98,7 +98,8 @@ function Convert-JVString { -replace '<SET>', "$($Data.Series)" ` -replace '<LABEL>', "$($Data.Label)" ` -replace '<ACTORS>', "$actresses" ` - -replace '<ORIGINALTITLE>', "$($Data.AlternateTitle)" + -replace '<ORIGINALTITLE>', "$($Data.AlternateTitle)" ` + -replace '<RESOLUTION>', "$($Data.MediaInfo.VideoHeight)" foreach ($symbol in $invalidSymbols) { if ([regex]::Escape($symbol) -eq '/') { diff --git a/src/Javinizer/Public/Get-JVAggregatedData.ps1 b/src/Javinizer/Public/Get-JVAggregatedData.ps1 index 34b813be..66d69de0 100644 --- a/src/Javinizer/Public/Get-JVAggregatedData.ps1 +++ b/src/Javinizer/Public/Get-JVAggregatedData.ps1 @@ -139,7 +139,10 @@ function Get-JVAggregatedData { [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] [Alias('sort.metadata.nfo.format.tagline')] - [String]$Tagline + [String]$Tagline, + + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] + [PSObject]$MediaInfo ) process { @@ -202,6 +205,7 @@ function Get-JVAggregatedData { CoverUrl = $null ScreenshotUrl = $null TrailerUrl = $null + MediaInfo = $MediaInfo } $metadataFields = @( @@ -231,6 +235,12 @@ function Get-JVAggregatedData { if ($null -eq $aggregatedDataObject.$field) { if ($field -eq 'AlternateTitle') { $aggregatedDataObject.$field = $sourceData.Title + } elseif ($field -eq 'Id') { + if ($IdPreference -eq 'contentid') { + $aggregatedDataObject.$field = $sourceData.ContentId + } else { + $aggregatedDataObject.$field = $sourcedata.Id + } } else { $aggregatedDataObject.$field = $sourceData.$field } diff --git a/src/Javinizer/Public/Get-JVMediaInfo.ps1 b/src/Javinizer/Public/Get-JVMediaInfo.ps1 new file mode 100644 index 00000000..b5698d60 --- /dev/null +++ b/src/Javinizer/Public/Get-JVMediaInfo.ps1 @@ -0,0 +1,22 @@ +function Get-JVMediaInfo { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true, Position = 0)] + [System.IO.FileInfo]$Path + ) + + $fullMetadata = ((MediaInfo --Full $Path --Output=JSON) | ConvertFrom-Json).media.track + $videoMetadata = $fullMetaData | Where-Object { $_.'@type' -eq 'Video' }[0] + $audioMetadata = ($fullMetaData | Where-Object { $_.'@type' -eq 'Audio' })[0] + $metadata = [PSCustomObject]@{ + VideoCodec = $videoMetadata.CodecID + VideoAspect = $videoMetadata.DisplayAspectRatio_String + VideoWidth = $videoMetadata.Width + VideoHeight = $videoMetadata.Height + VideoDuration = [Math]::Round($videoMetadata.Duration) + AudioCodec = $audioMetadata.CodecID + AudioLanguage = $audioMetadata.Language + AudioChannels = $audioMetadata.Channels + } + Write-Output $metadata +} diff --git a/src/Javinizer/Public/Get-JVNfo.ps1 b/src/Javinizer/Public/Get-JVNfo.ps1 index fdab9100..166885f7 100644 --- a/src/Javinizer/Public/Get-JVNfo.ps1 +++ b/src/Javinizer/Public/Get-JVNfo.ps1 @@ -72,6 +72,9 @@ function Get-JVNfo { [Parameter(ValueFromPipelineByPropertyName = $true)] [String]$Tagline, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [PSObject]$MediaInfo, + [Parameter()] [Boolean]$ActressLanguageJa, @@ -187,6 +190,29 @@ function Get-JVNfo { $nfoString = $nfoString + $actressNfoString } + if ($MediaInfo) { + $mediaNfoString = @" + <fileinfo> + <streamdetails> + <video> + <codec>$($MediaInfo.VideoCodec)</codec> + <aspect>$($MediaInfo.VideoAspect)</aspect> + <width>$($MediaInfo.VideoWidth)</width> + <height>$($MediaInfo.VideoHeight)</height> + <durationinseconds>$($MediaInfo.VideoDuration)</durationinseconds> + </video> + <audio> + <codec>$($MediaInfo.AudioCodec)</codec> + <language>$($MediaInfo.AudioLanguage)</language> + <channels>$($MediaInfo.AudioChannels)</channels> + </audio> + </streamdetails> + </fileinfo> + +"@ + $nfoString = $nfoString + $mediaNfoString + } + $endNfoString = @" </movie> "@ diff --git a/src/Javinizer/Public/Javinizer.ps1 b/src/Javinizer/Public/Javinizer.ps1 index ca32cfd1..8a5c07b1 100644 --- a/src/Javinizer/Public/Javinizer.ps1 +++ b/src/Javinizer/Public/Javinizer.ps1 @@ -667,9 +667,13 @@ function Javinizer { return } + if ($Settings.'sort.metadata.nfo.mediainfo') { + $mediaInfo = Get-JVMediaInfo -Path $movie.FullName + } + $javData = Get-JVData -Url $Url -Settings $Settings -UncensorCsvPath $uncensorCsvPath if ($null -ne $javData) { - $javAggregatedData = $javData | Get-JVAggregatedData -Settings $Settings | Test-JVData -RequiredFields $Settings.'sort.metadata.requiredfield' + $javAggregatedData = $javData | Get-JVAggregatedData -Settings $Settings -MediaInfo $mediaInfo | Test-JVData -RequiredFields $Settings.'sort.metadata.requiredfield' if ($null -ne $javAggregatedData) { $javAggregatedData | Set-JVMovie -Path $javMovies.FullName -DestinationPath $DestinationPath -Settings $Settings -PartNumber $JavMovies.PartNumber -Force:$Force } @@ -691,9 +695,13 @@ function Javinizer { if ($PSboundParameters.ContainsKey('IsThread')) { foreach ($movie in $javMovies) { + if ($Settings.'sort.metadata.nfo.mediainfo') { + $mediaInfo = Get-JVMediaInfo -Path $movie.FullName + } + $javData = Get-JVData -Id $movie.Id -Settings $Settings -UncensorCsvPath $uncensorCsvPath if ($null -ne $javData) { - $javAggregatedData = $javData | Get-JVAggregatedData -Settings $Settings | Test-JVData -RequiredFields $Settings.'sort.metadata.requiredfield' + $javAggregatedData = $javData | Get-JVAggregatedData -Settings $Settings -MediaInfo $mediaInfo | Test-JVData -RequiredFields $Settings.'sort.metadata.requiredfield' if ($javAggregatedData.NullFields -eq '') { $javAggregatedData | Set-JVMovie -Path $movie.FullName -DestinationPath $DestinationPath -Settings $Settings -PartNumber $movie.Partnumber -Update:$Update -Force:$Force } else { diff --git a/src/Javinizer/jvSettings.json b/src/Javinizer/jvSettings.json index 6798f704..efcbc657 100644 --- a/src/Javinizer/jvSettings.json +++ b/src/Javinizer/jvSettings.json @@ -55,6 +55,7 @@ "sort.format.screenshotimg": "fanart", "sort.format.screenshotfolder": "extrafanart", "sort.format.actressimgfolder": ".actors", + "sort.metadata.nfo.mediainfo": 0, "sort.metadata.nfo.translatedescription": 0, "sort.metadata.nfo.translatedescription.language": "en", "sort.metadata.nfo.displayname": "[<ID>] <TITLE>", From e33b972cc9d57c9e0308310572b5e4ce6b2cb5b1 Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Sun, 27 Sep 2020 15:48:39 -0700 Subject: [PATCH 30/36] Add a default retry to Javlibrary URL requests (#109) --- src/Javinizer/Public/Get-JavlibraryUrl.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Javinizer/Public/Get-JavlibraryUrl.ps1 b/src/Javinizer/Public/Get-JavlibraryUrl.ps1 index 04cd27c3..51b8d00e 100644 --- a/src/Javinizer/Public/Get-JavlibraryUrl.ps1 +++ b/src/Javinizer/Public/Get-JavlibraryUrl.ps1 @@ -22,7 +22,13 @@ function Get-JavlibraryUrl { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" -Action 'Continue' + try { + # Add a retry to the URL search due to 500 errors occurring randomly when scraping Javlibrary + Start-Sleep -Seconds 3 + $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false + } catch { + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" -Action 'Continue' + } } # Check if the search uniquely matched a video page From 51a3dc712e355a2bb83ff4ce80f7a2acdf02296b Mon Sep 17 00:00:00 2001 From: Seeyabye <seeyabye91@gmail.com> Date: Mon, 28 Sep 2020 18:57:00 +0900 Subject: [PATCH 31/36] Modified Id Preference setting --- src/Javinizer/Public/Get-DmmData.ps1 | 7 ++--- src/Javinizer/Public/Get-JVAggregatedData.ps1 | 13 +++++++- src/Javinizer/Public/Get-JVData.ps1 | 30 +++++++------------ src/Javinizer/Public/Get-R18Data.ps1 | 7 ++--- src/Javinizer/jvSettings.json | 3 +- 5 files changed, 27 insertions(+), 33 deletions(-) diff --git a/src/Javinizer/Public/Get-DmmData.ps1 b/src/Javinizer/Public/Get-DmmData.ps1 index 413b1d80..1ce5288d 100644 --- a/src/Javinizer/Public/Get-DmmData.ps1 +++ b/src/Javinizer/Public/Get-DmmData.ps1 @@ -7,10 +7,7 @@ function Get-DmmData { [String]$Url, [Parameter()] - [Boolean]$ScrapeActress, - - [Parameter()] - [String]$IdPreference = "id" + [Boolean]$ScrapeActress ) process { @@ -48,7 +45,7 @@ function Get-DmmData { $movieDataObject = [PSCustomObject]@{ Source = if ($Url -match '/en/') { 'dmm' } else { 'dmmja' } Url = $Url - Id = if ($IdPreference -eq "id") { Get-DmmId -WebRequest $webRequest } elseif ($IdPreference -eq "contentid") { Get-DmmContentId -WebRequest $webRequest } + Id = Get-DmmId -WebRequest $webRequest ContentId = Get-DmmContentId -WebRequest $webRequest Title = Get-DmmTitle -WebRequest $webRequest Description = Get-DmmDescription -WebRequest $webRequest diff --git a/src/Javinizer/Public/Get-JVAggregatedData.ps1 b/src/Javinizer/Public/Get-JVAggregatedData.ps1 index 6fbd37e2..a03096a6 100644 --- a/src/Javinizer/Public/Get-JVAggregatedData.ps1 +++ b/src/Javinizer/Public/Get-JVAggregatedData.ps1 @@ -143,7 +143,11 @@ function Get-JVAggregatedData { [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] [Alias('sort.metadata.nfo.format.tagline')] - [String]$Tagline + [String]$Tagline, + + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')] + [Alias('scraper.option.idpreference')] + [String]$IdPreference ) process { @@ -179,6 +183,7 @@ function Get-JVAggregatedData { $UnknownActress = $Settings.'sort.metadata.nfo.unknownactress' $Tag = $Settings.'sort.metadata.nfo.format.tag' $Tagline = $Settings.'sort.metadata.nfo.format.tagline' + $IdPreference = $Settings.'scraper.option.idpreference' if ($Settings.'location.genrecsv' -ne '') { $GenreCsvPath = $Settings.'location.genrecsv' } @@ -238,6 +243,12 @@ function Get-JVAggregatedData { if ($null -eq $aggregatedDataObject.$field) { if ($field -eq 'AlternateTitle') { $aggregatedDataObject.$field = $sourceData.Title + } elseif ($field -eq 'Id') { + if ($IdPreference -eq 'contentid') { + $aggregatedDataObject.$field = $sourceData.ContentId + } else { + $aggregatedDataObject.$field = $sourceData.Id + } } else { $aggregatedDataObject.$field = $sourceData.$field } diff --git a/src/Javinizer/Public/Get-JVData.ps1 b/src/Javinizer/Public/Get-JVData.ps1 index 6010beb3..3ab3dbf6 100644 --- a/src/Javinizer/Public/Get-JVData.ps1 +++ b/src/Javinizer/Public/Get-JVData.ps1 @@ -55,17 +55,9 @@ function Get-JVData { [String]$JavlibraryBaseUrl = 'https://www.javlibrary.com', [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')] - [Alias('scraper.movie.dmm.scrapeactress')] + [Alias('scraper.option.dmm.scrapeactress')] [Boolean]$DmmScrapeActress, - [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')] - [Alias('scraper.movie.dmm.idpreference')] - [String]$DmmIdPreference, - - [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')] - [Alias('scraper.movie.dmm.r18preference')] - [String]$R18IdPreference, - [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')] [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Url')] [Alias('location.uncensorcsv')] @@ -104,8 +96,6 @@ function Get-JVData { $JavbusJa = $Settings.'scraper.movie.javbusja' $JavbusZh = $Settings.'scraper.movie.javbuszh' $DmmScrapeActress = $Settings.'scraper.option.dmm.scrapeactress' - $DmmIdPreference = $Settings.'scraper.option.dmm.idpreference' - $R18IdPreference = $Settings.'scraper.option.r18.idpreference' if ($Settings.'location.uncensorcsv' -ne '') { $UncensorCsvPath = $Settings.'location.uncensorcsv' } @@ -138,11 +128,11 @@ function Get-JVData { Start-ThreadJob -Name "jvdata-R18" -ThrottleLimit $throttleLimit -ScriptBlock { Import-Module $using:jvModulePath if ($using:R18Url) { - $using:R18Url | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath -IdPreference:$using:R18IdPreference + $using:R18Url | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath } elseif ($using:jvR18Url) { $jvR18Url = $using:jvR18Url if ($jvR18Url) { - $jvR18Url.En | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath -IdPreference:$using:R18IdPreference + $jvR18Url.En | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath } } } | Out-Null @@ -153,11 +143,11 @@ function Get-JVData { Start-ThreadJob -Name "jvdata-R18Zh" -ThrottleLimit $throttleLimit -ScriptBlock { Import-Module $using:jvModulePath if ($using:R18ZhUrl) { - $using:R18ZhUrl | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath -IdPreference:$using:R18IdPreference + $using:R18ZhUrl | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath } elseif ($using:jvR18Url) { $jvR18Url = $using:jvR18Url if ($jvR18Url) { - $jvR18Url.Zh | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath -IdPreference:$using:R18IdPreference + $jvR18Url.Zh | Get-R18Data -UncensorCsvPath:$using:UncensorCsvPath } } } | Out-Null @@ -223,23 +213,23 @@ function Get-JVData { Start-ThreadJob -Name "jvdata-Dmm" -ThrottleLimit $throttleLimit -ScriptBlock { Import-Module $using:jvModulePath if ($using:DmmUrl) { - $using:DmmUrl | Get-DmmData -ScrapeActress:$using:DmmScrapeActress -IdPreference:$using:DmmIdPreference + $using:DmmUrl | Get-DmmData -ScrapeActress:$using:DmmScrapeActress } elseif ($using:jvDmmUrl) { $jvDmmUrl = $using:jvDmmUrl - $jvDmmUrl.En | Get-DmmData -ScrapeActress:$using:DmmScrapeActress -IdPreference:$using:DmmIdPreference + $jvDmmUrl.En | Get-DmmData -ScrapeActress:$using:DmmScrapeActress } } | Out-Null } if ($DmmJa) { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] [Search - DmmJa] [Url - $DmmJaUrl]" - Start-ThreadJob -Name "jvdata-Dmm" -ThrottleLimit $throttleLimit -ScriptBlock { + Start-ThreadJob -Name "jvdata-DmmJa" -ThrottleLimit $throttleLimit -ScriptBlock { Import-Module $using:jvModulePath if ($using:DmmJaUrl) { - $using:DmmJaUrl | Get-DmmData -ScrapeActress:$using:DmmScrapeActress -IdPreference:$using:DmmIdPreference + $using:DmmJaUrl | Get-DmmData -ScrapeActress:$using:DmmScrapeActress } elseif ($using:jvDmmUrl) { $jvDmmUrl = $using:jvDmmUrl - $jvDmmUrl.Ja | Get-DmmData -ScrapeActress:$using:DmmScrapeActress -IdPreference:$using:DmmIdPreference + $jvDmmUrl.Ja | Get-DmmData -ScrapeActress:$using:DmmScrapeActress } } | Out-Null } diff --git a/src/Javinizer/Public/Get-R18Data.ps1 b/src/Javinizer/Public/Get-R18Data.ps1 index 5b28fa21..28a67e65 100644 --- a/src/Javinizer/Public/Get-R18Data.ps1 +++ b/src/Javinizer/Public/Get-R18Data.ps1 @@ -7,10 +7,7 @@ function Get-R18Data { [String]$Url, [Parameter()] - [System.IO.FileInfo]$UncensorCsvPath = (Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'jvUncensor.csv'), - - [Parameter()] - [String]$IdPreference = "id" + [System.IO.FileInfo]$UncensorCsvPath = (Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'jvUncensor.csv') ) process { @@ -32,7 +29,7 @@ function Get-R18Data { Source = if ($Url -match 'lg=zh') { 'r18zh' } else { 'r18' } Url = $Url ContentId = Get-R18ContentId -WebRequest $webRequest - Id = if ($IdPreference -eq "id") { Get-R18Id -WebRequest $webRequest } elseif ($IdPreference -eq "contentid") { Get-R18ContentId -WebRequest $webRequest } + Id = Get-R18Id -WebRequest $webRequest Title = Get-R18Title -WebRequest $webRequest -Replace $replaceHashTable Description = Get-R18Description -WebRequest $webRequest ReleaseDate = Get-R18ReleaseDate -WebRequest $webRequest diff --git a/src/Javinizer/jvSettings.json b/src/Javinizer/jvSettings.json index 5d867698..659c421c 100644 --- a/src/Javinizer/jvSettings.json +++ b/src/Javinizer/jvSettings.json @@ -18,8 +18,7 @@ "scraper.movie.r18": 1, "scraper.movie.r18zh": 0, "scraper.option.dmm.scrapeactress": 0, - "scraper.option.dmm.idpreference": "id", - "scraper.option.r18.idpreference": "id", + "scraper.option.idpreference": "id", "match.minimumfilesize": 0, "match.includedfileextension": [ ".asf", From bef6f68d8c28eb0ecce40e826c898e33b2d05c6e Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Tue, 29 Sep 2020 17:56:41 -0700 Subject: [PATCH 32/36] Add support for dlgetchu in main scraper functions (#51) --- src/Javinizer/Private/Get-JVUrlLocation.ps1 | 5 +++++ src/Javinizer/Public/Get-JVData.ps1 | 12 ++++++++++++ src/Javinizer/Public/Javinizer.ps1 | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/src/Javinizer/Private/Get-JVUrlLocation.ps1 b/src/Javinizer/Private/Get-JVUrlLocation.ps1 index a7db3544..598a7d70 100644 --- a/src/Javinizer/Private/Get-JVUrlLocation.ps1 +++ b/src/Javinizer/Private/Get-JVUrlLocation.ps1 @@ -76,6 +76,11 @@ function Get-JVUrlLocation { Url = $link Source = 'jav321ja' } + } elseif ($link -match 'dl.getchu') { + $testUrlObject += [PSCustomObject]@{ + Url = $link + Source = 'dlgetchuja' + } } else { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Warning -Message "[$($MyInvocation.MyCommand.Name)] [Url - $Url] not matched" } diff --git a/src/Javinizer/Public/Get-JVData.ps1 b/src/Javinizer/Public/Get-JVData.ps1 index 3ab3dbf6..f30ee845 100644 --- a/src/Javinizer/Public/Get-JVData.ps1 +++ b/src/Javinizer/Public/Get-JVData.ps1 @@ -50,6 +50,10 @@ function Get-JVData { [Alias('scraper.movie.jav321ja')] [Boolean]$Jav321Ja, + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')] + [Alias('scraper.movie.dlgetchuja')] + [Boolean]$DLgetchuJa, + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')] [Alias('javlibrary.baseurl')] [String]$JavlibraryBaseUrl = 'https://www.javlibrary.com', @@ -301,6 +305,14 @@ function Get-JVData { } | Out-Null } + if ($DLgetchuJa) { + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] [Search - DLgetchuJa] [Url - $DLgetchuJaUrl]" + Start-ThreadJob -Name "jvdata-DLgetchuJa" -ThrottleLimit $throttleLimit -ScriptBlock { + Import-Module $using:jvModulePath + $using:DLgetchuJaUrl | Get-DLGetchuData + } | Out-Null + } + $jobCount = (Get-Job | Where-Object { $_.Name -like 'jvdata-*' }).Count $jobId = @((Get-Job | Where-Object { $_.Name -like "jvdata-*" } | Select-Object Id).Id) $jobName = @((Get-Job | Where-Object { $_.Name -like "jvdata-*" } | Select-Object Name).Name) diff --git a/src/Javinizer/Public/Javinizer.ps1 b/src/Javinizer/Public/Javinizer.ps1 index 8a5c07b1..f0fa3a41 100644 --- a/src/Javinizer/Public/Javinizer.ps1 +++ b/src/Javinizer/Public/Javinizer.ps1 @@ -502,6 +502,10 @@ function Javinizer { if ($item.Source -match 'r18') { $item.Url | Get-R18Data -UncensorCsvPath:$uncensorCsvPath } + + if ($item.Source -match 'dlgetchu') { + $item.Url | Get-DLgetchuData + } } $data = [PSCustomObject]@{ From 9e0de6d9267297d529e79aa65c08d6ab195b1fc6 Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Tue, 29 Sep 2020 17:56:53 -0700 Subject: [PATCH 33/36] Fix release date for dlgetchu (#51) --- src/Javinizer/Private/Scraper.DLgetchu.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Javinizer/Private/Scraper.DLgetchu.ps1 b/src/Javinizer/Private/Scraper.DLgetchu.ps1 index d7ac909b..cd881507 100644 --- a/src/Javinizer/Private/Scraper.DLgetchu.ps1 +++ b/src/Javinizer/Private/Scraper.DLgetchu.ps1 @@ -56,6 +56,7 @@ function Get-DLgetchuReleaseDate { process { try { $releaseDate = ($Webrequest.Content | Select-String -Pattern '<td bgcolor="white" width="449">(\d{4}\/\d{2}\/\d{2})<\/td>').Matches.Groups[1].Value + $releaseDate = ($releaseDate -split '/') -join '-' } catch { return } From bf6ecb94b788c1b7bae943c9588757644aaa9d77 Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Tue, 29 Sep 2020 17:57:11 -0700 Subject: [PATCH 34/36] Update debug messages for dlgetchu (#51) --- src/Javinizer/Public/Get-DLgetchuData.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Javinizer/Public/Get-DLgetchuData.ps1 b/src/Javinizer/Public/Get-DLgetchuData.ps1 index 10151010..928295c0 100644 --- a/src/Javinizer/Public/Get-DLgetchuData.ps1 +++ b/src/Javinizer/Public/Get-DLgetchuData.ps1 @@ -14,7 +14,7 @@ function Get-DLgetchuData { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$Url]" $webRequest = Invoke-WebRequest -Uri $Url -Method Get -Verbose:$false } catch [Microsoft.PowerShell.Commands.HttpResponseException] { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Warning -Message "[$($MyInvocation.MyCommand.Name)] Not found on DMM [$Url]" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Warning -Message "[$($MyInvocation.MyCommand.Name)] Not found on DLgetchu [$Url]" continue } catch { Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error [GET] on URL [$Url]: $PSItem" -Action 'Continue' @@ -35,7 +35,7 @@ function Get-DLgetchuData { ScreenshotUrl = Get-DLgetchuScreenshotUrl -WebRequest $webRequest } - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] DMM data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$($MyInvocation.MyCommand.Name)] DLgetchu data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } From b5755f03647435fa0ca6b37629f81bb9fa06c4a6 Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Tue, 29 Sep 2020 18:30:25 -0700 Subject: [PATCH 35/36] Update thumb csv 9-29 --- src/Javinizer/jvThumbs.csv | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Javinizer/jvThumbs.csv b/src/Javinizer/jvThumbs.csv index 07431357..bf473698 100644 --- a/src/Javinizer/jvThumbs.csv +++ b/src/Javinizer/jvThumbs.csv @@ -10231,3 +10231,20 @@ "Suzuno Hiroka","Suzuno","Hiroka","鈴乃広香","https://pics.r18.com/mono/actjpgs/suzuno_hiroka.jpg", "Taira Alice","Taira","Alice","平アリス","https://pics.r18.com/mono/actjpgs/taira_arisu.jpg", "Yukino Tsubaki","Yukino","Tsubaki","雪乃つばき","https://pics.r18.com/mono/actjpgs/yukino_tubaki.jpg", +"Tenno Uta","Tenno","Uta","天ノうた","https://pics.r18.com/mono/actjpgs/amano_uta.jpg", +"Ando Megumi","Ando","Megumi","安藤めぐみ","https://pics.r18.com/mono/actjpgs/ando_megumi.jpg", +"Azuma Yukino","Azuma","Yukino","吾妻ゆきの","https://pics.r18.com/mono/actjpgs/azuma_yukino.jpg", +"Harumi Jun","Harumi","Jun","春明潤","https://pics.r18.com/mono/actjpgs/harumi_zyun.jpg", +"Hasegawa Itsuki","Hasegawa","Itsuki","長谷川樹","https://pics.r18.com/mono/actjpgs/hasegawa_ituki.jpg", +"Hayama Natsuki","Hayama","Natsuki","葉山夏希","https://pics.r18.com/mono/actjpgs/hayama_natuki.jpg", +"Inoue Sora","Inoue","Sora","井上そら","https://pics.r18.com/mono/actjpgs/inoue_sora.jpg", +"Kawai Moka","Kawai","Moka","川井もか","https://pics.r18.com/mono/actjpgs/kawai_moka.jpg", +"Konno Michiko","Konno","Michiko","今野未知子","https://pics.r18.com/mono/actjpgs/konno_mitiko.jpg", +"Nakajo Suzuka","Nakajo","Suzuka","中条鈴華","https://pics.r18.com/mono/actjpgs/nakazyou_suzuka.jpg", +"Oga Rin","Oga","Rin","桜雅凛","https://pics.r18.com/mono/actjpgs/ouga_rin.jpg", +"Sada Mariko","Sada","Mariko","佐田茉莉子","https://pics.r18.com/mono/actjpgs/sata_mariko.jpg", +"Shion Mako","Shion","Mako","志恩まこ","https://pics.r18.com/mono/actjpgs/sion_mako.jpg", +"Shiromomo Hana","Shiromomo","Hana","白桃はな","https://pics.r18.com/mono/actjpgs/sirato_hana.jpg", +"Takanashi Arisa","Takanashi","Arisa","高梨有紗","https://pics.r18.com/mono/actjpgs/takanasi_arisa.jpg", +"Tachibana Momoka","Tachibana","Momoka","橘萌々香","https://pics.r18.com/mono/actjpgs/tatibana_momoka.jpg", +"Teramoto Ami","Teramoto","Ami","寺本亜美","https://pics.r18.com/mono/actjpgs/teramoto_ami.jpg", From 0e3337ba43a1d7497cebe8a748c02a9c12e26a0f Mon Sep 17 00:00:00 2001 From: jvlflame <jli141928@gmail.com> Date: Tue, 29 Sep 2020 18:43:03 -0700 Subject: [PATCH 36/36] Update for 2.1.0 --- .github/CHANGELOG.md | 30 ++++++++++++++++ README.md | 68 +++++++++++++++++++++++------------- src/Javinizer/Javinizer.psd1 | 2 +- 3 files changed, 75 insertions(+), 25 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index ea40d341..ec458cde 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.1.0] + +### Added +- **EXPERIMENTAL** Dl.getchu scraper (#51) + - This is scraper is only available via the `-Url` parameter when sorting a single file or using `-Find` to search the Url +- Setting `sort.metadata.nfo.mediainfo` added to allow user to add video/audio metadata to nfo (#94) + - [MediaInfo](https://mediaarea.net/en/MediaInfo) required for use. MediaInfo will need to be added to your system PATH + - `<RESOLUTION>` added to file formats +- Setting `sort.metadata.nfo.unknownactress` to allow `Unknown` actress to be written to nfo file when no actresses are scraped (#105) +- Setting `sort.metadata.nfo.format.tagline` to allow user to set a tagline which accepts file format strings (#106) +- Setting `sort.metadata.priority.contentid` to set the priority of the ContentId displayed by aggregated data object + - `<CONTENTID>` added to file formats + +### Changed +- Default file matcher updated to better match multipart videos and support DMM ContentId (#111) +- Setting `sort.metadata.nfo.seriesastag` is now `sort.metadata.nfo.format.tag` + - This setting is now an array, which allows multiple file format strings to be created as separate tags (#106) +- Javinizer now performs a retry on the Javlibrary URL scraper and continues to run despite webrequest errors (#109) +- AggregatedData object now contains `ContentId` + +### Fixed +- Get-DmmUrl now correctly assigns the URLs when searching for a movie with ID with a letter suffix (#107) +- Manually sorting with a DmmJa URL now functions properly (#111) +- Nfo file now correctly renames to the movie name when `sort.renamefile` is set to false, and `sort.create.nfoperfile` is true (#102) +- `<ACTORS>` file rename format now properly falls back to the alternate language when the primary is missing (#103) +- R18 scraper now properly assigns the genre and label fields for Amateur videos (#108) +- Extra html on the Description field for the DMM scraper is now removed + + + ## [2.0.2] ### Fixed diff --git a/README.md b/README.md index 9c655aca..7a052c24 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,11 @@ A rebuild of my previous project [JAV-Sort-Scrape-javlibrary](https://github.com ### Install module dependencies -- [PowerShell 6/7](https://github.com/PowerShell/PowerShell) +- [PowerShell 6/7](https://github.com/PowerShell/PowerShell) *Recommended PowerShell 7 - [Python 3](https://www.python.org/downloads/) - [Pillow](https://pypi.org/project/Pillow/) - [Googletrans](https://pypi.org/project/googletrans/) +- [MediaInfo](https://mediaarea.net/en/MediaInfo) *MediaInfo will need to be added to your PATH ```powershell # Python @@ -401,9 +402,17 @@ ID-###_0\d - ID-069_01, ID-069_02 ID-###-cd\d - ID-069-cd1, ID-069-cd2 ``` -### In-depth usage +## In-depth usage -#### Metadata Priorities +### Media Library Setup + +| CMS | How to use | +| ------------- | ------------- | +| Plex | Set-up a `Movie` library with custom agent [XBMCnfoMoviesImporter.bundle](https://github.com/gboudreau/XBMCnfoMoviesImporter.bundle). Turn on settings `Enable generating collections from tags` and `Use plot instead of outline` | +| Emby | Set-up a `Movie` library with all metadata/image downloaders disabled. Input your server url and API key in the `jvSettings.json` file and use `Javinizer -SetEmbyThumbs` to set actress thumbnails | +| Jellyfin | Set-up a `Movie` library with all metadata/image downloaders disabled. Input your server url and API key in the `jvSettings.json` file and use `Javinizer -SetEmbyThumbs` to set actress thumbnails | + +### Metadata Priorities Scrapers by default are english. Scrapers appended by Ja are Japanese, Zh are Chinese. Current metadata scrapers include: @@ -427,7 +436,22 @@ For example, if your actress priority looks like this: `"sort.metadata.priority. - If actresses are not found on the R18 scraper but are found on the Javlibrary scraper => Javlibrary actresses will be assigned to the metadata field - If actresses are not found on the R18 and Javlibrary scrapers but are found on the JavBus scraper => JavBus actresses will be assigned to the metadata field -#### Actress Thumb Csv +### Metadata Format Strings + +- <\ID> +- <\CONTENTID> +- <\TITLE> +- <\RELEASEDATE> +- <\YEAR> +- <\STUDIO> +- <\RUNTIME> +- <\SET> +- <\LABEL> +- <\ACTORS> +- <\ORIGINALTITLE> +- <\RESOLUTION> - requires `sort.metadata.nfo.mediainfo` as true + +### Actress Thumb Csv Javinizer can utilize a csv file of actresses scraped from R18.com to further match actresses and their respective names/thumbnail URLs. @@ -464,7 +488,7 @@ Nagase Yui | Nagase | Yui | 永瀬ゆい |https://[..]/nagase_yui2.jpg | Aika If `sort.metadata.thumbcsv.autoadd` is enabled in addition to `sort.metadata.thumbcsv`, then Javinizer will automatically add any missing actresses scraped from the R18 or R18Zh scrapers to your thumbnail csv if the actress has a thumbnail. -#### Genre Csv +### Genre Csv Javinizer can utilize a csv file of genres to replace them with a genre of your choice. @@ -528,20 +552,24 @@ For example, if your jvGenres.csv file looks like this: | `sort.download.screenshotimg` | Specifies to download screenshot images when sorting a movie. | 0, 1 | `sort.download.trailervid` | Specifies to download the trailer video when sorting a movie. | 0, 1 | `sort.format.delimiter` | Specifies the delimiter between actresses when using \<ACTORS> in the format string. | Any string value -| `sort.format.file` | Specifies the format string when renaming a file. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE> -| `sort.format.folder` | Specifies the format string when creating the folder. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE> -| `sort.format.posterimg` | Specifies an array of format string when creating the poster image. Multiple strings will allow you to create multiple poster image files. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE> -| `sort.format.thumbimg` | Specifies the format string when creating the thumbnail image. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE> -| `sort.format.trailervid` | Specifies the format string when creating the trailer video. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE> -| `sort.format.nfo` | Specifies the format string when creating the nfo. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE> -| `sort.format.screenshotimg` | Specifies the format string when creating the screenshot images. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE> -| `sort.format.screenshotfolder` | Specifies the format string when creating the screenshot images folder. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE> -| `sort.format.actressimgfolder` | Specifies the format string when creating the actress image folder. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE> -| `sort.metadata.nfo.translatedescription` | Specifies to translate the description | 0, 1 +| `sort.format.file` | Specifies the format string when renaming a file. | [Format Strings](#Metadata-Format-Strings) +| `sort.format.folder` | Specifies the format string when creating the folder. | [Format Strings](#Metadata-Format-Strings) +| `sort.format.posterimg` | Specifies an array of format strings when creating the poster image. Multiple strings will allow you to create multiple poster image files. | [Format Strings](#Metadata-Format-Strings) +| `sort.format.thumbimg` | Specifies the format string when creating the thumbnail image. | [Format Strings](#Metadata-Format-Strings) +| `sort.format.trailervid` | Specifies the format string when creating the trailer video. | [Format Strings](#Metadata-Format-Strings) +| `sort.format.nfo` | Specifies the format string when creating the nfo. | [Format Strings](#Metadata-Format-Strings) +| `sort.format.screenshotimg` | Specifies the format string when creating the screenshot images. | [Format Strings](#Metadata-Format-Strings) +| `sort.format.screenshotfolder` | Specifies the format string when creating the screenshot images folder. | [Format Strings](#Metadata-Format-Strings) +| `sort.format.actressimgfolder` | Specifies the format string when creating the actress image folder. | [Format Strings](#Metadata-Format-Strings) +| `sort.metadata.nfo.mediainfo` | Specifies to add media metadata information to the nfo file. This requires the MediaInfo command line application. | 0, 1 +| `sort.metadata.nfo.translatedescription` | Specifies to translate the description. | 0, 1 | `sort.metadata.nfo.translatedescription.language` | Specifies which language to translate to. | Check [here](https://developers.google.com/admin-sdk/directory/v1/languages) for language codes -| `sort.metadata.nfo.displayname` | Specifies the format string of the displayname in the metadata nfo file. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE> +| `sort.metadata.nfo.displayname` | Specifies the format string of the displayname in the metadata nfo file. | [Format Strings](#Metadata-Format-Strings) | `sort.metadata.nfo.seriesastag` | Specifies to add the <\SET> metadata as <\TAG> as well for Emby/Jellyfin support | 0, 1 +| `sort.metadata.nfo.format.tag` | Specifies an array of format strings to add tags to the aggregated data object | [Format Strings](#Metadata-Format-Strings) +| `sort.metadata.nfo.format.tagline` | Specifies the format string to add a tagline to the aggregated data object | [Format Strings](#Metadata-Format-Strings) | `sort.metadata.nfo.actresslanguageja` | Specifies to prefer Japanese names when creating the metadata nfo. | 0, 1 +| `sort.metadata.nfo.unknownactress` | Specifies to add an 'Unknown' actress to scraped movies without any actresses | 0, 1 | `sort.metadata.thumbcsv` | Specifies to use the thumbnail csv when aggregating metadata. | 0, 1 | `sort.metadata.thumbcsv.autoadd` | Specifies to automatically add missing actresses to the thumbnail csv when scraping using the R18 or R18Zh scrapers. | 0, 1 | `sort.metadata.thumbcsv.convertalias` | Specifies to use the thumbnail csv alias field to replace actresses in the metadata. | 0, 1 @@ -569,11 +597,3 @@ For example, if your jvGenres.csv file looks like this: | `javlibrary.baseurl` | Specifies the base URL of the Javlibrary instance you want to scrape. This is useful if you are running into CloudFlare errors on the main site and want to use a mirror such as g46e.com or m45e.com | http:\\/\\/javlibrary.com | `admin.log` | Specifies to write debug, warning, error, and verbose messages to the log file. | 0, 1 | `admin.log.level` | Specifies the level of logs that will be written to the log file. | Debug, Info, Warning, Error - -## Media Library Setup - -| CMS | How to use | -| ------------- | ------------- | -| Plex | Set-up a `Movie` library with custom agent [XBMCnfoMoviesImporter.bundle](https://github.com/gboudreau/XBMCnfoMoviesImporter.bundle). Turn on settings `Enable generating collections from tags` and `Use plot instead of outline` | -| Emby | Set-up a `Movie` library with all metadata/image downloaders disabled. Input your server url and API key in the `jvSettings.json` file and use `Javinizer -SetEmbyThumbs` to set actress thumbnails | -| Jellyfin | Set-up a `Movie` library with all metadata/image downloaders disabled. Input your server url and API key in the `jvSettings.json` file and use `Javinizer -SetEmbyThumbs` to set actress thumbnails | diff --git a/src/Javinizer/Javinizer.psd1 b/src/Javinizer/Javinizer.psd1 index 5dd1df27..85bbe11f 100644 --- a/src/Javinizer/Javinizer.psd1 +++ b/src/Javinizer/Javinizer.psd1 @@ -13,7 +13,7 @@ # Version number of this module. - ModuleVersion = '2.0.2' + ModuleVersion = '2.1.0' # Supported PSEditions # CompatiblePSEditions = @('Core')