mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-06-20 22:21:09 +10:00
Added disabling podcasts (optional)
This commit is contained in:
+35
@@ -16,6 +16,7 @@ Write-Host "*****************"
|
|||||||
|
|
||||||
$SpotifyDirectory = "$env:APPDATA\Spotify"
|
$SpotifyDirectory = "$env:APPDATA\Spotify"
|
||||||
$SpotifyExecutable = "$SpotifyDirectory\Spotify.exe"
|
$SpotifyExecutable = "$SpotifyDirectory\Spotify.exe"
|
||||||
|
$Podcasts_off = $false
|
||||||
|
|
||||||
|
|
||||||
Stop-Process -Name Spotify
|
Stop-Process -Name Spotify
|
||||||
@@ -158,6 +159,28 @@ Remove-Item -Recurse -LiteralPath $tempDirectory
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
do {
|
||||||
|
$ch = Read-Host -Prompt "Want to turn off podcasts ? (Y/N)"
|
||||||
|
if (!($ch -eq 'n' -or $ch -eq 'y')) {
|
||||||
|
|
||||||
|
Write-Host "Oops, an incorrect value, " -ForegroundColor Red -NoNewline
|
||||||
|
Write-Host "enter again through..." -NoNewline
|
||||||
|
Start-Sleep -Milliseconds 1000
|
||||||
|
Write-Host "3" -NoNewline
|
||||||
|
Start-Sleep -Milliseconds 1000
|
||||||
|
Write-Host ".2" -NoNewline
|
||||||
|
Start-Sleep -Milliseconds 1000
|
||||||
|
Write-Host ".1"
|
||||||
|
Start-Sleep -Milliseconds 1000
|
||||||
|
Clear-Host
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while ($ch -notmatch '^y$|^n$')
|
||||||
|
if ($ch -eq 'y') { $Podcasts_off = $true }
|
||||||
|
|
||||||
|
|
||||||
# Мофифицируем файлы
|
# Мофифицируем файлы
|
||||||
|
|
||||||
$xpui_spa_patch = "$env:APPDATA\Spotify\Apps\xpui.spa"
|
$xpui_spa_patch = "$env:APPDATA\Spotify\Apps\xpui.spa"
|
||||||
@@ -182,6 +205,12 @@ If (Test-Path $xpui_js_patch) {
|
|||||||
<# Removing "Upgrade to premium" menu #> -replace 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.', $menu_split_js `
|
<# Removing "Upgrade to premium" menu #> -replace 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.', $menu_split_js `
|
||||||
<# Disabling a playlist sponsor #> -replace "allSponsorships", ""
|
<# Disabling a playlist sponsor #> -replace "allSponsorships", ""
|
||||||
|
|
||||||
|
# Disable Podcast
|
||||||
|
if ($Podcasts_off) {
|
||||||
|
$new_js = $new_js `
|
||||||
|
-replace '"album,playlist,artist,show,station,episode"', '"album,playlist,artist,station"' -replace ',this[.]enableShows=[a-z]', ""
|
||||||
|
}
|
||||||
|
|
||||||
Set-Content -Path $xpui_js_patch -Force -Value $new_js
|
Set-Content -Path $xpui_js_patch -Force -Value $new_js
|
||||||
add-content -Path $xpui_js_patch -Value '// Patched by SpotX' -passthru | Out-Null
|
add-content -Path $xpui_js_patch -Value '// Patched by SpotX' -passthru | Out-Null
|
||||||
$contentjs = [System.IO.File]::ReadAllText($xpui_js_patch)
|
$contentjs = [System.IO.File]::ReadAllText($xpui_js_patch)
|
||||||
@@ -232,6 +261,12 @@ If (Test-Path $xpui_spa_patch) {
|
|||||||
<# Disabling a playlist sponsor #> -replace "allSponsorships", "" `
|
<# Disabling a playlist sponsor #> -replace "allSponsorships", "" `
|
||||||
<# Disable Logging #> -replace "sp://logging/v3/\w+", ""
|
<# Disable Logging #> -replace "sp://logging/v3/\w+", ""
|
||||||
|
|
||||||
|
# Disable Podcast
|
||||||
|
if ($Podcasts_off) {
|
||||||
|
$xpuiContents = $xpuiContents `
|
||||||
|
-replace '"album,playlist,artist,show,station,episode"', '"album,playlist,artist,station"' -replace ',this[.]enableShows=[a-z]', ""
|
||||||
|
}
|
||||||
|
|
||||||
$writer = New-Object System.IO.StreamWriter($entry_xpui.Open())
|
$writer = New-Object System.IO.StreamWriter($entry_xpui.Open())
|
||||||
$writer.BaseStream.SetLength(0)
|
$writer.BaseStream.SetLength(0)
|
||||||
$writer.Write($xpuiContents)
|
$writer.Write($xpuiContents)
|
||||||
|
|||||||
Reference in New Issue
Block a user