Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jav321 screenshots not grabbing - Solution #346

Closed
NewMember12345 opened this issue Sep 3, 2022 · 0 comments
Closed

jav321 screenshots not grabbing - Solution #346

NewMember12345 opened this issue Sep 3, 2022 · 0 comments

Comments

@NewMember12345
Copy link

NewMember12345 commented Sep 3, 2022

As of recent, jav321 scrapes are not grabbing the screenshot url.

Reason: Jav321 added more code into the screenshot html.
max-width="100%"

Add this code into Scraper.Jav321.ps1 in /PRIVATE

example:

function Get-Jav321CoverUrl {
    param (
        [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
        [Object]$Webrequest
    )

    process {
        try {
            $coverUrl = ((($Webrequest | Select-String -Pattern '"/snapshot/(.*)/\d/0"><img class="img-responsive" max-width="100%" src="(.*)"').Matches.Groups[2].Value -split '" onerror')[0] -split '"></a>')[0].Trim()
        } catch {
            return
        }

        Write-Output $coverUrl
    }
}

function Get-Jav321ScreenshotUrl {
    param (
        [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
        [Object]$Webrequest
    )

    process {
        $screenshotUrl = @()

        try {
            $screenshotUrl = (($Webrequest | ForEach-Object { $_ -split '\n' } |
                    Select-String -Pattern '<a href="\/snapshot\/(.*)\/(.*)\/(.*)"><img class="img-responsive" max-width="100%" src="(.*)"') -split "src=\'" |
                Select-String -Pattern "(https:\/\/www.jav321.com\/digital\/video\/(.*)\/(.*).jpg)(.*)<\/a>").Matches |
            ForEach-Object { $_.Groups[1].Value }
        } catch {
            try {
                $screenshotUrl = (($Webrequest | ForEach-Object { $_ -split '\n' } |
                        Select-String -Pattern '<a href="\/snapshot/(.*)\/(.*)\/(.*)"><img class="img-responsive" max-width="100%"') -split 'src="' |
                    Select-String -Pattern '(https:\/\/www.jav321.com\/\/images\/(.*)\/(.*)\/(.*)\/(.*).jpg)"><\/a><\/p>').Matches |
                ForEach-Object { $_.Groups[1].Value }
            } catch {
                return
            }
        }

        Write-Output $screenshotUrl
    }
}
seeyabye added a commit to seeyabye/Javinizer that referenced this issue Feb 15, 2023
seeyabye added a commit to seeyabye/Javinizer that referenced this issue Feb 15, 2023
seeyabye added a commit to seeyabye/Javinizer that referenced this issue Feb 15, 2023
seeyabye added a commit to seeyabye/Javinizer that referenced this issue Feb 15, 2023
seeyabye added a commit to seeyabye/Javinizer that referenced this issue Feb 15, 2023
seeyabye added a commit that referenced this issue Feb 15, 2023
seeyabye added a commit that referenced this issue Feb 15, 2023
seeyabye added a commit that referenced this issue Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants