@@ -393,11 +393,6 @@ function Javinizer {
393393 [Parameter (ParameterSetName = ' Info' )]
394394 [Switch ]$AllResults ,
395395
396- [Parameter (ParameterSetName = ' Info' )]
397- [Parameter (ParameterSetName = ' Path' )]
398- [Parameter (ParameterSetName = ' Javlibrary' )]
399- [PSObject ]$CfSession ,
400-
401396 [Parameter (ParameterSetName = ' Emby' )]
402397 [Switch ]$SetEmbyThumbs ,
403398
@@ -701,10 +696,6 @@ function Javinizer {
701696 }
702697
703698 ' Info' {
704- if (($Javlibrary -or $JavlibraryZh -or $JavlibraryJa ) -or ($Find -like ' *javlibrary*' -or $Find -like ' *g46e*' -or $Find -like ' *m45e*' )) {
705- $CfSession = Test-JavlibraryCf - Settings $Settings - CfSession $CfSession
706- }
707-
708699 if ($Find -match ' https?:\/\/' ) {
709700 $urlObject = Get-JVUrlLocation - Url $Find - Settings $Settings
710701 $data = foreach ($item in $urlObject ) {
@@ -756,7 +747,7 @@ function Javinizer {
756747 $data = Get-JVData - Id $Find - Javlibrary:$Javlibrary - JavlibraryJa:$JavlibraryJa - JavlibraryZh:$JavlibraryZh - Dmm:$Dmm `
757748 - DmmJa:$DmmJa - R18Dev:$R18Dev - Javbus:$Javbus - JavbusJa:$JavbusJa - JavbusZh:$JavbusZh - Jav321Ja:$Jav321Ja - JavlibraryBaseUrl $Settings .' javlibrary.baseurl' `
758749 - MgstageJa:$MgstageJa - Aventertainment:$Aventertainment - AventertainmentJa:$AventertainmentJa - Tokyohot:$Tokyohot - TokyohotJa:$TokyohotJa - TokyohotZh:$TokyohotZh - UncensorCsvPath $uncensorCsvPath - Strict:$Strict `
759- - Javdb:$Javdb - JavdbZh:$JavdbZh - Session: $CfSession - JavdbSession:$Settings .' javdb.cookie.session' - AllResults:$AllResults
750+ - Javdb:$Javdb - JavdbZh:$JavdbZh - JavdbSession:$Settings .' javdb.cookie.session' - AllResults:$AllResults
760751 }
761752
762753 if ($Aggregated ) {
@@ -885,14 +876,13 @@ function Javinizer {
885876 }
886877
887878 ' Javlibrary' {
888- $CfSession = Test-JavlibraryCf - Settings $Settings - CfSession $CfSession
889879 try {
890880 if (! ($Path )) {
891881 $Path = $null -ne $Settings .' location.input' -and $Settings .' location.input' -ne ' ' ? $Settings .' location.input' : (Get-Location ).Path
892882 }
893883
894884 $javlibraryBaseUrl = $Settings .' javlibrary.baseurl'
895- $request = Invoke-WebRequest - Uri " $javlibraryBaseUrl /en/mv_owned.php" - WebSession $CfSession - UserAgent $CfSession .UserAgent - Verbose:$false - Headers @ {
885+ $request = Invoke-WebRequest - Uri " $javlibraryBaseUrl /en/mv_owned.php" - Verbose:$false - Headers @ {
896886 " method" = " GET"
897887 " authority" = " $javlibraryBaseUrl "
898888 " scheme" = " https"
@@ -940,7 +930,7 @@ function Javinizer {
940930 $index = 1
941931 foreach ($movieId in $unowned ) {
942932 Write-Progress - Id 1 - Activity " Javinizer" - Status " Remaining Jobs: $ ( $unowned.Count - $index ) " - PercentComplete ($index / $unowned.Count * 100 ) - CurrentOperation " Setting owned: $movieId "
943- Set-JavlibraryOwned - Id $movieId - UserId $Settings .' javlibrary.cookie.userid' - LoginSession $Settings .' javlibrary.cookie.session' - Session: $CfSession - BaseUrl $javlibraryBaseUrl
933+ Set-JavlibraryOwned - Id $movieId - UserId $Settings .' javlibrary.cookie.userid' - LoginSession $Settings .' javlibrary.cookie.session' - BaseUrl $javlibraryBaseUrl
944934 $index ++
945935 }
946936 } else {
@@ -957,10 +947,6 @@ function Javinizer {
957947 }
958948
959949 ' Path' {
960- if (! $IsThread -and ($Settings .' scraper.movie.javlibrary' -or $Settings .' scraper.movie.javlibraryja' -or $Settings .' scraper.movie.javlibraryzh' )) {
961- $CfSession = Test-JavlibraryCf - Settings $Settings - CfSession $CfSession
962- }
963-
964950 if (! ($Path )) {
965951 try {
966952 # Default path to location.input in settings if not specified
@@ -1008,7 +994,7 @@ function Javinizer {
1008994 $mediaInfo = Get-JVMediaInfo - Path $movie.FullName
1009995 }
1010996
1011- $javData = Get-JVData - Url $Url - Settings $Settings - UncensorCsvPath $uncensorCsvPath - Session: $CfSession - JavdbSession:$Settings .' javdb.cookie.session'
997+ $javData = Get-JVData - Url $Url - Settings $Settings - UncensorCsvPath $uncensorCsvPath - JavdbSession:$Settings .' javdb.cookie.session'
1012998 if ($null -ne $javData ) {
1013999 $javAggregatedData = $javData | Get-JVAggregatedData - Settings $Settings - FileName $javMovies.BaseName - MediaInfo $mediaInfo | Test-JVData - RequiredFields $Settings .' sort.metadata.requiredfield'
10141000 if ($javAggregatedData.NullFields -eq ' ' ) {
@@ -1040,8 +1026,8 @@ function Javinizer {
10401026 }
10411027 }
10421028 } else {
1043- if ($Settings .' throttlelimit' -lt 1 -or $Settings .' throttlelimit' -gt 10 ) {
1044- Write-JVLog - Write $script :JVLogWrite - LogPath $script :JVLogPath - WriteLevel $script :JVLogWriteLevel - Level Error - Message " [$ ( $MyInvocation.MyCommand.Name ) ] Setting 'scraper.throttlelimit' must be within accepted values (1-10 )"
1029+ if ($Settings .' throttlelimit' -lt 1 -or $Settings .' throttlelimit' -gt 3 ) {
1030+ Write-JVLog - Write $script :JVLogWrite - LogPath $script :JVLogPath - WriteLevel $script :JVLogWriteLevel - Level Error - Message " [$ ( $MyInvocation.MyCommand.Name ) ] Setting 'scraper.throttlelimit' must be within accepted values (1-3 )"
10451031 }
10461032
10471033 if (! ($PSboundParameters.ContainsKey (' IsThread' ))) {
@@ -1052,15 +1038,15 @@ function Javinizer {
10521038 Import-Module $using :jvModulePath
10531039 $jvMovie = $_
10541040 $Settings = $using :Settings
1055- $jvData = Javinizer - IsThread - IsWeb - IsWebType $using :IsWebType - WebTempPath:$using :WebTempPath - Path $jvMovie.FullName - DestinationPath $using :DestinationPath - Set $using :Set - MoveToFolder:$Settings .' sort.movetofolder' - RenameFile:$Settings .' sort.renamefile' - CfSession: $ using :CfSession - Update:$using :Update - SettingsPath:$using :SettingsPath - Strict:$using :Strict - Force:$using :Force - Verbose:$using :VerbosePreference - Debug:$using :DebugPreference
1041+ $jvData = Javinizer - IsThread - IsWeb - IsWebType $using :IsWebType - WebTempPath:$using :WebTempPath - Path $jvMovie.FullName - DestinationPath $using :DestinationPath - Set $using :Set - MoveToFolder:$Settings .' sort.movetofolder' - RenameFile:$Settings .' sort.renamefile' - Update:$using :Update - SettingsPath:$using :SettingsPath - Strict:$using :Strict - Force:$using :Force - Verbose:$using :VerbosePreference - Debug:$using :DebugPreference
10561042 Write-Output $jvData
10571043 }
10581044 } else {
10591045 $javMovies | Invoke-JVParallel - IsWeb - IsWebType ' sort' - MaxQueue $Settings .' throttlelimit' - Throttle $Settings .' throttlelimit' - Quiet:$true - ScriptBlock {
10601046 Import-Module $using :jvModulePath
10611047 $jvMovie = $_
10621048 $Settings = $using :Settings
1063- Javinizer - IsThread - IsWeb - IsWebType $using :IsWebType - Path $jvMovie.FullName - DestinationPath $using :DestinationPath - Set $using :Set - MoveToFolder:$Settings .' sort.movetofolder' - RenameFile:$Settings .' sort.renamefile' - CfSession: $ using :CfSession - Update:$using :Update - SettingsPath:$using :SettingsPath - Strict:$using :Strict - Force:$using :Force - Verbose:$using :VerbosePreference - Debug:$using :DebugPreference
1049+ Javinizer - IsThread - IsWeb - IsWebType $using :IsWebType - Path $jvMovie.FullName - DestinationPath $using :DestinationPath - Set $using :Set - MoveToFolder:$Settings .' sort.movetofolder' - RenameFile:$Settings .' sort.renamefile' - Update:$using :Update - SettingsPath:$using :SettingsPath - Strict:$using :Strict - Force:$using :Force - Verbose:$using :VerbosePreference - Debug:$using :DebugPreference
10641050 }
10651051 }
10661052
@@ -1069,20 +1055,31 @@ function Javinizer {
10691055 Import-Module $using :jvModulePath
10701056 $jvMovie = $_
10711057 $Settings = $using :Settings
1072- $jvData = Javinizer - IsThread - Search - Path $jvMovie.FullName - DestinationPath $using :DestinationPath - Set $using :Set - MoveToFolder:$Settings .' sort.movetofolder' - RenameFile:$Settings .' sort.renamefile' - CfSession: $ using :CfSession - Update:$using :Update - SettingsPath:$using :SettingsPath - Strict:$using :Strict - Force:$using :Force - Verbose:$using :VerbosePreference - Debug:$using :DebugPreference
1058+ $jvData = Javinizer - IsThread - Search - Path $jvMovie.FullName - DestinationPath $using :DestinationPath - Set $using :Set - MoveToFolder:$Settings .' sort.movetofolder' - RenameFile:$Settings .' sort.renamefile' - Update:$using :Update - SettingsPath:$using :SettingsPath - Strict:$using :Strict - Force:$using :Force - Verbose:$using :VerbosePreference - Debug:$using :DebugPreference
10731059 Write-Output $jvData
10741060 }
10751061 } else {
10761062 $javMovies | Invoke-JVParallel - MaxQueue $Settings .' throttlelimit' - Throttle $Settings .' throttlelimit' - Quiet:$HideProgress - ScriptBlock {
10771063 Import-Module $using :jvModulePath
10781064 $jvMovie = $_
10791065 $Settings = $using :Settings
1080- Javinizer - IsThread - Path $jvMovie.FullName - DestinationPath $using :DestinationPath - Set $using :Set - MoveToFolder:$Settings .' sort.movetofolder' - RenameFile:$Settings .' sort.renamefile' - CfSession: $ using :CfSession - Update:$using :Update - SettingsPath:$using :SettingsPath - Strict:$using :Strict - Force:$using :Force - Verbose:$using :VerbosePreference - Debug:$using :DebugPreference
1066+ Javinizer - IsThread - Path $jvMovie.FullName - DestinationPath $using :DestinationPath - Set $using :Set - MoveToFolder:$Settings .' sort.movetofolder' - RenameFile:$Settings .' sort.renamefile' - Update:$using :Update - SettingsPath:$using :SettingsPath - Strict:$using :Strict - Force:$using :Force - Verbose:$using :VerbosePreference - Debug:$using :DebugPreference
10811067 }
10821068 }
10831069 }
10841070
10851071 if ($PSboundParameters.ContainsKey (' IsThread' )) {
1072+ $sleepSeconds = $Settings .' sleep'
1073+
1074+ if (! ($sleepSeconds )) {
1075+ # Default sleep to 5 seconds if not specified
1076+ $sleepSeconds = 5
1077+ }
1078+
1079+ if ($sleepSeconds -gt 0 ) {
1080+ Start-Sleep - Seconds $sleepSeconds
1081+ }
1082+
10861083 foreach ($movie in $javMovies ) {
10871084 if (! $MoveToFolder -and ($DestinationPath -ne $movie.Directory )) {
10881085 $DestinationPath = $movie.Directory
@@ -1092,7 +1089,7 @@ function Javinizer {
10921089 $mediaInfo = Get-JVMediaInfo - Path $movie.FullName
10931090 }
10941091
1095- $javData = Get-JVData - Id $movie.Id - Settings $Settings - UncensorCsvPath $uncensorCsvPath - Strict:$Strict - Session: $CfSession - JavdbSession:$Settings .' javdb.cookie.session'
1092+ $javData = Get-JVData - Id $movie.Id - Settings $Settings - UncensorCsvPath $uncensorCsvPath - Strict:$Strict - JavdbSession:$Settings .' javdb.cookie.session'
10961093 $javAggregatedData = $javData | Get-JVAggregatedData - Settings $Settings - FileName $movie.BaseName - MediaInfo $mediaInfo | Test-JVData - RequiredFields $Settings .' sort.metadata.requiredfield'
10971094
10981095 if ($PSBoundParameters.ContainsKey (' IsWeb' ) -or $PSBoundParameters.ContainsKey (' Search' )) {
0 commit comments