Created
September 24, 2021 00:34
-
-
Save abezukor/720df17d6363bfdfd04a539d2e844280 to your computer and use it in GitHub Desktop.
Discord Stop Update
This file contains 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 characters
#!/usr/bin/python3 | |
import requests | |
import json | |
FILE_LOCATION = "/opt/discord/resources/build_info.json" | |
r = requests.get('https://discord.com/api/download?platform=linux&format=deb') | |
version = r.url.split('/')[5] | |
discord_version = {} | |
with open(FILE_LOCATION, 'r') as discord_version_file: | |
#print(discord_version_file.read()) | |
discord_version = json.load(discord_version_file) | |
old_version = discord_version['version'] | |
print(f"Chainging Version in file from {old_version} to {version}.") | |
discord_version['version'] = version | |
with open(FILE_LOCATION, 'w') as discord_version_file: | |
json.dump(discord_version, discord_version_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is for when pacman has not been updated with the latest discord, but I still want to use the desktop client. Note that is has to be run in a context that can edit
/opt/discord/resources/build_info.json