Skip to content

Commit 850abf7

Browse files
committed
fix: version check
1 parent 8ca861f commit 850abf7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pcomfortcloud/authentication.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import time
88
import urllib
99
import requests
10+
import re
1011

1112
from bs4 import BeautifulSoup
1213
from . import exceptions
@@ -437,20 +438,19 @@ def _update_app_version(self):
437438
if self._raw:
438439
print("--- auto detecting latest app version")
439440
try:
440-
response = requests.get(constants.APPBRAIN_URL)
441-
responseContent = response.content
442-
soup = BeautifulSoup(responseContent, "html.parser")
443-
meta_tag = soup.find("meta", itemprop="softwareVersion")
444-
if meta_tag is not None:
445-
version = meta_tag['content']
441+
response = requests.get("https://play.google.com/store/apps/details?id=com.panasonic.ACCsmart")
442+
responseText = response.content.decode("utf-8")
443+
version_match = re.search(r'\[\"(\d+\.\d+\.\d+)\"\]', responseText)
444+
if version_match:
445+
version = version_match.group(1)
446446
self._app_version = version
447447
if self._raw:
448448
print("--- found version: {}".format(self._app_version))
449449
return
450450
else:
451451
self._app_version = constants.X_APP_VERSION
452452
if self._raw:
453-
print("--- Error finding meta_tag")
453+
print("--- error finding version")
454454
return
455455

456456
except Exception:

0 commit comments

Comments
 (0)