NoMore201 / googleplay-api

Google Play Unofficial Python API
Other
409 stars 208 forks source link

Download Support for Region Restricted apps #157

Open khaleel-git opened 2 years ago

khaleel-git commented 2 years ago

I wonder if there's a way with this repository (@NoMore201) to download region restricted apps? If i know the region where the specific apk is supported, i can download it with that specific location configurations but the problem is, how do we know the specific app (for example: https://play.google.com/store/apps/details?id=com.sonyliv) is supported in which specific country? or is blocked on which countries?

Please let me know if its possible ...

khaleel-git commented 2 years ago

RequestError: 'Error retrieving information from server. DF-DFERH-01' with @googleplay-api My Code: api = GooglePlayAPI("en_US", timezone = "America/Los_Angeles", device_codename = "manta") #bacon, fs454, manta api.login(email = mail, password = passwd)

app_id = "com.sonyliv" docId = app_id download = api.download(docId, expansion_files=True) with open(download['docId'] + '.apk', 'wb') as first: for chunk in download.get('file').get('data'): first.write(chunk)

khaleel-git commented 2 years ago

details function working fine, couldn't download apk.

khaleel-git commented 2 years ago

Yes, I am currently researching about this. Can u seggest me a solution with proxy? I mean how can i download restriced apk by applying proxy?

khaleel-git commented 2 years ago

Sorry, I am not good with proxy. I think free proxy are bad quality, so you probably need to find paid proxy. Good luck, or maybe you can find another solution.

I think it also require a separate google account for each proxy country.

Exadra37 commented 1 year ago

To download a restricted APK you may ned to first use a compatible device for that country and that is supported by that APK. Go to device.properties and which device uses a country not restricted by the APK and that uses an Android version supported by the APK. If a profile doesn't exist then you need to create a new one.

The bash script I use to update the device.properties file:

#!/bin/bash

# REPO_SRC="https://github.com/yeriomin/play-store-api"
REPO_SRC="https://gitlab.com/AuroraOSS/gplayapi.git"
REPO_LOCAL="/tmp/psapi"
RES_DIR="${REPO_LOCAL}/src/main/resources"

DEVS_FILE="./gpapi/device.properties"

command -v git >/dev/null 2>&1 || { echo "git not installed"; exit 1; }

if [ ! -d "./gpapi" ]; then
        echo "No gpapi dir found! Make sure you're in googleplay-api root dir"
        exit 1
fi

mkdir -p $REPO_LOCAL

echo "==> Cloning play-store-api repo into $REPO_LOCAL"
git clone $REPO_SRC $REPO_LOCAL

# clean device.properties file
echo "" > $DEVS_FILE

for dev in `ls $RES_DIR`; do
        FILE="$RES_DIR/$dev"
        NAME=`echo $dev | sed -e "s/\(.*\).properties/\1/"`
        echo "==> appending device data for $NAME"
        echo -e "\n[$NAME]" >> $DEVS_FILE
        cat $FILE >> $DEVS_FILE
        echo "" >> $DEVS_FILE
done

# cleanup
echo "==> Cleanup"
rm -rf $REPO_LOCAL

I can download some restricted APKs with the correct device properties and OS without using a proxy its necessary to use one.

ghost commented 1 year ago

above comment is not true. you need to change the country in your Google account settings:

https://github.com/4cq2/googleplay/blob/main/blog/2023-02/geo-blocking.md

unless I see proof otherwise, I am not accepting this claim. provide an example app, and proof of your current region, otherwise the claim is suspect.