Skip to content

Mahtwo/KHDownloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

159 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KHDownloader

Unofficial PowerShell Core script to download albums from KHInsider, with robust resume functionality.

Installation

KHDownloader is available on the PowerShell Gallery! To install or update KHDownloader, run the following command:

Install-PSResource -Name khd

Additionally, to make khd executable without requiring the /full/path/to/khd.ps1, run the following command:

& {
	$khdInstallLocation = (Get-InstalledPSResource -Name khd).InstalledLocation
	if ($env:PATH -notmatch $khdInstallLocation -and
		$Host.UI.PromptForChoice(
			'Add script directory to PowerShell PATH environment variable?',
			"This makes `"khd`" executable without requiring the full path `"$khdInstallLocation$([System.IO.Path]::DirectorySeparatorChar)khd.ps1`"",
			('&Yes','&No'),
			0
		) -eq 0
	) {
		# Create directories to $PROFILE.CurrentUserAllHosts if they don't exist
		$dir = Split-Path $PROFILE.CurrentUserAllHosts -Parent
		if (-not (Test-Path $dir)) {
			New-Item -ItemType Directory -Path $dir -Force > $null
		}
		Add-Content -LiteralPath $PROFILE.CurrentUserAllHosts -Value ('$env:PATH = "' + $khdInstallLocation + [System.IO.Path]::PathSeparator + '$env:PATH"')
		# Add it to current session PATH too
		$env:PATH = $khdInstallLocation + [System.IO.Path]::PathSeparator + $env:PATH
	}
}

You can then simply run the script:

khd -Url ...

Note

Use khd.ps1 outside of a PowerShell session

For more informations see the latest release.

Third-party licenses

The following third-party assets, including any minor modifications, remain under their original licenses:

About

Unofficial PowerShell Core script to download albums from KHInsider, with robust resume functionality

Topics

Resources

License

Stars

Watchers

Forks

Contributors