-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get last APK version from playstore (#171)
* Build user agent from last APK version available in playstore * update android version of default user agents
- Loading branch information
Showing
2 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import json | ||
import re | ||
|
||
import requests | ||
|
||
RE_SCRIPT = re.compile( | ||
r"AF_initDataCallback\({key:\s*'ds:4'.*?data:([\s\S]*?), sideChannel:.+<\/script" | ||
) | ||
|
||
|
||
def get_last_apk_version(): | ||
response = requests.get( | ||
"https://play.google.com/store/apps/details?id=com.app.tgtg&hl=en&gl=US" | ||
) | ||
match = RE_SCRIPT.search(response.text) | ||
data = json.loads(match.group(1)) | ||
return data[1][2][140][0][0][0] |