PalGate automation using Python.
This project is intended for research purpose only.
This project is not affiliated with, endorsed by, or in any way officially connected to PalGate.
The use of this software is at the user's own risk. The author(s) of this project take no responsibility and disclaim any liability for any damage, loss, or consequence resulting directly or indirectly from the use or application of this software.
Users are solely responsible for ensuring their use of this project complies with all applicable laws, regulations, and terms of service of any related platforms or services. The author(s) bear no accountability for any actions taken by users of this software.
This project provides a simple way to generate PalGate's derived token, without using third-party libraries!
Attention!
This project is based on reverse engineering the PalGate App. While every effort has been made to ensure accuracy, please be aware of the following:
- Some information may be incomplete or incorrect.
- The project may not fully represent the original functionality.
- Updates or changes to the original app may render parts of this project obsolete or inaccurate.
If you encounter bugs, inaccuracies, or have improvements please open an issue or submit a PR
Below are some essential terms specific to the project's context.
- session token
- Token provided by PalGate's API after successful login
- token type
- Type of session token can either be
SMS
,PRIMARY
orSECONDARY
- phone number
Phone number associated with your PalGate account in international format without the
+
(plus sign) prefix - i.e just digitsPalGate refers to it as user id
- derived token
- Time sensitive token generated by all of the information above which is used by PalGate's API as your API key
The whole purpose of this project it to generate this token which is done by calling
pylgate.generate_token
PalGate refers to it as token (not to confuse with session token)
Install the package using pip:
pip install git+https://github.com/DonutByte/pylgate.git@main
Download and run this script which acquires a session token using the Device Linking feature.
Make sure to install its requirements first:
pip install qrcode requests
The script prints a QR code to the screen which you have to scan using the PalGate app on your phone:
- Launch the PalGate app on your phone
- Press the
⋮
(menu icon) at the top-left corner - Press the
Linked Devices
setting - Press the
Link a Device
button - Hold your phone's camera to the QR code
At the end it should print out something like this:
checking status...
updating user info...
checking derived token...
Logged-in successfully :)
Phone number (user id): <your phone number>
Session token: <session token>
Token type: 1 (TokenType.PRIMARY)
Note
<your phone number>
and<session token>
are placeholders.- If you already have another linked device, token type would be:
2 (TokenType.SECONDARY)
If there isn't an open issue - feel free to open one yourself! (make sure you add the script's output and any other relevant information)
Once you have successfully logged-in, you can access any PalGate API endpoints that your account is authorized to use.
X-Bt-Token
.For more information on derived token, please refer to the Terminology section.
pylgate.generate_token
with the appropriate arguments.For a practical demonstration, check out an example script that verifies the derived token
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GNU General Public License v3.0 (GPLv3).
You can find a copy of the license in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.en.html.