Based on: https://gathering.tweakers.net/forum/view_message/69930184
It runs every 10, 2 or 0.5 mins (can be set with ENV variables), and requests new bundle when MB's is less than 2000. Firstly a login token is retrieved via the "regular" log in URL, from which a Bearer token is retrieved. With the Bearer token the regular API is used to request: current bundles, how much is left on these bundles and then (when needed) a new bundle is requested. Every request is retried at least 10 times when a request fails. PM2 is used so it should restart if it crashes.
There are 3 main ways to use this software in production:
- running the Node.js locally
- running it as a Docker container
- running it as a Docker container via docker-compose
To run this script, an authorization token is needed. Obtain the token using the Odido Authenticator tool: Odido Authenticator latest Release
The Buying code is stored in the environment variable BUYINGCODE
, and by default, the value is set to A0DAY01
, which is used for the 2 GB-aanvuller NL
bundle.
To select a different bundle:
- First, enable DEBUG mode by setting
DEBUG=1
. - Ensure that you've utilized at least 80% of the data in your current bundle.
- Next, review the available bundles in the logs to determine the correct bundle code.
- Once you've identified the desired bundle code, update the
BUYINGCODE
environment variable with the new code.
Based on the amount of MBs left, the intervals do change.
- More than 10GB available, default interval is 10 min. (Overwrite via env var
UPDATE_INTERVAL_HIGH
) - Less than 10GB available, default interval is 2 min. (Overwrite via env var
UPDATE_INTERVAL_MEDIUM
) - Less than 2GB available, default interval is 0.5 min. (Overwrite via env var
UPDATE_INTERVAL_LOW
)
git clone https://github.com/lodu/TMobile-NL-Unlimited-Bundle-Automated
yarn
ornpm install
- create a file called
.env
in root folder with contents:AUTHORIZATIONTOKEN=xxxxxxxxxx MSISDN=+3161234567890 UPDATE_INTERVAL_HIGH=10 UPDATE_INTERVAL_MEDIUM=2 UPDATE_INTERVAL_LOW=0.5 BUYINGCODE=A0DAY01 DEBUG=0
yarn build
ornpm run build
yarn start-daemon
ornpm run start-daemon
- Done
- create a file called
.env
:AUTHORIZATIONTOKEN=xxxxxxxxxx MSISDN=+3161234567890 UPDATE_INTERVAL_HIGH=10 UPDATE_INTERVAL_MEDIUM=2 UPDATE_INTERVAL_LOW=0.5 BUYINGCODE=A0DAY01 DEBUG=0
docker pull ghcr.io/lodu/tmobile-nl-unlimited-bundle-automated:main
docker run --env-file .env ghcr.io/lodu/tmobile-nl-unlimited-bundle-automated:main
- create a file called
.env
:AUTHORIZATIONTOKEN=xxxxxxxxxx MSISDN=+3161234567890 UPDATE_INTERVAL_HIGH=10 UPDATE_INTERVAL_MEDIUM=2 UPDATE_INTERVAL_LOW=0.5 BUYINGCODE=A0DAY01 DEBUG=0
- copy
docker-compose.yaml
to a localdocker-compose.yaml
file docker-compose up -d
-
git clone
the repo (duhh) -
Create
.env
file in root directory:AUTHORIZATIONTOKEN=xxxxxxxxxx MSISDN=+3161234567890 UPDATE_INTERVAL_HIGH=10 UPDATE_INTERVAL_MEDIUM=2 UPDATE_INTERVAL_LOW=0.5 BUYINGCODE=A0DAY01 DEBUG=0
-
Install packages:
yarn
ornpm install
-
Run in development for filewatcher
yarn dev
ornpm run dev
-
Do ya thing.
PR's/MR's are welcomed if you have any additions and or points of improvement
Please feel free to open an issue, I'm glad to help. However do not use it as a tech support please...