Skip to content

Instantly share code, notes, and snippets.

@abezukor
Created September 24, 2021 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abezukor/720df17d6363bfdfd04a539d2e844280 to your computer and use it in GitHub Desktop.
Save abezukor/720df17d6363bfdfd04a539d2e844280 to your computer and use it in GitHub Desktop.
Discord Stop Update
#!/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)
@abezukor
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment