param( [parameter(mandatory=$true)] [string]$seriesId, [switch]$completeSeries, [string]$seriesName, [string]$outputFolder=(Resolve-Path .), [int]$startChapter=1, [int]$endChapter=$startChapter ) ### Init ### $baseUrl = "https://www.mangareader.net" $usedVarsDownloadChapter = @("chapterNr", "outputPath", "chapterUrl", "chapterBaseHtml", "chapterPattern", "chapterPages", "chapterPage") $usedVarsForeachChapterPage = @("pageUrl", "pageFormat", "pageHtml") $usedVarsCurrentChapter = @("chapterFormat", "chapterPath", "ebookName") ### Functions ### Function DownloadChapter($chapterNr,$outputPath){ $chapterUrl = "${seriesUrl}/${chapterNr}" $chapterBaseHtml = Invoke-WebRequest -UseBasicParsing -Uri $chapterUrl # Download first image, continue afterwards Invoke-WebRequest -UseBasicParsing -Uri $chapterBaseHtml.Images.src -OutFile (Join-Path -Path $outputPath -ChildPath "01.jpg") #"${outputPath}\01.jpg" # evaluate regex $chapterPattern = '(?<=