GithubHelp home page GithubHelp logo

oreomeow / freenom-py Goto Github PK

View Code? Open in Web Editor NEW
137.0 3.0 71.0 18 KB

Freenom 域名自动续约 python 项目

Home Page: https://oreos.ml/script/2021-09-15-Freenom-py.html

JavaScript 10.76% Python 43.09% HTML 46.15%
freenom python

freenom-py's Introduction

𝘧𝘳𝘦𝘦𝘯𝘰𝘮-𝘱𝘺

GitHub stars GitHub forks Telegram GitHub issues GitHub last commit

项目描述 🔑

Freenom 自动续期域名的脚本

项目部署 🥳

Python 运行环境

  • Windows、Linux、青龙、elecV2P 等

使用说明 🕹

🌏 通用版

PC、VPS 等可直接运行, 无通知变量

wget https://raw.githubusercontent.com/Oreomeow/freenom-py/main/FNplus.py
python3 FNplus.py -u USERNAME -p PASSWORD

USERNAME : Freenom 用户名
PASSWORD : Freenom 密码

🐉 青龙邮件版 📧

  1. 修改配置文件

    ## ql repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可
    
    RepoFileExtensions="js py ts html"
  2. 添加定时拉取任务并运行

    ql repo https://github.com/Oreomeow/freenom-py.git "FN_extend.py" "" "utils|templates"
  3. 安装依赖

    docker exec -it qinglong bash # 进入容器内
    cd /ql/scripts
    wget https://raw.githubusercontent.com/Oreomeow/freenom-py/main/requirements.txt -O requirements.txt
    pip3 install -r requirements.txt
  4. 添加环境变量 示例

  5. 运行一次 FN_extend.py 测试

🪁 elecV2P 邮件版 📧

TASK -> 添加单个任务 -> 修改名称、时间、任务 -> JSMANAGE -> store/cookie 常量储存管理填写环境变量

名称: Freenom 续期

时间: cron 定时 25 7 */10 * *

任务:

https://raw.githubusercontent.com/Oreomeow/freenom-py/main/FN_extend.js

🐉 青龙消息版 📱

  1. 面板添加定时任务,定时随意,运行

    ql raw https://raw.githubusercontent.com/Oreomeow/freenom-py/main/FNplus.py
  2. 添加环境变量 示例

  3. 运行一次 FNplus.py 测试

🪁 elecV2P 消息版 📱

TASK -> 添加单个任务 -> 修改名称、时间、任务 -> JSMANAGE -> store/cookie 常量储存管理填写环境变量

名称: Freenom 续期

时间: cron 定时 25 7 */10 * *

任务:

https://raw.githubusercontent.com/Oreomeow/freenom-py/main/FNplus.js

环境变量 🍒

邮件版 📧

变量 / key 描述 示例 / value
FN_ID Freenom 用户名 [email protected]
FN_PW Freenom 密码 12345678
MAIL_USER 发件人邮箱用户名 [email protected][email protected]
MAIL_ADDRESS 发件人邮箱地址 [email protected][email protected]
MAIL_PW 发件人邮箱授权码 xxxxxxxxxxxxxxxx 看下方链接
MAIL_HOST 发件人邮箱服务器 smtp.qq.com 不填默认为这个
MAIL_PORT 邮箱服务器端口 465 不填默认为这个
MAIL_TO 收件人邮箱可与发件人相同 [email protected][email protected]
  • 填写总参考

如何设置POP3/SMTP的SSL加密方式?

消息版 📱

变量 / key 描述 参考 / value
FN_ID Freenom 用户名, 多账号空格隔开 [email protected] [email protected]
FN_PW Freenom 密码, 多账号空格隔开 12345678 87654321
BARK bark 设备码 BARK 推送使用, 填写 URL 即可, 例如: https://api.day.app/DxHcxxxxxRxxxxxxcm/
PUSH_KEY Server 酱 server 酱推送官方文档, 填写 SCKEY 代码即可
TG_BOT_TOKEN tg 机器人 申请 @BotFather 的 Token, 如 10xxx4:AAFcqxxxxgER5uw
TG_USER_ID tg 机器人 @getidsbot 发送 /start 获取到的纯数字 ID, 如 1434078534
TG_PROXY_IP * tg 机器人代理 IP 地址 代理类型为 http, 比如您代理是 http://127.0.0.1:1080 , 则填写 127.0.0.1 , 有密码例子: username:[email protected]
TG_PROXY_PORT * tg 机器人代理端口 代理端口号, 代理类型为 http, 比如您代理是 http://127.0.0.1:1080 , 则填写 1080
DD_BOT_TOKEN 钉钉机器人 钉钉推送官方文档, 只需 https://oapi.dingtalk.com/robot/send?access_token=XXX 等于符号后面的 XXX
DD_BOT_SECRET 钉钉机器人 钉钉推送官方文档密钥, 机器人安全设置页面, 加签一栏下面显示的 SEC 开头的字符串, 注: 填写了 DD_BOT_TOKENDD_BOT_SECRET , 钉钉机器人安全设置只需勾选加签即可, 其他选项不要勾选
QYWX_AM 企业微信应用 参考文档, 依次填入 corpid, corpsecret, touser(注: 多个成员ID使用 | 隔开), agentid, media_id(选填, 不填默认文本消息类型)

* 表示选填

  • 调用模块

notify.py

查看通知 📮

不出意外会收到一封关于域名续期的邮件或者 tg 等通知消息

写在最后 🔚

核心代码见 utils/freenom.py

此项目核心接口参考 Freenom-PHP

感谢不限于以下开发者

@𝘴𝘩𝘶𝘢𝘪93

@𝘭𝘶𝘰𝘭𝘰𝘯𝘨𝘧𝘦𝘪

freenom-py's People

Contributors

oreomeow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

freenom-py's Issues

【一些看法】windows使用WSL运行脚本且输出日志

修改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创建快捷方式,添加开机自启即可。
我目前是使用这种方法的,不知道作者及各位有什么高见?

青龙消息版如何添加变量?

变量修改后运行提示没有添加账号?
if "FN_ID" in os.environ:
username = os.environ.get('账号')
if "FN_PW" in os.environ:
password = os.environ.get('密码')

这样填写无法生效?

############

args

parser = argparse.ArgumentParser()
parser.add_argument('-u', '--username', type=str)
parser.add_argument('-p', '--password', type=str)
args = parser.parse_args()
username = '账号' ###我修改的
password = '密码' ###我修改的
最后我修改这两处后运行,有显示我的账号下的域名还剩多少天,不知道这样修改正不正确?

No module named 'utils.exception'

最开始是提示 No module named utils
pip安装后提示下面这个。青龙面板
ModuleNotFoundError: No module named 'utils.exception'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.