Skip to content

Commit

Permalink
Fixed Dmm Age Check
Browse files Browse the repository at this point in the history
  • Loading branch information
seeyabye committed Jan 9, 2025
1 parent a862bac commit b26a1d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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.5.17'
ModuleVersion = '2.5.18'

# Supported PSEditions
# CompatiblePSEditions = @('Core')
Expand Down
9 changes: 8 additions & 1 deletion src/Javinizer/Public/Get-DmmUrl.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ function Get-DmmUrl {
)

process {
$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$cookie = New-Object System.Net.Cookie
$cookie.Name = 'age_check_done'
$cookie.Value = '1'
$cookie.Domain = 'dmm.co.jp'
$session.Cookies.Add($cookie)

# The digital/videoa URL is not being caught by the html for movie IDs matching '0001 - 0009'
# Convert the movie Id (ID-###) to content Id (ID00###) to match dmm naming standards
if (!($Strict)) {
Expand All @@ -30,7 +37,7 @@ function Get-DmmUrl {

try {
Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]"
$webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false
$webRequest = Invoke-WebRequest -Uri $searchUrl -WebSession $session -Method Get -Verbose:$false
} catch {
Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" -Action 'Continue'
}
Expand Down

0 comments on commit b26a1d8

Please sign in to comment.