fritz-switch-profiles
A (Python) script to remotely set device profiles of an AVM Fritz!Box
Installation
git clone https://github.com/flopp/fritz-switch-profiles.git
cd fritz-switch-profiles
virtualenv -p python3 env
source env/bin/activate
pip install -r requirements.txt
Usage
usage: fritz-switch-profiles.py [-h] [--url URL] [--user USER] --password
PASSWORD [--list-devices] [--list-profiles]
[DEVICE=PROFILE [DEVICE=PROFILE ...]]
positional arguments:
DEVICE=PROFILE Desired device to profile mapping
optional arguments:
-h, --help show this help message and exit
--url URL The URL of your Fritz!Box; default: http://fritz.box
--user USER Login username; default: empty
--password PASSWORD Login password
--list-devices List all known devices
--list-profiles List all available profiles
- Determine the ID of the device, whose profile you want to change
./fritz-switch-profiles.py --password YOURPASSWORD --list-devices
->
LOGGING IN TO FRITZ!BOX AT http://fritz.box...
FETCHING AVAILABLE PROFILES...
FETCHING DEVICES...
FETCHING DEVICE PROFILES...
DEVICE_ID PROFILE_ID DEVICE_NAME
landevice5007 filtprof1 android-1234567890123456 [NOT ACTIVE]
landevice6494 filtprof1 my kid's iphone
landevice5006 filtprof2 Chromecast
...
- Determine the available profiles
./fritz-switch-profiles.py --password YOURPASSWORD --list-profiles
->
LOGGING IN TO FRITZ!BOX AT http://fritz.box...
FETCHING AVAILABLE PROFILES...
FETCHING DEVICES...
FETCHING DEVICE PROFILES...
PROFILE_ID PROFILE_NAME
filtprof1 Standard
filtprof2 Gast
filtprof3 Unbeschränkt
filtprof4 Gesperrt
- Actually change the profiles
./fritz-switch-profiles.py --password YOURPASSWORD landevice6494=filtprof4
->
LOGGING IN TO FRITZ!BOX AT http://fritz.box...
FETCHING AVAILABLE PROFILES...
FETCHING DEVICES...
FETCHING DEVICE PROFILES...
UPDATING DEVICE PROFILES...
CHANGING PROFILE OF landevice6494/my kid's iphone TO filtprof4/Gesperrt
Note that you may change the profiles of multiple devices at once by supplying multiple DEVICE=PROFILE pairs on the command line.
Usage as a library
From example.py
from fritz_switch_profiles import FritzProfileSwitch
url = 'http://fritz.box'
user = ''
password = 'mysecurepassword'
fps = FritzProfileSwitch(url, user, password)
devices = fps.get_devices()
profiles = fps.get_profiles()
fps.print_devices()
fps.print_profiles()
profile_for_device = [devices[0]['id1'], profiles[2]['id']]
fps.set_profiles(profile_for_device)
Known Issues
- Non-uniquely named devices may confuse the script.
License
MIT © 2018 Florian Pigorsch & contributors
Metadata
Release files for fritz-switch-profiles 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fritz-switch-profiles-0.0.2.tar.gz | 4.8 kB | Without provenance | Details for fritz-switch-profiles-0.0.2.tar.gz |
Release files / fritz-switch-profiles-0.0.2.tar.gz
| Download URL | fritz-switch-profiles-0.0.2.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f186699bbf9145892307b45d798c992f45d2ae05876a04756f3d183cf894e297
|
|
BLAKE2b-256 checksum How to use checksums |
5594d2c9581a813eecacdf02d203f3f33c17a1ced3db39f310265b8e0fcc6dee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3
|
Security for fritz-switch-profiles 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.