Skip to content

Commit

Permalink
version bump to 1.1.97.962
Browse files Browse the repository at this point in the history
 - fixed minor patch bugs for 97
 - fixed attribute for "past lyrics"
  • Loading branch information
amd64fox committed Oct 26, 2022
1 parent c29b1c0 commit 2fb07f9
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 125 deletions.
221 changes: 97 additions & 124 deletions Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,10 @@ if (!($cache_on) -and !($cache_off)) {
if ($exp_standart) { Write-Host ($lang).ExpStandart`n }
if ($exp_spotify) { Write-Host ($lang).ExpSpotify`n }

function Helper($paramname, $addstring) {
$url = "https://raw.githubusercontent.com/SpotX-CLI/SpotX-commons/main/patches.json"
$webjson = (Invoke-WebRequest -UseBasicParsing -Uri $url).Content | ConvertFrom-Json
$ofline = Check_verison_clients -param2 "offline"
function Helper($paramname) {

switch ( $paramname ) {
"HtmlLicMin" {
Expand All @@ -923,98 +926,51 @@ function Helper($paramname, $addstring) {
"Lyrics-color" {
# Static color for lyrics (xpui-routes-lyrics.css)

$pasttext = "#ffffff4a", "#ffffffb8", "#ffffff6b", "#E40909B3"
$current = "#ffffffc7", "#ffffffc7", "#ffffffc7", "#C2C2C2"
$next = "#ffffff4a", "#322319", "#2e080b", "#CA861A"
$hover = "#ffffffc7", "#ffffffc7", "#ffffffc7", "#0FD40F"
$background = "#121212", "#956b4b", "#c62736f2", "#121212"
$maxmatch = "#ffffff94", "#322319", "#2e080b", "#C2C2C2"
$webjson.others.lyricscolor.replace[0] = '$1' + $webjson.others.lyricscolor.theme.$lyrics_stat.pasttext
$webjson.others.lyricscolor.replace[1] = '$1' + $webjson.others.lyricscolor.theme.$lyrics_stat.current
$webjson.others.lyricscolor.replace[2] = '$1' + $webjson.others.lyricscolor.theme.$lyrics_stat.next
$webjson.others.lyricscolor.replace[3] = '$1' + $webjson.others.lyricscolor.theme.$lyrics_stat.hover
$webjson.others.lyricscolor.replace[4] = $webjson.others.lyricscolor.theme.$lyrics_stat.background
$webjson.others.lyricscolor.replace[5] = '$1' + $webjson.others.lyricscolor.theme.$lyrics_stat.maxmatch

switch ($lyrics_stat) {
1 {
$pasttextR = $pasttext[0]; $currentR = $current[0]; $nextR = $next[0]; $hoverR = $hover[0]; $backgroundR = $background[0]; $maxmatchR = $maxmatch[0]
}
2 {
$pasttextR = $pasttext[1]; $currentR = $current[1]; $nextR = $next[1]; $hoverR = $hover[1]; $backgroundR = $background[1]; $maxmatchR = $maxmatch[1]
}
3 {
$pasttextR = $pasttext[2]; $currentR = $current[2]; $nextR = $next[2]; $hoverR = $hover[2]; $backgroundR = $background[2]; $maxmatchR = $maxmatch[2]
}
4 {
$pasttextR = $pasttext[3]; $currentR = $current[3]; $nextR = $next[3]; $hoverR = $hover[3]; $backgroundR = $background[3]; $maxmatchR = $maxmatch[3]
}
Default {
$pasttextR = $pasttext[0]; $currentR = $current[0]; $nextR = $next[0]; $hoverR = $hover[0]; $backgroundR = $background[0]; $maxmatchR = $maxmatch[0]
}

}
$lyrics = @{
pasttext = '(H2J92dVdr0ykdOX5azL1{color:)var\(--lyrics-color-active\)', "`$1$pasttextR"
current = '((TDPh45khCfG51fNwNIiw|E64X_eoy6xsJmDdKKHja){color:)var\(--lyrics-color-active\)', "`$1$currentR"
next = '(NHVfxGs2HwmI_fly2JC4{color:)var\(--lyrics-color-inactive\)' , "`$1$nextR"
hover = '(NHVfxGs2HwmI_fly2JC4:hover{color:)var\(--lyrics-color-active\)' , "`$1$hoverR"
background = 'var\(--lyrics-color-background\)', $backgroundR
maxmatch = '(iq4cgi0YEKr6DGaTtzUj{color:)var\(--lyrics-color-inactive\)', "`$1$maxmatchR"
}
$n = ($lang).NoVariable6
$contents = $lyrics
$contents = "lyricscolor"
$json = $webjson.others
$paramdata = $xpui_lyrics

}
"Discriptions" {
# Add discriptions (xpui-desktop-modals.js)
$discript = @{
Log = '((..createElement|children:\(.{1,7}\))\(....,{source:).....get\("about.copyright",.\),paragraphClassName:.}\)', "`$1`"<h3>More about SpotX</h3><a href=`'https://github.com/SpotX-CLI/SpotX-Win`'>Github</a><br/><a href=`'https://telegra.ph/SpotX-FAQ-09-19`'>FAQ</a><br/><a href=`'https://t.me/spotify_windows_mod`'>Telegram channel</a><br/><a href=`'https://github.com/SpotX-CLI/SpotX-Win/issues/new?assignees=&labels=%E2%9D%8C+bug&template=bug_report.yml`'>Create an issue report</a><br> <br/><h4>DISCLAIMER</h4>SpotX is a modified version of the official Spotify client, provided as an evaluation version, you use it at your own risk.`"})"
}
$n = ($lang).NoVariable6
$contents = $discript
$contents = "discriptions"
$json = $webjson.others
$paramdata = $xpui_desktop_modals

}
"OffadsonFullscreen" {
$offadson_fullscreen = @{
# Removing a billboard on the homepage
Bilboard = '.(\?\[.{1,6}[a-zA-Z].leaderboard,)', 'false$1'
# Removing audio ads
AudioAds = '(case .:)return this.enabled=...+?(;case .:this.subscription=this.audioApi).+?(;case .)', '$1$2.cosmosConnector.increaseStreamTime(-100000000000)$3'
# Removing an empty block
EmptyBlockAd = 'adsEnabled:!0', 'adsEnabled:!1'
# Fullscreen act., removing upgrade menu, button
FullScreenAd = '(return|.=.=>)"free"===(.+?)(return|.=.=>)"premium"===', '$1"premium"===$2$3"free"==='
# Disabling a playlist sponsor
PlaylistSponsorsOff = 'allSponsorships', ''
# Connect unlock test for 1.1.91 >
ConnectUnlock = ' connect-device-list-item--disabled', ''
ConnectUnlock2 = 'connect-picker.unavailable-to-control', 'spotify-connect'
ConnectUnlock3 = '(className:.,disabled:)(..)', '$1false'
ConnectUnlock4 = 'return (..isDisabled)(\?(..createElement|\(.{1,10}\))\(..,)', 'return false$2'
# Removing the track download quality switch
DownloadQuality = '(\(.,..jsxs\)\(.{1,3}|..createElement\(.{1,4}),{filterMatchQuery:.{1,6}get\("desktop.settings.downloadQuality.title.+?(children:.{1,2}\(.,.\).+?,|xe\(.,.\).+?,)', ''
}
if ($bts) {
$offadson_fullscreen.Remove('Bilboard'), $offadson_fullscreen.Remove('AudioAds')
}

if ($bts) { $webjson.free.psobject.properties.remove('bilboard'), $webjson.free.psobject.properties.remove('audioads') }

$webjson.free.psobject.properties.remove('submenudownload'), $webjson.free.psobject.properties.remove('veryhighstream'), $webjson.free.psobject.properties.remove('downloadicon')

$n = ($lang).NoVariable2
$contents = $offadson_fullscreen
$contents = $webjson.free.psobject.properties.name
$json = $webjson.free
$paramdata = $xpui_js
}
"OffPodcasts" {
# Turn off podcasts
$podcasts_off = @{
PodcastsOff = '(\!Array.isArray\(.\)\|\|.===..length)', "`$1||e.children[0].key.includes('episode')||e.children[0].key.includes('show')"
}
$n = ($lang).NoVariable5
$contents = $podcasts_off
if ($ofline -le "1.1.96.785") { $podcats = "podcastsoff2" }
if ($ofline -ge "1.1.97.952") { $podcats = "podcastsoff3" }
$contents = $podcats
$json = $webjson.others
$paramdata = $xpui_homev2
}
"OffRujs" {
# Remove all languages except En and Ru from xpui.js
$rus_js = @{
OffRujs = '(\[a\.go\.en,)(.+?\])', '$1a.go.ru]'
}
$n = ($lang).NoVariable2
$contents = $rus_js
$contents = "offrujs"
$json = $webjson.others
$paramdata = $xpui_js
}
"RuTranslate" {
Expand Down Expand Up @@ -1120,69 +1076,86 @@ function Helper($paramname, $addstring) {

"ExpFeature" {
# Experimental Feature Standart
$exp_features = @{
LikedArtistPage = '(Enable Liked Songs section on Artist page",default:)(!1)', '$1true'
BlockUsers = '(Enable block users feature in clientX",default:)(!1)', '$1true'
Quicksilver = '(Enables quicksilver in-app messaging modal",default:)(!0)', '$1false'
IgnorInRec = '(Enable Ignore In Recommendations for desktop and web",default:)(!1)', '$1true'
Prod = '(Enable Playlist Permissions flows for Prod",default:)(!1)', '$1true'
ShowingBalloons = '(Enable showing balloons on album release date anniversaries",default:)(!1)', '$1true'
EnhanceLiked = '(Enable Enhance Liked Songs UI and functionality",default:)(!1)', '$1true'
EnhancePlaylist = '(Enable Enhance Playlist UI and functionality for end-users",default:)(!1)', '$1true'
DisographyArtist = '(Enable a condensed disography shelf on artist pages",default:)(!1)', '$1true'
LyricsMatch = '(Enable Lyrics match labels in search results",default:)(!1)', '$1true'
Equalizer = '(Enable audio equalizer for Desktop and Web Player",default:)(!1)', '$1true'
DevicePickerOld = '(Enable showing a new and improved device picker UI",default:)(!.)', '$1false'
NewHome = '(Enable the new home structure and navigation",values:.,default:)(..DISABLED)', '$1true'
MadeForYou = '(Show "Made For You" entry point in the left sidebar.,default:)(!1)', '$1true'
ClearCache = '(Enable option in settings to clear all downloads",default:)(!1)', '$1true'
CarouselsonHome = '(Use carousels on Home",default:)(!1)', '$1true'
LeftSidebar = '(Enable Your Library X view of the left sidebar",default:)(!1)', '$1true'
LyricsEnabled = '(With this enabled, clients will check whether tracks have lyrics available",default:)(!1)', '$1true'
PlaylistCreation = '(Enables new playlist creation flow in Web Player and DesktopX",default:)(!1)', '$1true'
SearchBox = '(Adds a search box so users are able to filter playlists when trying to add songs to a playlist using the contextmenu",default:)(!1)', '$1true'
# "Create similar playlist" menu is activated for someone else's playlists
SimilarPlaylist = ',(.\.isOwnedBySelf&&)((\(.{0,11}\)|..createElement)\(.{1,3}Fragment,.+?{(uri:.|spec:.),(uri:.|spec:.).+?contextmenu.create-similar-playlist"\)}\),)' , ',$2$1'
}
$ofline = Check_verison_clients -param2 "offline"
if ($enhance_like_off) { $exp_features.Remove('EnhanceLiked') }
if ($enhance_playlist_off) { $exp_features.Remove('EnhancePlaylist') }
if ($new_artist_pages_off) { $exp_features.Remove('DisographyArtist') }
if ($new_lyrics_off) { $exp_features.Remove('LyricsMatch') }
if ($equalizer_off) { $exp_features.Remove('Equalizer') }
if (!($device_picker_old)) { $exp_features.Remove('DevicePickerOld') }
if ($made_for_you_off -or $ofline -ge "1.1.96.783") { $exp_features.Remove('MadeForYou') }
$rem = $webjson.exp.psobject.properties

if ($enhance_like_off) { $rem.remove('enhanceliked') }
if ($enhance_playlist_off) { $rem.remove('enhanceplaylist') }
if ($new_artist_pages_off) { $rem.remove('disographyartist') }
if ($new_lyrics_off) { $rem.remove('lyricsmatch') }
if ($equalizer_off) { $rem.remove('equalizer') }
if (!($device_picker_old)) { $rem.remove('devicepickerold') }
if ($made_for_you_off -or $ofline -ge "1.1.96.783") { $rem.remove('madeforyou') }
if ($exp_standart) {
$exp_features.Remove('EnhanceLiked'), $exp_features.Remove('EnhancePlaylist'),
$exp_features.Remove('DisographyArtist'), $exp_features.Remove('LyricsMatch'),
$exp_features.Remove('Equalizer'), $exp_features.Remove('DevicePicker'),
$exp_features.Remove('NewHome'), $exp_features.Remove('MadeForYou'),
$exp_features.Remove('SimilarPlaylist'), $exp_features.Remove('LeftSidebar')
$rem.remove('enhanceliked'), $rem.remove('enhanceplaylist'),
$rem.remove('disographyartist'), $rem.remove('lyricsmatch'),
$rem.remove('equalizer'), $rem.remove('devicepicker'),
$rem.remove('newhome'), $rem.remove('madeforyou'),
$rem.remove('similarplaylist'), $rem.remove('leftsidebar')
}
if (!($left_sidebar_on) -or $ofline -le "1.1.94.872") { $exp_features.Remove('LeftSidebar') }
if ($navalt_off) { $exp_features.Remove('NewHome'), $exp_features.Remove('LeftSidebar') }
if (!($left_sidebar_on) -or $ofline -le "1.1.94.872") { $rem.remove('leftsidebar') }
if ($navalt_off) { $rem.remove('newhome'), $rem.remove('leftsidebar') }
if ($ofline -ge "1.1.94.864") {
$exp_features.Remove('LyricsEnabled'), $exp_features.Remove('PlaylistCreation'),
$exp_features.Remove('SearchBox')
$rem.remove('lyricsenabled'), $rem.remove('playlistcreat'),
$rem.remove('searchbox')
}
if ($ofline -le "1.1.93.896") { $exp_features.Remove('NewHome') }
if ($ofline -lt "1.1.90.859" -or $ofline -gt "1.1.95.893") { $rem.remove('devicepicker') }
if ($ofline -le "1.1.93.896") { $rem.remove('newhome') }
$n = ($lang).NoVariable2
$contents = $exp_features
$contents = $webjson.exp.psobject.properties.name
$json = $webjson.exp
$paramdata = $xpui_js
}
}
$contents.Keys | Sort-Object | ForEach-Object {

if ($paramdata -match $contents.$PSItem[0]) {
$paramdata = $paramdata -replace $contents.$PSItem[0], $contents.$PSItem[1]
}
else {
if (!($paramname -eq "RuTranslate") -or $err_ru) {

Write-Host ($lang).NoVariable"" -ForegroundColor red -NoNewline
Write-Host "`$contents.$PSItem"$n
if ($paramname -ne "HtmlLicMin" -or $paramname -ne "RuTranslate") {

$contents | ForEach-Object {

if ($json.$PSItem.match.Count -gt 1) {
$count = $json.$PSItem.match.Count - 1
$numbers = 0
While ($numbers -le $count) {

if ($paramdata -match $json.$PSItem.match[$numbers]) {
$paramdata = $paramdata -replace $json.$PSItem.match[$numbers], $json.$PSItem.replace[$numbers]
}
else {

Write-Host ($lang).NoVariable"" -ForegroundColor red -NoNewline
Write-Host "`$contents.$PSItem $numbers"$n
}
$numbers++
}
}
}
if ($json.$PSItem.match.Count -eq 1) {
if ($paramdata -match $json.$PSItem.match) {
$paramdata = $paramdata -replace $json.$PSItem.match, $json.$PSItem.replace
}
else {

if (!($paramname -eq "RuTranslate") -or $err_ru) {

Write-Host ($lang).NoVariable"" -ForegroundColor red -NoNewline
Write-Host "`$contents.$PSItem"$n
}
}
}
}
}
if ($paramname -eq "HtmlLicMin" -or $paramname -eq "RuTranslate") {
$contents.Keys | Sort-Object | ForEach-Object {

if ($paramdata -match $contents.$PSItem[0]) {
$paramdata = $paramdata -replace $contents.$PSItem[0], $contents.$PSItem[1]
}
else {
if (!($paramname -eq "RuTranslate") -or $err_ru) {

Write-Host ($lang).NoVariable"" -ForegroundColor red -NoNewline
Write-Host "`$contents.$PSItem"$n
}
}
}
}
$paramdata
}
Expand Down Expand Up @@ -1794,4 +1767,4 @@ if ($cache_install) {

if ($start_spoti) { Start-Process -WorkingDirectory $spotifyDirectory -FilePath $spotifyExecutable }

Write-Host ($lang).InstallComplete`n -ForegroundColor Green
Write-Host ($lang).InstallComplete`n -ForegroundColor Green
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h1>System requirements</h1>

- <strong>OS: Windows 7-11</strong>
- <strong>Spotify: Recommended official version [1.1.96.785](https://cutt.ly/8EH6NuH)</strong>
- <strong>Spotify: Recommended official version [1.1.97.962](https://cutt.ly/8EH6NuH)</strong>
- <strong>For Windows Desktop only (Microsoft store version is not suitable).</strong>
- <strong>PowerShell: 3 or higher</strong>

Expand Down

0 comments on commit 2fb07f9

Please sign in to comment.