一个(python)脚本,用于远程设置avm fritz的设备配置文件!盒子

fritz-switch-profiles的Python项目详细描述


Build StatusLicense MIT

fritz开关配置文件

一个(python)脚本,用于远程设置avm fritz的设备配置文件!框

安装

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: 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
  1. 确定要更改其配置文件的设备的ID
./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
...
  1. 确定可用的配置文件
./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
  1. 实际更改配置文件
./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

注意,您可以通过在命令行上提供多个DEVICE=PROFILE对,一次更改多个设备的配置文件。

用作库

example.py

fromfritz_switch_profilesimportFritzProfileSwitchurl='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)

已知问题

  • 非唯一命名的设备可能会混淆脚本。

许可证

MIT©2018弗洛里安猪舍&贡献者

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在IntelliJ中导入Gradle项目?   java使用dropwizard在ContainerResponseFilter上注入HttpServletRequest HttpServletRequest   基于Java的简单规则引擎的回退实现   java无法在引号“”中获取字符串值(Android)   直接从java书籍中复制的用户界面代码不希望运行   java如何检查已安装的libevent版本?   javascript如何在CryptoJS中解密文件,由JAVA使用AES加密   如何为自制软件打包Java GUI应用程序   java IntelliJ,在调试模式下运行glassfish,未部署工件   swing重新打开以前关闭的窗口Java   带参数的java测试资源   此URL不支持java HTTP Status 405 HTTP方法GET,即使没有doget()方法   java Heroku应用程序使用s3上传图像   java使两个水平文本视图在一起小于某个宽度时保持左侧,但如果它们大于宽度,则省略左侧视图?   Thymeleaf中的java绑定列表;索引超出范围   java类型JspWriter中的print(boolean)方法不适用于参数   java安卓要么没有足够的内存用于后台任务,要么GC有问题   如何使用证书过期的旧java小程序?   java如何从事件中获取数据到主函数?