oreomeow / freenom-py Goto Github PK
View Code? Open in Web Editor NEWFreenom 域名自动续约 python 项目
Home Page: https://oreos.ml/script/2021-09-15-Freenom-py.html
Freenom 域名自动续约 python 项目
Home Page: https://oreos.ml/script/2021-09-15-Freenom-py.html
修改FNplus中的中文字符为英文(由于bat变量有中文和空格时会有奇奇怪怪的问题,所以直接全部翻译FNplus.py中的中文),且另存为FNplusEN.py
Freenom 续期消息版 → FreedomRenewalMessage
加载通知服务失败 → FailedToLoadNotificationService
Freenom 续期 → FreenomRenewal
{domain} 续期成功 → {domain}RenewalSucceeded
{domain} 续期失败 → {domain}RenewalFailed
{domain} 还有 {days} 天续期 → {domain}Have{days}DaysToRenew
你没有添加任何账户 → YouHaven'tAddedAnyAccounts
账户与密码不匹配 → AccountAndPasswordDoNotMatch
添加bat进行定时任务
bat内容如下。
@echo off
mode con cols=60 lines=20
title FreenomGetFree
:loop
echo [%date:~,-3% %time:~,-3%]Start detection.
echo [%date:~,-3% %time:~,-3%]Start detection. >> Log.log
for /F %%i in ('wsl python3 FNplusEN.py -u USERNAME -p PASSWORD') do ( set commitid=%%i)
echo %commitid%
echo %commitid% >> Log.log
for /F %%i in ('wsl python3 FNplusEN.py -u USERNAME -p PASSWORD') do ( set commitid=%%i)
echo %commitid%
echo %commitid% >> Log.log
echo [%date:~,-3% %time:~,-3%]After the detection is completed, wait for a day to start the next round of detection.
echo [%date:~,-3% %time:~,-3%]After the detection is completed, wait for a day to start the next round of detection. >> Log.log
timeout /t 86400 >nul
goto loop
bat创建快捷方式,添加开机自启即可。
我目前是使用这种方法的,不知道作者及各位有什么高见?
最开始是提示 No module named utils
pip安装后提示下面这个。青龙面板
ModuleNotFoundError: No module named 'utils.exception'
脚本不能用了
变量修改后运行提示没有添加账号?
if "FN_ID" in os.environ:
username = os.environ.get('账号')
if "FN_PW" in os.environ:
password = os.environ.get('密码')
这样填写无法生效?
############
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--username', type=str)
parser.add_argument('-p', '--password', type=str)
args = parser.parse_args()
username = '账号' ###我修改的
password = '密码' ###我修改的
最后我修改这两处后运行,有显示我的账号下的域名还剩多少天,不知道这样修改正不正确?
Traceback (most recent call last): File "FNplus.py", line 5, in <module> import os, re, requests, argparse ModuleNotFoundError: No module named 'requests'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.