Skip to content

Commit

Permalink
Conform jav321 scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Sep 7, 2020
1 parent d7f64d1 commit a1459a9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 30 deletions.
24 changes: 11 additions & 13 deletions src/Javinizer/Private/Scraper.Jav321.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,22 @@ function Get-Jav321Actress {
)

process {
$movieActressObject = @()
$actress = @()

try {
$actress = ($Webrequest | ForEach-Object { $_ -split '\n' } |
Select-String '<a href="\/star\/(.*)\/(.*)">(.*)<\/a>によって行われる<\/div>').Matches |
ForEach-Object { $_.Groups[3].Value } |
Where-Object { $_ -ne '' }

$actressThumb = ($Webrequest | ForEach-Object { $_ -split '\n' } |
Select-String '<div class="thumbnail"><a href="/star\/(.*)\/(.*)"><img class="img-responsive" src="(.*)" onerror').Matches |
ForEach-Object { $_.Groups[3].Value } |
Where-Object { $_ -ne '' }
$actress = $Webrequest -split '<div class="thumbnail">' |
ForEach-Object { ($_ | Select-String -Pattern 'https:\/\/www\.jav321\.com\/mono\/actjpgs\/(.*)">(.*)<\/a><\/div>') }

$actress | ForEach-Object { $movieActressObject += [PSCustomObject]@{
LastName = $null
FirstName = $null
JapaneseName = ($_.Matches.Groups[2].Value)
ThumbUrl = if (($_.Matches.Groups[1].Value -replace "'", '') -ne '.jpg') { 'https://www.jav321.com/mono/actjpgs/' + $_.Matches.Groups[1].Value -replace "'", '' }
}
}


$movieActressObject = [PSCustomObject]@{
Name = $actress
ThumbUrl = $actressThumb
}
} catch {
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/Javinizer/Private/Test-JVSettings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function Test-JVSettings {
'javlibrary.request.timeout',
'match.regex',
'scraper.movie.dmm',
'scraper.movie.jav321',
'scraper.movie.jav321ja',
'scraper.movie.javbus',
'scraper.movie.javbusja',
'scraper.movie.javbuszh',
Expand Down
4 changes: 2 additions & 2 deletions src/Javinizer/Public/Get-JVData.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function Get-JVData {
[Boolean]$JavbusZh,

[Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')]
[Alias('scraper.movie.jav321')]
[Alias('scraper.movie.jav321ja')]
[Boolean]$Jav321,

[Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Id')]
Expand All @@ -68,7 +68,7 @@ function Get-JVData {
} elseif ($Settings) {
$R18 = $Settings.'scraper.movie.r18'
$R18Zh = $Settings.'scraper.movie.r18zh'
$Jav321 = $Settings.'scraper.movie.jav321'
$Jav321 = $Settings.'scraper.movie.jav321ja'
$Javlibrary = $Settings.'scraper.movie.javlibrary'
$JavlibraryJa = $Settings.'scraper.movie.javlibraryja'
$JavlibraryZh = $Settings.'scraper.movie.javlibraryzh'
Expand Down
25 changes: 12 additions & 13 deletions src/Javinizer/Public/Get-Jav321Data.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ function Get-Jav321Data {
}

$movieDataObject = [PSCustomObject]@{
Source = 'jav321'
Url = $Url
Id = Get-Jav321Id -WebRequest $webRequest
Title = Get-Jav321Title -WebRequest $webRequest
ReleaseDate = Get-Jav321ReleaseDate -WebRequest $webRequest
ReleaseYear = Get-Jav321ReleaseYear -WebRequest $webRequest
Runtime = Get-Jav321Runtime -WebRequest $webRequest
Maker = Get-Jav321Maker -WebRequest $webRequest
Actress = (Get-Jav321Actress -WebRequest $webRequest).Name
ActressThumbUrl = (Get-Jav321Actress -WebRequest $webRequest).ThumbUrl
Genre = Get-Jav321Genre -WebRequest $webRequest
CoverUrl = Get-Jav321CoverUrl -WebRequest $webRequest
ScreenshotUrl = Get-Jav321ScreenshotUrl -WebRequest $webRequest
Source = 'jav321'
Url = $Url
Id = Get-Jav321Id -WebRequest $webRequest
Title = Get-Jav321Title -WebRequest $webRequest
ReleaseDate = Get-Jav321ReleaseDate -WebRequest $webRequest
ReleaseYear = Get-Jav321ReleaseYear -WebRequest $webRequest
Runtime = Get-Jav321Runtime -WebRequest $webRequest
Maker = Get-Jav321Maker -WebRequest $webRequest
Actress = Get-Jav321Actress -WebRequest $webRequest
Genre = Get-Jav321Genre -WebRequest $webRequest
CoverUrl = Get-Jav321CoverUrl -WebRequest $webRequest
ScreenshotUrl = Get-Jav321ScreenshotUrl -WebRequest $webRequest
}

Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "Jav321 data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)"
Expand Down
2 changes: 1 addition & 1 deletion src/Javinizer/jvSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"location.genrecsv": "",
"location.log": "",
"scraper.movie.dmm": 1,
"scraper.movie.jav321": 0,
"scraper.movie.jav321ja": 0,
"scraper.movie.javbus": 0,
"scraper.movie.javbusja": 0,
"scraper.movie.javbuszh": 0,
Expand Down

0 comments on commit a1459a9

Please sign in to comment.