Compare commits

...

6 Commits
master ... t

Author SHA1 Message Date
pcnick d2c21193e0 test template 2 years ago
pcnick 61523c15e8 20221101 lastest 2 years ago
pcnick 51093d09c3 test 1 3 years ago
pcnick 555e3a828f Merge tag 'v0.2.2' into develop 3 years ago
pcnick 3f506e4872 Merge tag 'v0.2.1' into develop 3 years ago
pcnick d96757e39a Merge tag 'v0.2.0' into develop 3 years ago
  1. 60
      Animelibk.ps1
  2. 44
      NameRegex.psm1
  3. 44
      PathChar.psm1
  4. 97
      t.ps1

60
Animelibk.ps1

@ -42,11 +42,15 @@ if (-not($WorkData.Episode)) {
}
$WorkData
$Seasons_TC = "", "第一季", "第二季", "第三季", "第四季", "第五季"
#$Seasons_TC = "", "第一季", "第二季", "第三季", "第四季", "第五季"
$Seasons_TC = "", "Seasons 1", "Seasons 2", "Seasons 3", "Seasons 4", "Seasons 5"
$Lang = @{
Season = "Season {0:00}"
}
$Year = @($($JsonPath -replace '.*\\((?<Y>\d{4})?(?<M>\d{2})?).*$', '${Y}'), $(get-date -Format 'yyyy')) | ? {-not([string]::IsNullOrEmpty($_))} | Select -First 1
# 取得目標資料夾是否存在,不存在建立資料夾,並取得資料夾物件
$LinkPath = "{2}\{0}\{1}" -f $WorkData.DestinName, $Seasons_TC[$WorkData.Season], $Index
$LinkPath = "{2}\{0}\{1}" -f $WorkData.DestinName, $($Lang["Season"] -f $WorkData.Season), $Index
$LinkDir = $(if (-not(Test-Path -Path "$LinkPath*")) {
New-Item -Path "$LinkPath ($Year)" -ItemType Directory -Force
} else {
@ -70,7 +74,7 @@ function Get-StandName {
$EpisodeRegex = @(
"(?:S\d{2})?[\s]?-[\s]E?(?<Episode>\d{2})"
"[\[\b\s](?<Episode>\d{2})[\s_]?(?:[vV]\d|END|FIN)[\]\b\s]"
"\[(?<Episode>\d{1,2})\w{2}\]"
"\[(?<Episode>\d{1,2})\D{2}\]"
"\[(?<Episode>\d{1,2})\]"
)
@ -78,7 +82,7 @@ function Get-StandName {
"[\[\b\s](?<Name>[^\[\]]*)[\]\b\s]?$"
)
$Result = $File.Name | % { Get-NameRegex $_ -Regex $EpisodeRegex } | % { $(Get-NameRegex $_["L"] -Regex $NameRegex -Exclude "(BD|DVD|HDTV)RIP" -End) + $_ } | Select -First 1
$Result = $File.Name | % { Get-NameRegex $_ -Regex $EpisodeRegex } | % { $(Get-NameRegex $_["L"] -Regex $NameRegex -Exclude "(BD|DVD|HDTV)RIP|BIG5" -End) + $_ } | Select -First 1
# 建立回傳資料物件,以方便後續資料處理。
$OutputData = "" | Select newName, Season, Episode, newFullName;
@ -145,33 +149,33 @@ exit 0;
# SIG # Begin signature block
# MIIFxwYJKoZIhvcNAQcCoIIFuDCCBbQCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUnaUT7B6+atzTGRJLSX59DzPX
# fjGgggNSMIIDTjCCAjagAwIBAgIQdMnAQ4BDAo9Lgfn+QeDdhjANBgkqhkiG9w0B
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQU5uOMlGEFPkqdlQakIgaEB5Z+
# +o2gggNSMIIDTjCCAjagAwIBAgIQV5lzhhF94bJEhqpMRjsGlzANBgkqhkiG9w0B
# AQUFADAqMRMwEQYDVQQDDApOaWNrIENoYW5nMRMwEQYDVQQKDAplYXJpY2sub3Jn
# MB4XDTIxMTAzMTEwMDI1MVoXDTIyMTAzMTEwMjI1MVowMzEiMCAGCSqGSIb3DQEJ
# MB4XDTIyMTAzMTE3NTEzNVoXDTIzMTAzMTE4MTEzNVowMzEiMCAGCSqGSIb3DQEJ
# ARYTcGNuaWNrMTAwQGdtYWlsLmNvbTENMAsGA1UEAwwETmljazCCASIwDQYJKoZI
# hvcNAQEBBQADggEPADCCAQoCggEBAMEnEk3/5rkEMibDbbfOXQaerk5xXSJmY8gf
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hqtoZ21ypWGOiqzLMg3vA2LXRrwyBS
# RkldM5YoGC2uhapaUatOw8U90ywSZDOLeVO7m/2TI1DqeLrIasy703HDxLYnprKD
# TQpx28hUK6iyWEMK/JaMzS8W90rrsN+o9WaVjAvUcsOODN9dFlVX5cTXVJlMImhi
# 2XA/CRNzbP/Y5m062/GhgR2Nrvu1Ps52bTnsD0oVZbdYjoD/BeCst0IKxJ61PlPP
# 9vwbh2koRrIc4lAXpVyfYh4/iw+e1Pqn2EBsMygf+9S71tXqiEvBFfSkcA==
# SIG # End signature block

97
t.ps1

@ -0,0 +1,97 @@
# 檔名分析測試用
$Pathes = @(
"L:\Anime\201110 WORKING’!!\[#CHAT RUMBLE#][WORKING’!!][01-13 END][BIG5][x264_aac][1280x720]\[#CHAT RUMBLE#][WORKING’!!][13][BIG5][x264_aac][1280x720][11C6E807].mp4"
"L:\Anime\200910 にゃんこい!(貓願三角戀)\[DMG][Nyan Koi!][01-12 END][848x480][BIG5]\[DMG][Nyan Koi!][12 end][848x480][BIG5].rmvb"
"L:\Anime\200910 聖剣の刀鍛冶(聖劍鍛造師)\[DMG][The Sacred Blacksmith][01-12 END][848x480][BIG5]\[DMG][The Sacred Blacksmith][04V2][848x480][BIG5].rmvb"
"L:\Anime\201104 星空へ架かる橋(架向星空之橋)\[AngelSub][Hoshizora e Kakaru Hashi][BDRip][Vol.01][1920x1080][TW_BIG5][x264_FLAC]\[AngelSub][Hoshizora e Kakaru Hashi][BDRip][01][1920x1080][BIG5][x264_FLAC].mkv"
"H:\Anime\201901 盾の勇者の成り上がり\[LKSUB][Tate no Yuusha no Nariagari][01-25][GB][720P][MP4]\[LKSUB][Tate no Yuusha no Nariagari][01][GB][720P].mp4"
"L:\Anime\202004 ストライク・ザ・ブラッド OVA IV\[Suzu-Kaze][Strike_the_Blood_IV_OVA][01-12FIN][BDRip_1080P][HEVC_YUV420P10]\[Suzu-Kaze] Strike the Blood IV 12FIN [BDRip 1920x1080 HEVC YUV420P10 FLAC].mkv"
"L:\Anime\200910 アスラクライン II(機巧魔神)\[DMG][Asura Cryin2][01-13 END][848x480][BIG5][RMVB]\[DMG][Asura Cryin 2][01][848x480][Big5].rmvb"
"H:\Data\Downloads\異世界食堂\[Lilith-Raws] Isekai Shokudou S02 - 06 [Baha][WEB-DL][1080p][AVC AAC][CHT][MP4].mp4"
)
$TestName = @($Pathes | % {$_.Split("\\")[-1]})
#$Result = @( $TestName |
#% { @(
# $($_ -match "\[([^\]]*)\]\[(\d{1,2})\]")
# $($($_ -replace "\[(DVD|HDTV|BD)rip\]", '') -match "[\[\s](?<Name>\b[^\]\-]*)(?:[\]\[\-\s]+)(?<Episode>\d{1,2})(?:[ _])?(?:[vV]\d|FIN|END)?[\]\s]")
#$($($_ -replace "\[(DVD|HDTV|BD)rip\]", '') -match "[\[\s](?<Name>\b[^\]]*\b)(?:[\]\[\-\s]+)(?<Episode>\d{1,2})(?:[vV]\d|FIN|END)?[\]\s]")
#) |
#% { if ($_) { $Matches }}})
$Result = @( $TestName |
% {
Get-NameRegex $_ -Regex "[\[\s](?<Name>\b[^\]\-]*)(?:[\]\[\-\s]+)(?<Episode>\d{1,2})(?:[ _])?(?:[vV]\d|FIN|END)?[\]\s]"
Get-NameRegex $_ -Regex "[\[\s](?<Name>\b[^\]]*)(?:[\]\[\-\s]+)(?<Episode>\d{1,2})(?:[ _])?(?:[vV]\d|FIN|END)?[\]\s]"
Get-NameRegex $_ -Regex "[\[\s](?<Name>\b[^\]]*)(?:[\]\[\-\s]+)(?<Episode>\d{1,2})(?:[ _])?(?:[vV]\d|FIN|END)?[\]\s]"
Get-NameRegex $_ -Regex "[\[\s](?<Name>\b[^\]]*\b)(?:[\]\[\-\s]+)(?<Episode>\d{1,2})(?:[ _])?(?:[vV]\d|FIN|END)?[\]\s]"
}
)
Write-Output $Result
Write-Output $Pathes.Length
Write-Output $Result.Length
# $Matches
$($($Pathes[1] -replace "\[(DVD|HDTV|BD)rip\]", '') -match "[\[\s](?<Name>\b[^\]]*)(?:[\]\[\-\s]+)(?<Episode>\d{1,2})(?:[ _])?(?:[vV]\d|FIN|END)?[\]\s]")
function Get-NameRegex {
param(
$Str,
$Regex
)
if ($($Str -replace "\[(DVD|HDTV|BD)rip\]", '') -match $Regex) { $Matches }
}
$ss = $TestName | % {$_ -split "[\[\]]"} | ? {$_ -ne ""}
$ss | ? {$_ -match "\b\d{1,2}(?=\b|[vV]\d|FIN|END)"}
"Geisiduji is ghtr" -match "\b\w+(?=\sis\b)"
$Matches
$Str = $TestName[0]
function Get-NameRegex2 {
param(
$Str,
$Regex,
[switch] $Exclude,
[switch] $End
)
# Regex 可輸入複數個
Write-Host $Str
$Regex | % {
$key = if ($_ -match "\(\?\<(.*?)\>") {
$Matches[1]
} else {
Write-Error "$_ 沒有定義(?<TAG>)"
}
if ($Str -match $_ -and($key)) {
$Result = @{
$key = $Matches[$key]
# 將錨定字串中的特殊字元轉換為一般字串
Anchor = $Matches[0] -replace "([\[\]\(\)])", '\$1'
}
if (-not($End)) {
$LR = $Str -split $Result["Anchor"]
$Result.Add("L", $LR[0])
$Result.Add("R", $LR[1])
} else { $Result.Remove("Anchor") }
$Result
}
}
}
$EpisodeRegex = @(
"S\d{2}[\s\-]+E?(?<Episode>\d{2})"
"[\[\b\s](?<Episode>\d{2})[\s_]?(?:[vV]\d|END|FIN)[\]\b\s]"
"\[(?<Episode>\d{1,2})\]"
#"\d"
)
$RS1 = $TestName | % { Get-NameRegex2 $_ -Regex $EpisodeRegex }
$RS1
$NameRegex = @(
"[\[\b\s](?<Name>[^\[\]]*)[\]\b\s]$"
)
$RS1 | % { Get-NameRegex2 $_["L"] -Regex $NameRegex }
Loading…
Cancel
Save