時光相簿每天自動簽到領空間 每日擴容50M

2021-10-09 21:44:04 字數 3628 閱讀 2323

原創文|space9

記錄美好時光 分享快樂那一刻

使用華為雲的函式工作流(functiongraph)來完成每日簽到。具體的部署教程可參見:天翼雲盤每天自動簽到**領空間 每月至少擴容3g+

myphoto.py

# -*- coding:utf-8 -*-

import hashlib

import json

import random

import time

import requests

defencrypt_pwd

(password)

: str_temp = f"tc.everphoto."

str_md5 = hashlib.md5(str_temp.encode())

.hexdigest(

)return str_md5

deflogin

(country_code, phone, password)

: mobile = f"+"

pwd = encrypt_pwd(password)

url =

""timestamp_ms =

str(

round

(time.time()*

1000))

payload =

headers =

response = requests.request(

"post"

, url, headers=headers, data=payload)

response_data = json.loads(response.text)

return response_data

deflogout

(token)

: url =

""timestamp_ms =

str(

round

(time.time()*

1000))

headers =',

'x-locked'

:'1'

,'x-timestamp-ms'

: timestamp_ms

}response = requests.request(

"delete"

, url, headers=headers)

response_data = json.loads(response.text)

code = response_data[

"code"

]if code ==0:

print

("退出成功~~~"

)else

:print

(f'退出錯誤:'

)def

checkin

(token)

: url =

""timestamp_ms =

str(

round

(time.time()*

1000))

headers =',

'x-locked'

:'1'

,'x-timestamp-ms'

: timestamp_ms

}response = requests.request(

"post"

, url, headers=headers)

response_data = json.loads(response.text)

code = response_data[

"code"

]if code ==0:

checkin_data = response_data[

"data"

]if checkin_data[

"checkin_result"]:

reward = checkin_data[

"reward"

] capacity = reward //

1048576

print

(f"簽到獲得m空間"

)else

:print

("今日已簽到"

)else

:print

(f'簽到錯誤:'

)def

auto_checkin

(country_code, phone, password)

: login_data = login(country_code, phone, password)

code = login_data[

"code"

]if code ==0:

print

(f'登入成功:'

) token = login_data[

"data"][

"token"

] time.sleep(random.randint(

800,

1200)/

1000

) checkin(token)

time.sleep(random.randint(

900,

1400)/

1000

) logout(token)

else

:print

(f'登入錯誤:'

)def

test()

:print

("測試函式"

)# auto_checkin("***", "***", "***")

if __name__ ==

'__main__'

: test(

)

index.py

# -*- coding:utf-8 -*-

import json

import myphoto

defhandler

(event, context)

: code = context.getuserdata(

"code"

) phone = context.getuserdata(

"phone"

) pwd = context.getuserdata(

"pwd")if

"+"in code:

print

("國際區號前不要填+號"

)else

:if code is

none

or phone is

none

or pwd is

none

:print

("請配置環境變數國際區號、手機號、密碼"

)else

: myphoto.auto_checkin(code, phone, pwd)

output = f'hello message: '

return output

點讚+關注我,後期更新時光相簿的批量備份的文章,敬請期待!

讓sourceSafe每天自動備份

讓sourcesafe每天自動備份 適用於vss6.0和vss2005 此文章演示了通過呼叫系統 任務計畫 來自動備份vss 作業系統 win2000,win2003 適用於vss6.0和vss2005 第一步 備份vss projects檔案 echo off title 備份projectvss...

每天自動備份mysql指令碼

1 執行 crontab e 00 00 bin bash yourpath mysqlbak.sh 2 開啟自動執行檔案 vi etc crontab 在etc中加入如下內容,讓其自動執行任務。00 00 root mysqlbak.sh 以上兩個 00 00 為每天的凌晨自動執行指令碼 分 時 ...

釘釘每天自動打卡

看這篇文章的朋友想必都是公司使用釘釘考勤打卡的,這裡直接開門見山講述如何實現釘釘自動打卡。需要留公司一部舊安卓手機,安裝釘釘和打卡軟體,定鬧鐘自動打卡。qq 2197161652 釘釘開啟極速打卡,留公司一部舊安卓手機,安裝freeclockin和釘釘軟體,定鬧鐘自動打卡。freeclockin軟體...