Skip to content

Commit

Permalink
failsafe and ready for v2024.12.22 release
Browse files Browse the repository at this point in the history
  • Loading branch information
JediLin authored Dec 22, 2024
1 parent a955df8 commit ad89025
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Phonak Target Media Checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,15 @@
updaterRetries = libhearingdownloader.updaterRetries
while updaterRetries > 0:
try:
hostXmlData = requests.get("https://p-svc1.phonakpro.com/1/ObjectLocationService.svc/FittingApplicationInstaller/index?appName=Phonak%20Target&appVer=6.0.1.695&dist=Phonak&country=US&subKeys=").text # Request the updater API (spoof older version to get whole installer files rather than "patch" installers)
hostXmlData = requests.get("https://p-svc1.phonakpro.com/1/ObjectLocationService.svc/FittingApplicationInstaller/index?appName=Phonak%20Target&appVer=6.0.1.695&dist=Phonak&country=GB&subKeys=").text # Request the updater API (spoof older version to get whole installer files rather than "patch" installers)
hostData = xml.fromstring(hostXmlData)
hostAppVer = hostData[0].find(xmlns + "UpdateVersion").find(xmlns + "Version").text
xmlData = requests.get("https://p-svc1.phonakpro.com/1/ObjectLocationService.svc/MediaInstaller/index?appName=Target%20Media&appVer=0.0.0.0;" + hostAppVer + "&dist=Phonak&country=GB&subKeys=").text # Request the updater API with the latest version number of Phonak Target
if (xmlData == '<ArrayOfContentIndex xmlns="http://cocoon.phonak.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>'):
hostXmlData = requests.get("https://p-svc1.phonakpro.com/1/ObjectLocationService.svc/FittingApplicationInstaller/index?appName=Phonak%20Target&appVer=6.0.1.695&dist=Phonak&country=US&subKeys=").text # Request the updater API (spoof older version to get whole installer files rather than "patch" installers)
hostData = xml.fromstring(hostXmlData)
hostAppVer = hostData[0].find(xmlns + "UpdateVersion").find(xmlns + "Version").text
xmlData = requests.get("https://p-svc1.phonakpro.com/1/ObjectLocationService.svc/MediaInstaller/index?appName=Target%20Media&appVer=0.0.0.0;" + hostAppVer + "&dist=Phonak&country=US&subKeys=").text # Request the updater API with the latest version number of Phonak Target
data = xml.fromstring(xmlData)
break
except:
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ NOTE: If you run The Checker (on Windows OS) without Python installed yet, The C
- [@tenkan](https://forum.hearingtracker.com/u/tenkan/summary): Finding the Genie (2) download page links

## Changelog
### Pre-release (work-in-progress)
- Phonak: workaround for Target 10.0.1 seems not available in US market
### v2024.12.22
- Phonak: fix Target checker for v10.0.1
- Phonak: failsafe for Target Media checker
- Document (README) update

### v2024.12.06
Expand Down
4 changes: 2 additions & 2 deletions libhearingdownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
# libhearingdownloader - A useful library for the downloader scripts
###

downloaderVersion = "Pre-release"
#downloaderVersion = "v2024.12.06"
#downloaderVersion = "Pre-release"
downloaderVersion = "v2024.12.22"
updaterRetries = 3
verboseDebug = False

Expand Down

0 comments on commit ad89025

Please sign in to comment.