Created
October 12, 2023 10:20
-
-
Save MagerValp/9638719eb13a1025788b13cce4f946cd to your computer and use it in GitHub Desktop.
Get latest Teams download URL for macOS
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 characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import io | |
import sys | |
import argparse | |
import json | |
import urllib.request | |
BASE_URL = "https://statics.teams.cdn.office.net" | |
RELEASE = "production-osx" | |
PKG_FILENAME = "MicrosoftTeams.pkg" | |
def get_json(url): | |
with urllib.request.urlopen(url) as resource: | |
return json.load(resource) | |
def main(argv): | |
p = argparse.ArgumentParser() | |
p.add_argument("-v", "--verbose", action="store_true", | |
help="Verbose output.") | |
args = p.parse_args(argv[1:]) | |
build_settings = get_json("https://config.teams.microsoft.com/config/v1/MicrosoftTeams/1415_1.0.0.0?environment=prod&audienceGroup=general&teamsRing=general&agent=TeamsBuilds") | |
#import pprint | |
#pprint.pprint(build_settings) | |
latest_version = build_settings["BuildSettings"]["WebView2Canary"]["macOS"]["latestVersion"] | |
url = f"{BASE_URL}/{RELEASE}/{latest_version}/{PKG_FILENAME}" | |
print(url) | |
return 0 | |
if __name__ == '__main__': | |
sys.exit(main(sys.argv)) |
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 characters
#!/bin/bash | |
BUILD_CFG_URL="https://config.teams.microsoft.com/config/v1/MicrosoftTeams/1415_1.0.0.0?environment=prod&audienceGroup=general&teamsRing=general&agent=TeamsBuilds" | |
build_config=$( curl -s "$BUILD_CFG_URL" ) | |
/usr/libexec/PlistBuddy -c "print :BuildSettings:WebView2Canary:macOS:latestVersion" /dev/stdin <<< \ | |
"$(echo "$build_config" | plutil -convert xml1 - -o - )" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment