Skip to content

Commit

Permalink
Move iFrameUrl to try block
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Sep 21, 2020
1 parent 3aa698e commit 734b294
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Javinizer/Private/Scraper.Dmm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ function Get-DmmTrailerUrl {

process {
$trailerUrl = @()
$iFrameUrl = 'https://www.dmm.co.jp' + ($Webrequest.Content | Select-String -Pattern "onclick.+sampleplay\('([^']+)'\)").Matches.Groups[1].Value
try {
$iFrameUrl = 'https://www.dmm.co.jp' + ($Webrequest.Content | Select-String -Pattern "onclick.+sampleplay\('([^']+)'\)").Matches.Groups[1].Value
$trailerPageUrl = ((Invoke-WebRequest -Uri $iFrameUrl -WebSession $session -Verbose:$false).Content | Select-String -Pattern 'src="([^"]+)"').Matches.Groups[1].Value -replace '/en', ''
$trailerUrl = ((Invoke-WebRequest -Uri $trailerPageUrl -Verbose:$false).Content | Select-String -Pattern '\\/\\/cc3001\.dmm\.co\.jp\\/litevideo\\/freepv[^"]+').Matches.Groups[0].Value -replace '\\', ''
if ($trailerUrl -match '^//') {
Expand All @@ -415,4 +415,3 @@ function Get-DmmTrailerUrl {
Write-Output "https:$trailerUrl"
}
}

0 comments on commit 734b294

Please sign in to comment.