-
-
Save DaveLak/61666ce2936d9c4a96d78fbac76a974a to your computer and use it in GitHub Desktop.
Revisions
-
PhilippIRL revised this gist
Apr 22, 2022 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,15 @@ elif systemPlatform == 'Darwin': filePath = os.environ['HOME'] + '/Library/Application Support/Spotify/PersistentCache/offline.bnk' elif systemPlatform == 'Linux': homePath = os.environ['HOME'] snapSpotifyHome = os.environ['HOME'] + '/snap/spotify/common' if os.path.exists(snapSpotifyHome): homePath = snapSpotifyHome filePath = homePath + '/.cache/spotify/offline.bnk' else: print('Sorry, your platform is not yet supported.') sys.exit(1) @@ -41,4 +50,4 @@ # change one byte to 50 (ascii '2') file.write(bytes([50])) file.close() -
PhilippIRL revised this gist
Apr 22, 2022 . 1 changed file with 18 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,26 @@ # Created by @PhilippIRL # This script patches Spotify's offline.bnk file (this file caches the remote config) to trick Spotify into thinking that your account is enabled for dev tools. # Spotify will automatically revert this local change after some time when it next fetches the remote config. # Of course you will have to completely close Spotify before running this script. import os, sys, platform systemPlatform = platform.system() if systemPlatform == 'Windows': filePath = os.environ['LOCALAPPDATA'] + '\\Spotify\\offline.bnk' elif systemPlatform == 'Darwin': filePath = os.environ['HOME'] + '/Library/Application Support/Spotify/PersistentCache/offline.bnk' else: print('Sorry, your platform is not yet supported.') sys.exit(1) # check if spotify is installed if not os.path.exists(filePath): print('It seems like you don\'t have Spotify installed.') sys.exit(1) file = open(filePath, 'r+b') content = file.read() -
PhilippIRL revised this gist
Apr 22, 2022 . 1 changed file with 19 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,33 @@ # # Created by @PhilippIRL # Windows, non MS-Store version only (but if you change the file path it might work on other operating systems too) # # This script patches Spotify's offline.bnk file (this file caches the remote config) to trick Spotify into thinking that your account is enabled for dev tools. # Spotify will automatically revert this local change after some time when it next fetches the remote config. # import os, sys # path of offline.bnk on windows (non ms-store) filePath = os.environ['LOCALAPPDATA'] + '\\Spotify\\offline.bnk' file = open(filePath, 'r+b') content = file.read() # find last occurence of string 'app-developer' loc = content.rindex(b'app-developer') # 15 bytes after this string is the location we want to patch patchLoc = loc + 15 # only patch if the value is what we expect if not (content[patchLoc] == 48 or content[patchLoc] == 50): print('Unexpected value', content[patchLoc]) sys.exit(1) file.seek(patchLoc) # change one byte to 50 (ascii '2') file.write(bytes([50])) file.close() -
PhilippIRL revised this gist
Apr 21, 2022 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ # Created by @PhilippIRL # Windows, non MS-Store version only (but if you change the file path it might work on other operating systems too) import os, sys file = open(os.environ['LOCALAPPDATA'] + "\\Spotify\\offline.bnk", "r+b") -
PhilippIRL created this gist
Apr 21, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ import os, sys file = open(os.environ['LOCALAPPDATA'] + "\\Spotify\\offline.bnk", "r+b") content = file.read() loc = -1 while 1: try: loc = content.index(b"app-developer", loc + 1) except ValueError: break patchLoc = loc + 15 if not (content[patchLoc] == 48 or content[patchLoc] == 50): print("Unexpected value", content[patchLoc]) sys.exit(1) file.seek(patchLoc) file.write((50).to_bytes(1, sys.byteorder)) file.close()