Script/Surge/iQIYI-DailyBonus/iQIYI_GetCookie.js

46 lines
1.6 KiB
JavaScript
Raw Normal View History

/*
iQIYI Daily bonus script
Update 2019.12.31 0:30
About the author:
If reproduced, indicate the source
Telegram channel: @NobyDa
Telegram bots: @NobyDa_bot
Description :
When iQiyi app is opened, click "My", If notification gets cookie success, you can use the check in script. because script will automatically judgment whether the cookie is updated, so you dont need to disable it manually.
script will be performed every day at 9 am. You can modify the execution time. and the cookie script only works for iQIYI apps in china apple store
[Script]
# iQIYI Daily bonus script
2019-12-29 16:59:59 +08:00
cron "0 9 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/iQIYI-DailyBonus/iQIYI_DailyBonus.js
# Get Cookie
http-request https?:\/\/.*\.iqiyi\.com\/.*authcookie= script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/iQIYI-DailyBonus/iQIYI_GetCookie.js
# MITM = *.iqiyi.com
*/
var regex = /authcookie=([A-Za-z0-9]+)/;
var iQIYI = regex.exec($request.url)[1];
if ($persistentStore.read("CookieQY") != null) {
if ($persistentStore.read("CookieQY") != iQIYI) {
var cookie = $persistentStore.write(iQIYI, "CookieQY");
if (!cookie) {
$notification.post("更新爱奇艺签到Cookie失败‼", "", "")
} else {
$notification.post("更新爱奇艺签到Cookie成功 🎉", "", "")
}
}
} else {
var cookie = $persistentStore.write(iQIYI, "CookieQY");
if (!cookie) {
$notification.post("首次写入爱奇艺Cookie失败‼", "", "")
} else {
$notification.post("首次写入爱奇艺Cookie成功 🎉", "", "")
}
}
$done({})