Skip to content

Commit

Permalink
Merge pull request #165 from jvlflame/dev
Browse files Browse the repository at this point in the history
2.2.2
  • Loading branch information
jvlflame committed Dec 23, 2020
2 parents 9fa3bca + 1b04372 commit 838e83e
Show file tree
Hide file tree
Showing 11 changed files with 252 additions and 194 deletions.
322 changes: 177 additions & 145 deletions .github/CHANGELOG.md

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,3 @@ jobs:
testResultsFiles: '$(Build.SourcesDirectory)\ccReport\codeCoverage.xml'
testRunTitle: 'pwsh_ubuntuLatest'
displayName: 'Publish Test Results'

- job: build_pwsh_macOSLatest
pool:
vmImage: macOS-latest
steps:
- script: |
brew update
brew tap caskroom/cask
brew cask install powershell
displayName: 'Install PowerShell Core'
- script: |
pwsh -c '$PSVersionTable;.\actions_bootstrap.ps1;Invoke-Build -File $(Build.SourcesDirectory)/src/Javinizer.build.ps1'
displayName: 'Build and Test'
- task: PublishTestResults@2
inputs:
testRunner: 'NUnit'
testResultsFiles: '$(Build.SourcesDirectory)\ccReport\codeCoverage.xml'
testRunTitle: 'pwsh_macOSLatest'
displayName: 'Publish Test Results'
2 changes: 1 addition & 1 deletion src/Javinizer/Javinizer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Version number of this module.

ModuleVersion = '2.2.1'
ModuleVersion = '2.2.2'

# Supported PSEditions
# CompatiblePSEditions = @('Core')
Expand Down
1 change: 1 addition & 0 deletions src/Javinizer/Private/Convert-JVString.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function Convert-JVString {
[PSObject]$Data,

[Parameter(Mandatory = $true)]
[AllowEmptyString()]
[String]$FormatString,

[Parameter()]
Expand Down
22 changes: 14 additions & 8 deletions src/Javinizer/Private/Scraper.Dmm.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
function Get-DmmContentId {
param (
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
[Object]$Webrequest
[String]$Url
)

process {
try {
$contentId = (((($Webrequest.Content -split '<td align="right" valign="top" class="nw">(品番:|Movie Number:)<\/td>')[2] -split '\/td>')[0]) | Select-String -Pattern '>(.*)<').Matches.Groups[1].Value
$contentId = ($Url | Select-String -Pattern 'cid=(.*)(\/)?').Matches.Groups[1].Value
} catch {
return
}
Expand All @@ -17,22 +17,28 @@ function Get-DmmContentId {
function Get-DmmId {
param (
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
[Object]$Webrequest
[String]$Url
)

process {
try {
# Expects ###ID##### or ID#####
$contentId = Get-DmmContentId $Webrequest
$m = ($contentId | Select-String -Pattern '\d*([a-z]+)(\d+)(.*)$' -AllMatches).Matches
$contentId = Get-DmmContentId -Url $Url

try {
$m = ($contentId | Select-String -Pattern '\d*([a-z]+)(\d+)(.*)$' -AllMatches).Matches
} catch {
return
}

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') + $m.Groups[3].Value.ToUpper()
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') + $m.Groups[3].Value.ToUpper()
}

} catch {
return
}
Write-Output $Id
Write-Output $id
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Javinizer/Public/Get-DmmData.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ function Get-DmmData {
$movieDataObject = [PSCustomObject]@{
Source = if ($Url -match '/en/') { 'dmm' } else { 'dmmja' }
Url = $Url
Id = Get-DmmId -WebRequest $webRequest
ContentId = Get-DmmContentId -WebRequest $webRequest
Id = Get-DmmId -Url $Url
ContentId = Get-DmmContentId -Url $Url
Title = Get-DmmTitle -WebRequest $webRequest
Description = Get-DmmDescription -WebRequest $webRequest
ReleaseDate = Get-DmmReleaseDate -WebRequest $webRequest
Expand Down
8 changes: 4 additions & 4 deletions src/Javinizer/Public/Get-DmmUrl.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ function Get-DmmUrl {

$count = 1
foreach ($result in $searchResults) {
try {
<# try {
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" -Action 'Continue'
}
} #>

$resultId = Get-DmmContentId -WebRequest $webRequest
$resultId = Get-DmmId -Url $result
Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$originalId] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]"
if ($resultId -match "^(.*_)?\d*$Id") {
if ($resultId -eq "$Id") {
$directUrl = $result
break
}
Expand Down
2 changes: 1 addition & 1 deletion src/Javinizer/Public/Get-JVItem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function Get-JVItem {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0)]
[String]$Path,
[System.IO.FileInfo]$Path,

[Parameter()]
[Switch]$Recurse,
Expand Down
25 changes: 12 additions & 13 deletions src/Javinizer/Public/Javinizer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@ function Javinizer {
[Parameter(ParameterSetName = 'Nfo', Position = 0)]
[Parameter(ParameterSetName = 'Javlibrary', Position = 0)]
[AllowEmptyString()]
[String]$Path,
[System.IO.FileInfo]$Path,

[Parameter(ParameterSetName = 'Path', Position = 1)]
[AllowEmptyString()]
[String]$DestinationPath,
[System.IO.DirectoryInfo]$DestinationPath,

[Parameter(ParameterSetName = 'Path')]
[Parameter(ParameterSetName = 'Nfo')]
Expand Down Expand Up @@ -804,10 +804,12 @@ function Javinizer {
}

'Path' {
# Default path to location.input in settings if not specified
if (!($Path)) {
$Path = $Settings.'location.input'
if ($null -eq $Path -or $Path -eq '') {
try {
# Default path to location.input in settings if not specified
$Path = $Settings.'location.input'
} catch {
# Default path to the current directory if settings not specified
$Path = (Get-Location).Path
}
}
Expand All @@ -817,19 +819,16 @@ function Javinizer {
Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Path [$Path] is not a valid path"
}

# Default destination path to location.output in settings if not specified
if (!($DestinationPath)) {
$DestinationPath = $Settings.'location.output'
if ($null -eq $DestinationPath -or $DestinationPath -eq '') {
try {
# Default destination path to location.output in settings if not specified
$DestinationPath = $Settings.'location.output'
} catch {
# Default destination path to the current directory if settings not specified
$DestinationPath = (Get-Item -LiteralPath $Path).Directory
}
}

# This will check that the DestinationPath is a valid directory
if (Test-Path -LiteralPath $DestinationPath -PathType Leaf) {
Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$($MyInvocation.MyCommand.Name)] DestinationPath [$DestinationPath] is not a valid directory path"
}

try {
$javMovies = $Settings | Get-JVItem -Path $Path -MinimumFileSize $Settings.'match.minimumfilesize' -RegexEnabled:$Settings.'match.regex' -RegexString $Settings.'match.regex.string' -RegexIdMatch $Settings.'match.regex.idmatch' -RegexPtMatch $Settings.'match.regex.ptmatch' -Recurse:$Recurse -Depth:$Depth -Strict:$Strict
} catch {
Expand Down
2 changes: 1 addition & 1 deletion src/Javinizer/jvSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"sort.download.actressimg": false,
"sort.download.thumbimg": true,
"sort.download.posterimg": true,
"sort.download.screenshotimg": true,
"sort.download.screenshotimg": false,
"sort.download.trailervid": false,
"sort.format.groupactress": true,
"sort.format.delimiter": ", ",
Expand Down
39 changes: 39 additions & 0 deletions src/Javinizer/jvThumbs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10296,3 +10296,42 @@
"Tanaka Miya","Tanaka","Miya","田中美矢","https://pics.r18.com/mono/actjpgs/tanaka_miya.jpg",
"Yuki Urara","Yuki","Urara","優希うらら","https://pics.r18.com/mono/actjpgs/yuuki_urara.jpg",
"Yuki Yume","Yuki","Yume","柚木結愛","https://pics.r18.com/mono/actjpgs/yuzuki_yua.jpg",
"Amakawa Meru","Amakawa","Meru","天河める","https://pics.r18.com/mono/actjpgs/amakawa_meru.jpg",
"Amatsuka Amu","Amatsuka","Amu","あまつか亜夢","https://pics.r18.com/mono/actjpgs/amatuka_amu.jpg",
"Aota Nozomi","Aota","Nozomi","青田のぞみ","https://pics.r18.com/mono/actjpgs/aota_nozomi2.jpg",
"Hanamaru Kurumi","Hanamaru","Kurumi","花丸くるみ","https://pics.r18.com/mono/actjpgs/hanamaru_kurumi.jpg",
"Nichinan Haru","Nichinan","Haru","日南はる","https://pics.r18.com/mono/actjpgs/hinami_haru.jpg",
"Hirose Azusa","Hirose","Azusa","広瀬梓","https://pics.r18.com/mono/actjpgs/hirose_azusa.jpg",
"Futami Rei","Futami","Rei","二見れい","https://pics.r18.com/mono/actjpgs/hutami_rei.jpg",
"Kamiki Sara","Kamiki","Sara","神木サラ","https://pics.r18.com/mono/actjpgs/kamiki_sara.jpg",
"Kano Ai","Kano","Ai","叶愛","https://pics.r18.com/mono/actjpgs/kanou_ai3.jpg",
"Kitagawa Mayuka","Kitagawa","Mayuka","北川真由香","https://pics.r18.com/mono/actjpgs/kitagawa_mayuka.jpg",
"Kurusu Sumire","Kurusu","Sumire","来栖すみれ","https://pics.r18.com/mono/actjpgs/kurusu_sumire.jpg",
"Maina Miku","Maina","Miku","舞奈みく","https://pics.r18.com/mono/actjpgs/maina_miku2.jpg",
"Makino Shion","Makino","Shion","牧野詩音","https://pics.r18.com/mono/actjpgs/makino_sion.jpg",
"Mamiya Aya","Mamiya","Aya","真宮あや","https://pics.r18.com/mono/actjpgs/mamiya_aya.jpg",
"Mitsumoto Sayuri","Mitsumoto","Sayuri","光本小百合","https://pics.r18.com/mono/actjpgs/mitumoto_sayuri.jpg",
"Mizuni Natsuki","Mizuni","Natsuki","水乃渚月","https://pics.r18.com/mono/actjpgs/mizuno_natuki.jpg",
"Momota Kaori","Momota","Kaori","桃田香織","https://pics.r18.com/mono/actjpgs/momota_kaori.jpg",
"Morishita Mariko","Morishita","Mariko","森下まりこ","https://pics.r18.com/mono/actjpgs/morisita_mariko.jpg",
"Nonoka",,"Nonoka","ののか","https://pics.r18.com/mono/actjpgs/nonoka.jpg",
"Remi",,"Remi","REMI","https://pics.r18.com/mono/actjpgs/remi.jpg",
"Sakune Rio","Sakune","Rio","咲音リオ","https://pics.r18.com/mono/actjpgs/sakune_rio.jpg",
"Sakuragi Nae","Sakuragi","Nae","桜木なえ","https://pics.r18.com/mono/actjpgs/sakuragi_nae.jpg",
"Sato Hana","Sato","Hana","佐藤花","https://pics.r18.com/mono/actjpgs/sato_hana.jpg",
"Shinohara Riko","Shinohara","Riko","篠原りこ","https://pics.r18.com/mono/actjpgs/sinohara_riko.jpg",
"Yota Chan","Yota","Chan","ちゃんよた","https://pics.r18.com/mono/actjpgs/tyanyota.jpg",
"Yaotome Nana","Yaotome","Nana","八乙女なな","https://pics.r18.com/mono/actjpgs/yaotome_nana.jpg",
"Yumiyo Kurumi","Yumiyo","Kurumi","唯名くるみ","https://pics.r18.com/mono/actjpgs/yuina_kurumi.jpg",
"Fujisawa Reo","Fujisawa","Reo","藤沢麗央","https://pics.r18.com/mono/actjpgs/huzisawa_reo.jpg",
"Ichiki Mahiro","Ichiki","Mahiro","市来まひろ","https://pics.r18.com/mono/actjpgs/itiki_mahiro.jpg",
"Kotoishi Yumeru","Kotoishi","Yumeru","琴石ゆめる","https://pics.r18.com/mono/actjpgs/kotoisi_yumeru.jpg",
"Murata Raimu","Murata","Raimu","村田来夢","https://pics.r18.com/mono/actjpgs/murata_ramu.jpg",
"Nanashima Toai","Nanashima","Toai","七嶋十愛","https://pics.r18.com/mono/actjpgs/nanasima_toa.jpg",
"Sakurai Mami","Sakurai","Mami","櫻井まみ","https://pics.r18.com/mono/actjpgs/sakurai_mami2.jpg",
"Sezuki Shuka","Sezuki","Shuka","瀬月秋華","https://pics.r18.com/mono/actjpgs/seduki_syuuka.jpg",
"Takase Rina","Takase","Rina","高瀬りな","https://pics.r18.com/mono/actjpgs/takase_rina2.jpg",
"Tsukishima Sakura","Tsukishima","Sakura","月島さくら","https://pics.r18.com/mono/actjpgs/tukisima_sakura.jpg",
"Hatsuai Nene","Hatsuai","Nene","初愛ねんね","https://pics.r18.com/mono/actjpgs/ui_nenne.jpg",
"Yamazaki Mizuai","Yamazaki","Mizuai","山崎水愛","https://pics.r18.com/mono/actjpgs/yamazaki_akua.jpg",
"Yuki Riho","Yuki","Riho","悠木りほ","https://pics.r18.com/mono/actjpgs/yuuki_riho.jpg",

0 comments on commit 838e83e

Please sign in to comment.