mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 15:36:44 +00:00
📝 Update setcookie help message
This commit is contained in:
parent
29efa649a3
commit
32a5a51e05
@ -136,44 +136,32 @@ class AccountCookiesPlugin(Plugin.Conversation):
|
|||||||
return CHECK_SERVER
|
return CHECK_SERVER
|
||||||
account_cookies_plugin_data.region = region
|
account_cookies_plugin_data.region = region
|
||||||
await message.reply_text(f"请输入{bbs_name}的Cookies!或回复退出取消操作", reply_markup=ReplyKeyboardRemove())
|
await message.reply_text(f"请输入{bbs_name}的Cookies!或回复退出取消操作", reply_markup=ReplyKeyboardRemove())
|
||||||
if bbs_name == "米游社":
|
javascript = (
|
||||||
help_message = (
|
"javascript:(()=>{_=(n)=>{for(i in(r=document.cookie.split(';'))){var a=r[i].split('=');if(a["
|
||||||
"<b>关于如何获取Cookies</b>\n"
|
"0].trim()==n)return a[1]}};c=_('login_ticket')||alert('无效的Cookie,请重新登录!');c&&confirm("
|
||||||
"<b>现在因为网站HttpOnly策略无法通过脚本获取,因此操作只能在PC上运行。</b>\n\n"
|
"'将Cookie复制到剪贴板?')&©(document.cookie)})(); "
|
||||||
"PC:\n"
|
)
|
||||||
"1、打开<a href='https://user.mihoyo.com/'>通行证</a>或<a href='https://www.miyoushe.com/ys/'>社区</a>并登录\n"
|
javascript_android = "javascript:(()=>{prompt('',document.cookie)})();"
|
||||||
"2、进入通行证按F12打开开发者工具\n"
|
account_host = "https://user.mihoyo.com" if bbs_name == "米游社" else "https://account.hoyoverse.com"
|
||||||
"3、将开发者工具切换至网络(Network)并点击过滤栏中的文档(Document)并刷新页面\n"
|
help_message = (
|
||||||
"4、在请求列表中选择第一个并点击\n"
|
"<b>关于如何获取Cookies</b>\n\n"
|
||||||
"5、找到并复制请求标头(Request Headers)中的<b>Cookie</b>\n"
|
"PC:\n"
|
||||||
"<u>如发现没有请求标头(Request Headers)大概因为缓存的存在需要你点击禁用缓存(Disable Cache)再次刷新页面</u>"
|
f"1、打开<a href='{account_host}'>通行证</a>并登录\n"
|
||||||
)
|
"2、按F12打开开发者工具\n"
|
||||||
else:
|
"3、将开发者工具切换至控制台(Console)\n"
|
||||||
javascript = (
|
"4、复制下方的代码,并将其粘贴在控制台中,按下回车\n"
|
||||||
"javascript:(()=>{_=(n)=>{for(i in(r=document.cookie.split(';'))){var a=r[i].split('=');if(a["
|
f"<pre><code class='javascript'>{javascript}</code></pre>\n"
|
||||||
"0].trim()==n)return a[1]}};c=_('account_id')||alert('无效的Cookie,请重新登录!');c&&confirm("
|
"Android:\n"
|
||||||
"'将Cookie复制到剪贴板?')&©(document.cookie)})(); "
|
f"1、通过 Via 打开<a href='{account_host}'>通行证</a>并登录\n"
|
||||||
)
|
"2、复制下方的代码,并将其粘贴在地址栏中,点击右侧箭头\n"
|
||||||
javascript_android = "javascript:(()=>{prompt('',document.cookie)})();"
|
f"<code>{javascript_android}</code>\n"
|
||||||
help_message = (
|
"iOS:\n"
|
||||||
f"<b>关于如何获取Cookies</b>\n\n"
|
"1、在App Store上安装Web Inspector,并在iOS设置- Safari浏览器-扩展-允许这些扩展下找到Web Inspector-打开,允许所有网站\n"
|
||||||
f"PC:\n"
|
f"2、通过 Safari 打开<a href='{account_host}'>通行证</a>并登录\n"
|
||||||
f"1、<a href='https://www.hoyolab.com/home'>打开社区并登录</a>\n"
|
"3、点击地址栏左侧的大小按钮 - Web Inspector扩展 - Console - 点击下方文本框复制下方代码粘贴:\n"
|
||||||
"2、按F12打开开发者工具\n"
|
f"<pre><code class='javascript'>{javascript}</code></pre>\n"
|
||||||
"3、将开发者工具切换至控制台(Console)\n"
|
"4、点击Console下的Execute"
|
||||||
"4、复制下方的代码,并将其粘贴在控制台中,按下回车\n"
|
)
|
||||||
f"<pre><code class='javascript'>{javascript}</code></pre>\n"
|
|
||||||
"Android:\n"
|
|
||||||
f"1、<a href='https://www.hoyolab.com/home'>通过 Via 打开 {bbs_name} 并登录</a>\n"
|
|
||||||
"2、复制下方的代码,并将其粘贴在地址栏中,点击右侧箭头\n"
|
|
||||||
f"<code>{javascript_android}</code>\n"
|
|
||||||
"iOS:\n"
|
|
||||||
"1、在App Store上安装Web Inspector,并在iOS设置- Safari浏览器-扩展-允许这些扩展下找到Web Inspector-打开,允许所有网站\n"
|
|
||||||
f"2、<a href='https://www.hoyolab.com/home'>通过 Safari 打开 {bbs_name} 并登录</a>\n"
|
|
||||||
"3、点击地址栏左侧的大小按钮 - Web Inspector扩展 - Console - 点击下方文本框复制下方代码粘贴:\n"
|
|
||||||
f"<pre><code class='javascript'>{javascript}</code></pre>\n"
|
|
||||||
"4、点击Console下的Execute"
|
|
||||||
)
|
|
||||||
await message.reply_html(help_message, disable_web_page_preview=True)
|
await message.reply_html(help_message, disable_web_page_preview=True)
|
||||||
return INPUT_COOKIES
|
return INPUT_COOKIES
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user