E5自动续期

Related tags

MiscellaneousAutoApi
Overview

AutoApi v6.3 (2021-2-18) ———— E5自动续期

AutoApi系列:AutoApi(v1.0)AutoApiSecret(v2.0)AutoApiSR(v3.0)AutoApiS(v4.0)AutoApiP(v5.0)

说明

  • E5自动续期程序,但是不保证续期
  • 设置了周六日(UTC时间)不启动自动调用,周1-5每6小时自动启动一次 (修改看教程)
  • 调用api保活:
    • 查询系api:onedrive,outkook,notebook,site等
    • 创建系api: 自动发送邮件,上传文件,修改excel等

相关

步骤

  • 准备工具:

    • E5开发者账号(即onmicrosoft后缀账号,非个人/私人账号
      • 管理员号 ———— 必选
      • 子号 ———— 可选 (不清楚微软是否会统计子号的活跃度,想弄可选择性补充运行)
    • 教程图片看不到请科学上网
  • 步骤大纲:

    • 微软方面的准备工作 (获取应用id、密码、密钥)
    • GIHTHUB方面的准备工作 (获取Github密钥、设置secret)
    • 试运行

微软方面的准备工作

  • 第一步,注册应用,获取应用id、secret

    image

    image

    • 3)复制应用程序(客户端)ID到记事本备用(获得了应用程序ID!),点击左边管理的证书和密码,点击+新客户端密码,点击添加,复制新客户端密码的保存(获得了应用程序密码!)

    image

    image

  • 第二步,获取refresh_token(微软密钥)

    • 两种选择:
      • 下载项目里的GetToken.html文件;或者本地新建html后缀文档,把GetToken.html的内容复制到里面。然后本地打开,根据里面提示获取refresh_token.
      • 进入**在线版**,根据提示获取refresh_token

    image


GITHUB方面的准备工作

  • 第一步,fork本项目

    登陆/新建github账号,回到本项目页面,点击右上角fork本项目的代码到你自己的账号,然后你账号下会出现一个一模一样的项目,接下来的操作均在你的这个项目下进行。

    image

  • 第二步,新建github密钥

    • 1)进入你的个人设置页面 (右上角头像 Settings,不是仓库里的 Settings),选择 Developer settings -> Personal access tokens -> Generate new token

    image

    image

    • 2)设置名字为 GH_TOKEN , 然后勾选repo,点击 Generate token ,最后复制保存生成的github密钥(获得了github密钥,一旦离开页面下次就看不到了!)

    image

  • 第三步,新建secret

    • 1)依次点击页面上栏右边的 Setting -> 左栏 Secrets -> 右上 New repository secret,新建6个secret: GH_TOKEN、MS_TOKEN、CLIENT_ID、CLIENT_SECRET、CITY、EMAIL

    image

    image

    (以下填入内容注意前后不要有空格空行)

    GH_TOKEN

    github密钥 (第三步获得),例如获得的密钥是abc...xyz,则在secret页面直接粘贴进去,不用做任何修改,只需保证前后没有空格空行

    MS_TOKEN

    微软密钥(第二步获得的refresh_token)

    CLIENT_ID

    应用程序ID (第一步获得)

    CLIENT_SECRET

    应用程序密码 (第一步获得)

    CITY

    城市 (例如Beijing,自动发送天气邮件要用到)

    EMAIL

    收件邮箱 (自动发送天气邮件要用到)

    REDIRECT_URL(这个不用设置,只是方便自定义人士选用)

    接受自定义重定向url,如果不想用微软提供的重定向uri(https://login.microsoftonline.com/common/oauth2/nativeclient),可在此自定义

试运行

  • 1)点击上栏中间的Action进入运行日志页面,中间应该有个绿色按钮(I understand my workflow...),点击。

    自动刷新后,会看到左边有三个流程,一个Run api.Read,一个Run api.Write,一个Update Token。

    工作流程说明
        Run api.Write:创建系api,一天自动运行一次
        Run api.Read:  查询系api,每6小时自动运行一次
        Update Token: 微软密钥更新,每2天运行一次
    

    这三个流程名字前面应该是都有黄色感叹号的

    分别点进去,然后会看到有个黄条(this schedule was disabled......),点击 enable workflow 按钮,三个流程都要按这个!

    (不确定是否都需要进行这一步,我自己做视频教程的时候发现有的。如果你没有,直接忽略并往下进行,能正常运行就可以了 )

  • 2)点击两次右上角的星星(star,就是fork按钮的隔壁)启动action,

    再点击上面的Action选择Run api.Read或者api.Write流程 -> build -> run api 就能看到每次的运行日志

    (必需点进去build里面的run api.XXX看下,api有没有调用到位,操作有没有成功,有没有出错)

    image

  • 3)再点两次星星,查看是否能再次成功运行

    然后点击Action里的 update token 流程 -> build -> update token ,日志里显示“微软密钥上传成功”。

    同时,依次点击页面上栏右边的 Setting -> 左栏 Secrets(也就是Github方面准备的第三步的secret页面),应该能看到MS_TOKEN显示刚刚update了

    (这一步是为了保证重新上传到secret的token是正确的)

教程最后

程序会自行按计划启动,不必操心。

    但是github更新了防止薅羊毛的规则,如果仓库60天无任何变动,将会暂停Action,但是会发邮件通知,所以请留意邮箱,收到邮件请上来手动启动一下action。
   (我还没有收到过此邮件,但是据说邮件里会有启动链接,或者上来按两次星星按钮就行)

P版(AutoApiP)用户请留意是否会触发此暂停规则,由于P版采取了新方案,是否能跳过github检测活跃呢?如果P版收到暂停邮件,最好在issues的这个帖子触发暂停统计里留言

教程完


额外设置 (看不懂请忽略)##

  • 定时启动修改

  • 多账号/应用支持

  • 超级参数设置

定时启动修改

我设定的每6小时自动运行一次(周六日不启动),每次调用3轮(点击右上角星星/star也可以立马调用一次),你们自行斟酌修改(我也不知道保持活跃要调用多少次、多久):

  • 定时自动启动修改地方:在.github/workflow/autoapi.yml(只修改这一个)文件里,自行百度cron定时任务格式,最短每5分钟一次

image

多账号/应用支持

如果想输入第二账号或者应用,请按上述步骤获取第二个应用的id、密码、微软密钥:

再按以下步骤:

1)增加secret

依次点击页面上栏右边的 Setting -> 左栏 Secrets -> 右上 New repository secret,新增加secret:APP_NUM、MS_TOKEN_2、CLIENT_ID_2、CLIENT_SECRET_2

APP_NUM

账号/应用数量(现在例如是两个账号/应用,就是2 ;3个账号就填3,日后如果想要增加请修改APP_NUM)

MS_TOKEN_2

第二个账号的微软密钥(第二步refresh_token),(第三个账号/应用就是MS_TOKEN_3,如此类推)

CLIENT_ID_2

第二个账号的应用程序ID (第一步获取),(第三个账号/应用就是CLIENT_ID_3,如此类推)

CLIENT_SECRET_2

第二个账号的应用程序密码 (第一步获取),(第三个账号/应用就是CLIENT_SECRET_3,如此类推)

2)修改.github/workflows/里的两个yml文件(超过5个账号需要更改,5个及以下暂时不用修改文件,忽略这一步

yml文件我已经注明了,看着改就行,我已经写入5个账号模板了,跟着复制粘贴很简单的(没有找到比较好的自动方案)

超级参数设置

ApiOfRead.py , ApiOfWrite.py 文件第11左右行各有个config,具体参数设置已在文件里说明

包括账号api的随机延时,api随机排序,每次轮数等参数

结尾

有事发issue

Q群:657581700 (项目相关讨论)

                          wangziyingwen
You might also like...
Releases(v6.0)
My solutions for Advent of Code 2021 🌟🎄

🌟 Advent of Code 2021 🎄 My solutions for Advent of Code 2021. About · What is Advent of Code? · Contents · Usage · Table of puzzles (TODO: add final

Amanda P. Pinha 2 Dec 05, 2022
Pyjiting is a experimental Python-JIT compiler, which is the product of my undergraduate thesis

Pyjiting is a experimental Python-JIT compiler, which is the product of my undergraduate thesis. The goal is to implement a light-weight miniature general-purpose Python JIT compiler.

Lance.Moe 10 Apr 17, 2022
Lags valorant servers by rapidly picking up and throwing shorties.

Lags valorant servers by rapidly picking up and throwing shorties.

Eric Still 9 Dec 30, 2021
ToDoListAndroid - To-do list application created using Kivymd

ToDoListAndroid To-do list application created using Kivymd. Version 1.0.0 (1/Jan/2022). Planned to do next: -Add setting (theme selector, etc) -Add f

AghnatHs 1 Jan 01, 2022
Team collaborative evaluation tracker.

Team collaborative evaluation tracker.

2 Dec 19, 2021
Semantic Data Management - Property Graphs 📈

SDM - Lab 1 @ UPC 👨🏻‍💻 Table of contents Introduction Property Graph Dataset 1. Introduction This repo is all about what we have done in SDM lab 1

Mohammad Zain Abbas 1 Mar 20, 2022
Converts a base copy of Pokemon BDSP's masterdatas into a more readable and editable Pokemon Showdown Format.

Showdown-BDSP-Converter Converts a base copy of Pokemon BDSP's masterdatas into a more readable and editable Pokemon Showdown Format. Download the lat

Alden Mo 2 Jan 02, 2022
Trashselected - Plugin for fman.io to move files that has been selected in fman to trash

TrashSelected Plugin for fman.io to move files that has been selected in fman to

1 Feb 04, 2022
Albert launcher extension for rolling dice.

dice-roll-albert-ext Extension for rolling dice in Albert launcher Installation Locate the modules directory in the Python extension data directory. T

Jonah Lawrence 1 Nov 18, 2021
Simple rofi script to choose player for playerctl to execute its command

rofi-playerctl-switcher simple rofi script to choose player for playerctl to execute its command Usage copy playerSwitch.py and playerctl.sh to ~/.con

2 Jan 03, 2022
Demo repository for Saltconf21 talk - Testing strategies for Salt states

Saltconf21 testing strategies Demonstration repository for my Saltconf21 talk "Strategies for testing Salt states" Talk recording Slides and demos Get

Barney Sowood 3 Mar 31, 2022
CountdownTimer - Countdown Timer For Python

Countdown Timer This python script asks for the user time (input) in seconds, an

Arinzechukwu Okoye 1 Jan 01, 2022
This is a Python package named - calculator

Calculator Python Package This is a Calculator Package of Python. How To Install The Package? Install calchundred with pip (Package Installer Of Pytho

Arinjoy_Programmer 1 Nov 21, 2021
Export transactions for an algorand wallet to a CSV file

algorand_txn_csv_exporter - (Algorand transaction CSV exporter) This script will export transactions for an algorand wallet to a CSV file. It is inten

TeneoPython01 5 Jun 19, 2022
Use Ghidra Structs in Python

Strudra Welcome to Strudra, a way to craft Ghidra structs in python, using ghidra_bridge. Example First, init Strudra - you can pass in a custom Ghidr

Dominik Maier 27 Nov 24, 2022
This is a simple web interface for SimplyTranslate

SimplyTranslate Web This is a simple web interface for SimplyTranslate List of Instances You can find a list of instances here: SimplyTranslate Projec

4 Dec 14, 2022
Free components that wrap up Python into Delphi and Lazarus (FPC)

Python for Delphi (P4D) is a set of free components that wrap up the Python DLL into Delphi and Lazarus (FPC). They let you easily execute Python scri

747 Jan 02, 2023
An attempt at furthering Factorio Calculator to work in more general contexts.

factorio-optimizer Lets do Factorio Calculator but make it optimize. Why not use Factorio Calculator? Becuase factorio calculator is not general. The

Jonathan Woollett-Light 1 Jun 03, 2022
Scripts to integrate DFIR-IRIS, MISP and TimeSketch

Scripts to integrate DFIR-IRIS, MISP and TimeSketch

Koen Van Impe 20 Dec 16, 2022
CoreSE - basic of social Engineering tool

Core Social Engineering basic of social Engineering tool. just for fun :) About First of all, I must say that I wrote such a project because of my int

Hamed Mohammadvand 7 Jun 10, 2022