Git Product home page Git Product logo

gacha's Introduction

gacha

适用于HoshinoBot的可以自动更新的全限定卡池。包含27个限定卡池, 国服日服台服卡池, 以及混合卡池. 仅测试了v2而没有对v1进行测试. 本卡池默认不会禁言, 抽卡需要@Bot, 如果有需要请自行修改.

请务必阅读开始使用

请注意, 咖啡佬在8月5日提交了一次针对角色名称的修改b256942,将"游骑兵"更换为了"游侠", 如果您部署的时间早于此时间, 请注意更新角色名称.(#7

想法来自HoshinoBot#113, 但是从其源站获取的卡池是数字ID格式, 于是利用_pcr_data.py的数据将其转变为第一个中文名称, 更新卡池后原卡池会被备份至backup.json, 如出现错误可由此恢复.

同时可以选择自动更新角色数据和头像, 只会添加本地缺失的角色, 不会影响已有角色, 如果涉及git请注意忽略或提交.

本项目GitHub地址:https://github.com/pcrbot/gacha

Gitee地址:https://gitee.com/varmixer/gacha

卡池数据更新来源: https://api.redive.lolikon.icu/gacha/default_gacha.json

角色数据更新来源: https://api.redive.lolikon.icu/gacha/unitdata.py

指令与功能

  • 更新卡池: 更新卡池, 仅限超级管理员, 可群聊可私聊, 无需@, 无需开启服务.
  • 强制更新卡池: 不检查版本而直接覆盖本地卡池
  • 选择卡池: 与原指令相同, 请根据提示操作.
  • (自动)自动更新: 每日自动更新卡池.

其余指令与原先抽卡系统一致.

开始使用

  1. 切换至PCR模块目录下(请自行根据实际情况修改路径):
    cd ~/HoshinoBot/hoshino/modules/priconne
    
  2. 移除原有的gacha/目录, 建议自行备份以防止出现问题:
    rm gacha/ -rf 
    
  3. 在同目录下克隆本项目, 保证目录结构与原来一致, 即/hoshino/modules/priconne/gacha/:
    git clone https://github.com/pcrbot/gacha.git
    
  4. 移动文件_pcr_data.pyCHARA_NAME.jsonCHARA_PROFILE.jsonUnavailableChara.json到上级目录, 注意需要让_pcr_data.py覆盖原来的文件, 此修改与项目的其他插件完全兼容, 仅是修改了数据的保存方式, 因此无需担心(出问题我跑路)
    cd gacha/
    # 提示覆盖请确认覆盖文件
    mv _pcr_data.py ..
    mv CHARA_NAME.json ..
    mv CHARA_PROFILE.json ..
    mv UnavailableChara.json ..
    

配置

  1. 自动更新出现错误或者是发现新卡池而完成自动更新, 可通知SUPERUSER列表的第一名用户, 如果您想接受到通知, 可以将update.py第13行改为NOTICE = 1.

  2. PCRDATA_UPDATATrue时将自动更新角色昵称, 并下载头像. 角色信息保存在外部json文件中, 不会触发热重载.

更新日志

2022/6/7

  • 更新卡池信息
  • 更新200井
  • 兼容最新版HoshinoBot, 包含了UnavailableChara
  • 屏蔽远程数据库同步至本地的重复角色

2020/11/9

  • 将角色信息全部给改为json文件存储, 在启动时读取, 并且加入了动态改变角色昵称的方法, 从而在更新角色数据时不会触发全局热重载
  • 兼容最新版HoshinoBot, 包含了CHARA_PROFILE
  • 路径更换为绝对路径, 解决因启动路径而引起的报错
  • 自检, 当角色别称出现空字符时, 会自动移除

    此漏洞会引发什么问题? 当角色别称出现空字符时, 查询竞技场的指令可能导致进入死循环.

2020/10/16

  • (可选)可以自动更新角色数据(昵称)和自动下载角色头像了 #9
  • 新增指令【强制更新卡池】可以无视版本号, 强制更新本地卡池(会同时更新角色数据图标)
  • 稍微整理了下乱的要命的代码(虽然现在也是)

2020/9/29

  • 所有请求全部替换为异步调用(使用hoshino.aiorequests)
  • 定时任务改为nonebot.scheduler来触发, 不再依赖hoshino服务层

2020/9/10

  • 更新了部分游骑兵相关角色名称 #7
  • 当up角色重复出现在star3中时, 会自动移除 #8

2020/8/18

  • 解决了使用Hoshino后续版本时, 繁体指令提示冲突的问题
  • 解决了看看UP时出现USE_CQPRO不存在的问题(#1)

本模块原README

本模块基于 0皆无0(NGA uid=60429400)dalao的PCR姬器人:可可萝·Android,移植至nonebot框架而成。

重构 by IceCoffee

源代码的使用已获原作者授权。

gacha's People

Contributors

azmiao avatar bosswangst avatar destiny4073 avatar lambdayh avatar rbameto avatar var-mixer 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

Watchers

 avatar  avatar  avatar  avatar

gacha's Issues

更新卡池角色名乱序的问题

HoshinoBot对角色名的顺序是有规定的,例如第一个是台服官译名,第二个是日文原名,第三是罗马音,第四是国服官译名,昵称则往后面排,虽然实际上不太可能严格按照这个顺序排列,但也至少应该保证台服官译排在第一个,否则使用机器人相关功能。例如兰德索尔花名册,会导致查询某个角色结果出来的是昵称。
但是用此插件的更新卡池更新出来的角色名是乱序的。
数据来源来看,排在第二个的是台服官译名。如果在载入的时候能做到先载入第二个字段,然后剩下的按顺序载入就好了。

挂了

22:02:37 [ERROR] [CQHTTPMirai] java.io.IOException: ????????
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(Unknown Source)
at kotlin.io.ByteStreamsKt.copyTo(IOStreams.kt:108)
at kotlin.io.ByteStreamsKt.copyTo$default(IOStreams.kt:103)
at net.mamoe.mirai.utils.FileCacheStrategy$TempCache.newImageCache(FileCacheStrategy.jvm.kt:139)
at net.mamoe.mirai.utils.FileCacheStrategy$PlatformDefault.newImageCache(FileCacheStrategy.jvm.kt)
at net.mamoe.mirai.utils.internal.DeferredReusableInput$init$3.invokeSuspend(DeferredReusableInput.jvm.kt:23)
at net.mamoe.mirai.utils.internal.DeferredReusableInput$init$3.invoke(DeferredReusableInput.jvm.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:160)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
at net.mamoe.mirai.utils.internal.DeferredReusableInput.init(DeferredReusableInput.jvm.kt:18)
at net.mamoe.mirai.qqandroid.contact.GroupImpl.uploadImage(GroupImpl.kt:401)
at net.mamoe.mirai.utils.ExternalImageKt.upload(ExternalImage.kt:123)
at net.mamoe.mirai.message.SendImageUtilsJvmKt.uploadAsImage(SendImageUtilsJvm.kt:111)
at tech.mihoyo.mirai.util.CQMessgeParserKt$convertToMiraiMessage$$inlined$with$lambda$1.invokeSuspend(CQMessgeParser.kt:354)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

[2020-09-01 22:11:46,334 gacha] INFO: Message 8279 triggered gacha_300 by PrefixTrigger.
[2020-09-01 22:11:46,366 gacha] ERROR: <class 'aiocqhttp.exceptions.ActionFailed'> occured when gacha_300 handling message 8279.
[2020-09-01 22:11:46,366 gacha] ERROR: <ActionFailed, retcode=103>
Traceback (most recent call last):
File "E:\HoshinoBot\hoshino\msghandler.py", line 33, in handle_message
await sf.func(bot, event)
File "E:\HoshinoBot\hoshino\modules\priconne\gacha_init_.py", line 272, in gacha_300
await bot.send(ev, '\n'.join(msg), at_sender=True)
File "D:\app\python384\lib\site-packages\aiocqhttp_init_.py", line 256, in send
return await self.send_msg(**params)
File "D:\app\python384\lib\site-packages\aiocqhttp_init_.py", line 223, in call_action
return await self._api.call_action(action=action, **params)
File "D:\app\python384\lib\site-packages\aiocqhttp\api_impl.py", line 186, in call_action
result = await self._wsr_api.call_action(action, **params)
File "D:\app\python384\lib\site-packages\aiocqhttp\api_impl.py", line 161, in call_action
return _handle_api_result(
File "D:\app\python384\lib\site-packages\aiocqhttp\api_impl.py", line 51, in _handle_api_result
raise ActionFailed(retcode=result.get('retcode'))
aiocqhttp.exceptions.ActionFailed: <ActionFailed, retcode=103>
[2020-09-01 22:11:46,367 nonebot] INFO: Message 8279 is ignored

无法通过聊天指令更新卡池,bot没有回复,后台显示update.py报错

[2021-08-01 10:41:43,384 nonebot] INFO: Self: 678124561, Message 812592660 from 704156982@[群:515112116]: '更新卡池'
/root/.cache/pypoetry/virtualenvs/pcrbot-f12N20ib-py3.9/lib/python3.9/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to ho
st 'api.redive.lolikon.icu'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
warnings.warn(
[2021-08-01 10:41:44,560 hoshino] INFO: 开始对比角色数据
[2021-08-01 10:41:44,560 hoshino] INFO: 已开始更新角色1164的数据和图标
[2021-08-01 10:41:44,560 nonebot] ERROR: An exception occurred while running command ('更新卡池',):
[2021-08-01 10:41:44,560 nonebot] ERROR: module 'hoshino.modules.priconne._pcr_data' has no attribute 'chara_master'
Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/pcrbot-f12N20ib-py3.9/lib/python3.9/site-packages/nonebot/command/init.py", line 881, in _real_run_command
await asyncio.wait_for(future, timeout)
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 442, in wait_for
return await fut
File "/root/.cache/pypoetry/virtualenvs/pcrbot-f12N20ib-py3.9/lib/python3.9/site-packages/nonebot/command/init.py", line 173, in run
await self.func(session)
File "/root/pcrbot/HoshinoBot/hoshino/modules/priconne/gacha/update.py", line 231, in update_pool_chat
status = await update_pool()
File "/root/pcrbot/HoshinoBot/hoshino/modules/priconne/gacha/update.py", line 197, in update_pool
await update_pcrdata()
File "/root/pcrbot/HoshinoBot/hoshino/modules/priconne/gacha/update.py", line 67, in update_pcrdata
_pcr_data.chara_master.add_chara(id, online_pcrdata[id])
AttributeError: module 'hoshino.modules.priconne._pcr_data' has no attribute 'chara_master'

更新卡池命令会报错 想问一下原因和解决方法

C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages
urllib3\connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request
is being made to host 'api.redive.lolikon.icu'. Adding certificate verification
is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usa
ge.html#ssl-warnings
warnings.warn(
[2021-01-19 23:58:41,027 hoshino] INFO: 开始对比角色数据
[2021-01-19 23:58:41,027 hoshino] INFO: 已开始更新角色1913的数据和图标
[2021-01-19 23:58:41,027 chara] INFO: Downloading chara icon from https://redive
.estertion.win/icon/unit/191361.webp
[2021-01-19 23:58:44,121 chara] ERROR: Failed to download https://redive.esterti
on.win/icon/unit/191361.webp. HTTP 404
[2021-01-19 23:58:44,121 chara] INFO: Downloading chara icon from https://redive
.estertion.win/icon/unit/191331.webp
[2021-01-19 23:58:50,840 chara] ERROR: Failed to download https://redive.esterti
on.win/icon/unit/191331.webp. <class 'requests.exceptions.ReadTimeout'>
[2021-01-19 23:58:50,840 chara] ERROR: HTTPSConnectionPool(host='redive.estertio
n.win', port=443): Read timed out. (read timeout=5)

尝试抽卡时报错

gacha和HoshinoBot均为最新版本
日志如下:
[2022-06-28 19:06:24,675 gacha] INFO: Message -1930211332 triggered gacha_300. [2022-06-28 19:06:24,685 gacha] ERROR: <class 'AttributeError'> occured when gacha_300 handling message -1930211332. [2022-06-28 19:06:24,685 gacha] ERROR: 'coroutine' object has no attribute 'size' Traceback (most recent call last): File "D:\Documents\HoshinoBot\hoshino\msghandler.py", line 21, in handle_message await service_func.func(bot, event) File "D:\Documents\HoshinoBot\hoshino\modules\priconne\gacha\__init__.py", line 280, in gacha_300 res = concat_pic(pics) File "D:\Documents\HoshinoBot\hoshino\util\__init__.py", line 81, in concat_pic w, h = pics[0].size AttributeError: 'coroutine' object has no attribute 'size'

是否考虑增加自动写入花名册功能

目前的自动更新仅限于台B服,在日服出现新角色时控制台只会提示需要更新新ID角色的静态资源,然后因为up为空值直接替换为万圣镜华卡池。所以最终依然需要手动更新。
是否考虑利用https://api.redive.lolikon.icu/gacha/unitdata.py, 在新ID不在_pcr_data中时写入新的一行或者直接覆盖并执行重载花名册指令,从而实现新角色的自动更新。

关于新角色的别称

由于数据源的新角色数据是先添加日文原名,过几日后再追加其他别称,但自动更新只会在新角色出的时候添加一次数据的缘故,导致不手动补充的话,新角色的别称往往只有日文原名。因此认为,添加一个写入新角色后过一段时间再次检查并覆盖别称的定时任务,以及添加一个检查并覆盖别称的指令比较好。

Sent from PPHub

大概是找不到图标资源?

使用抽卡功能时出现

[2022-07-21 22:52:19,899 gacha] ERROR: 'Chara' object has no attribute 'render_icon'
Traceback (most recent call last):
File "/hobot/hoshino/msghandler.py", line 28, in handle_message
await service_func.func(bot, event)
File "/hobot/hoshino/modules/priconne/gacha/init.py", line 235, in gacha_10
res1 = await chara.gen_team_pic(result[:5], star_slot_verbose=False)
File "/hobot/hoshino/modules/priconne/chara.py", line 107, in gen_team_pic
src = chara.render_icon(size, star_slot_verbose)
AttributeError: 'Chara' object has no attribute 'render_icon'

请问这个图标是保存在哪个路径下

切换到某些特定卡池,查看卡池指令报错

Traceback (most recent call last): File "/root/HoshinoBot/hoshino/msghandler.py", line 28, in handle_message await sf.func(bot, event) File "/root/HoshinoBot/hoshino/modules/priconne/gacha/__init__.py", line 155, in set_pool await gacha_info(bot, ev) File "/root/HoshinoBot/hoshino/modules/priconne/gacha/__init__.py", line 59, in gacha_info gacha = Gacha(_group_pool[gid]) File "/root/HoshinoBot/hoshino/modules/priconne/gacha/gacha.py", line 11, in __init__ self.load_pool(pool_name) File "/root/HoshinoBot/hoshino/modules/priconne/gacha/gacha.py", line 16, in load_pool pool = config[pool_name] KeyError: 'FES'

卡池版本已是最新,如果切换卡池到fes或水黑等限定卡池,查看卡池将会报以上类似的错误

出现了#23和#15中的问题

AttributeError: module 'hoshino.modules.priconne._pcr_data' has no attribute 'chara_master'

我已经将_pcr_data.py从 /gacha 复制到了上级目录/priconne,但是每次更新卡池之后_pcr_data.py里的内容就会被覆盖成如下
image
请问该如何解决

使用新版hoshinov2的看卡池指令会出现参数报错

使用”看看卡池“等指令会出现如下报错
[2020-08-18 16:13:12, 987 nonebot] INFO: Self: *********, Message 1002047946 from @[群 :]:’看看卡池
[2020-08-18 16:13:12, 988 gacha] INFO: Message -1002047946 triggered gacha_ info by PrefixTrigger.
[2020- -08 -18 16:13:12, 988 gacha] ERROR: <class ’AttributeError' > occured when gacha_ info handling message -1002047946.
[2020-08-18 16:13:12, 988 gacha] ERROR: module’hoshino. config’ has no attribute ’USE_ CQPRO'
Traceback (most recent call last) :
File’ 'C: \Users \Administrator \Desktop \hoshinov2 Hoshi noBot \hoshino' \msghandler.py",line 33,in handle
message
await sf. func (bot, event)
File" C: \Users \Administrator \Desktop \hoshinov2 \Hoshi noBot \hoshino\service. py'”,line 218, in wrapper
return await func (bot, event)
File” C: \Users \Administrator \Desktop \hoshinov2' \HoshinoBot \hoshino \modules \pri conne \gacha__ init__ . py",line 61,in gacha_ info
if sv. bot. config. USE CQPRO:
AttributeError: module’hoshino. config' has no attribute’USE_ CQPRO'
[2020-08-18 16:13:12, 988 nonebot] INFO: Message - 1002047946 is ignored

An error occurred when running gacha update

发送 更新卡池强制更新卡池 命令,Bot 报错
日志:

[2021-11-03 13:07:45,263 nonebot] ERROR: An exception occurred while running command ('更新卡池',):
[2021-11-03 13:07:45,263 nonebot] ERROR: list index out of range
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/nonebot/command/__init__.py", line 869, in _real_run_command
    await asyncio.wait_for(future, timeout)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 408, in wait_for
    return await fut
  File "/usr/local/lib/python3.10/site-packages/nonebot/command/__init__.py", line 174, in run
    await self.func(session)
  File "/root/HoshinoBot/hoshino/modules/priconne/gacha/update.py", line 231, in update_pool_chat
    status = await update_pool()
  File "/root/HoshinoBot/hoshino/modules/priconne/gacha/update.py", line 218, in update_pool
    update_local_pool(online_pool)
  File "/root/HoshinoBot/hoshino/modules/priconne/gacha/update.py", line 176, in update_local_pool
    local_pool[server][star] = ids2names(local_pool[server][star])
  File "/root/HoshinoBot/hoshino/modules/priconne/gacha/update.py", line 82, in ids2names
    res.append(_pcr_data.CHARA_NAME[id][0])
IndexError: list index out of range

目前自己找到的临时解决方法为把 update.py 中的 update_local_pool() 中的 pool_name 中的 MIX 行注释掉
不过这个肯定不是根本的解决方法

up列表与s3列表重合导致判定出错

up列表与s3列表重合导致判定出错
如题。直接从干炸里脊api获取到的卡池列表会把当期up角色也列在s3里面,但实际上s3列表中不应填写up角色,所以导致出现up数量判定错误的问题。甚至出现明明结果里有up但评语显示吃井的情况……

(例,台服卡池,爽弓up,结果有爽弓但显示吃井)
0L%9X@ GAK4N7F74)CO@4@4

建议修改下update.py,在导入卡池时自动判定下,如果up出现在了s3列表里就自动剔除什么的)

更新卡池命令报错

一周前更新过该插件,并且强制更新卡池,可以运行,但现在更新卡池会报错,这期间没有更新过hoshinobot
启动了PCRDATA_UPDATA为True,使用更新卡池命令时,会更新从1900号以后的角色数据,直到timeout
错误信息:
[2020-10-27 20:33:59,405 hoshino] INFO: 已开始更新角色1900的数据和图标
[2020-10-27 20:33:59,405 chara] INFO: Downloading chara icon from https://redive.estertion.win/icon/unit/190061.webp
[2020-10-27 20:34:07,907 chara] ERROR: Failed to download https://redive.estertion.win/icon/unit/190061.webp. HTTP 404
[2020-10-27 20:34:07,908 chara] INFO: Downloading chara icon from https://redive.estertion.win/icon/unit/190031.webp
[2020-10-27 20:34:09,874 chara] ERROR: Failed to download https://redive.estertion.win/icon/unit/190031.webp. HTTP 404
[2020-10-27 20:34:09,875 chara] INFO: Downloading chara icon from https://redive.estertion.win/icon/unit/190011.webp
[2020-10-27 20:34:13,279 chara] ERROR: Failed to download https://redive.estertion.win/icon/unit/190011.webp. HTTP 404
[2020-10-27 20:34:13,281 hoshino] INFO: 已开始更新角色1907的数据和图标
[2020-10-27 20:34:13,281 chara] INFO: Downloading chara icon from https://redive.estertion.win/icon/unit/190761.webp
[2020-10-27 20:34:15,263 chara] ERROR: Failed to download https://redive.estertion.win/icon/unit/190761.webp. HTTP 404
[2020-10-27 20:34:15,264 chara] INFO: Downloading chara icon from https://redive.estertion.win/icon/unit/190731.webp
[2020-10-27 20:34:18,384 chara] ERROR: Failed to download https://redive.estertion.win/icon/unit/190731.webp. HTTP 404
[2020-10-27 20:34:18,385 chara] INFO: Downloading chara icon from https://redive.estertion.win/icon/unit/190711.webp
[2020-10-27 20:34:19,992 chara] ERROR: Failed to download https://redive.estertion.win/icon/unit/190711.webp. HTTP 404

省略至1916

[2020-10-27 20:34:59,465 hoshino] INFO: 已开始更新角色1916的数据和图标
[2020-10-27 20:34:59,465 chara] INFO: Downloading chara icon from https://redive.estertion.win/icon/unit/191661.webp
[2020-10-27 20:35:01,068 chara] ERROR: Failed to download https://redive.estertion.win/icon/unit/191661.webp. HTTP 404
[2020-10-27 20:35:01,069 chara] INFO: Downloading chara icon from https://redive.estertion.win/icon/unit/191631.webp
[2020-10-27 20:35:07,250 chara] ERROR: Failed to download https://redive.estertion.win/icon/unit/191631.webp. <class 'requests.exceptions.ReadTimeout'>
[2020-10-27 20:35:07,251 chara] ERROR: HTTPSConnectionPool(host='redive.estertion.win', port=443): Read timed out. (read timeout=5)
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/usr/local/python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 978, in validate_conn
conn.connect()
File "/usr/local/python3/lib/python3.8/site-packages/urllib3/connection.py", line 362, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/python3/lib/python3.8/site-packages/urllib3/util/ssl
.py", line 384, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/local/python3/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/local/python3/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/local/python3/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
socket.timeout: _ssl.c:1106: The handshake operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/python3/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 726, in urlopen
retries = retries.increment(
File "/usr/local/python3/lib/python3.8/site-packages/urllib3/util/retry.py", line 403, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/python3/lib/python3.8/site-packages/urllib3/packages/six.py", line 735, in reraise
raise value
File "/usr/local/python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "/usr/local/python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 384, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
File "/usr/local/python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 335, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='redive.estertion.win', port=443): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/HoshinoBot/hoshino/modules/priconne/chara.py", line 118, in download_chara_icon
rsp = requests.get(url, stream=True, timeout=5)
File "/usr/local/python3/lib/python3.8/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/python3/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/python3/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/python3/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/usr/local/python3/lib/python3.8/site-packages/requests/adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='redive.estertion.win', port=443): Read timed out. (read timeout=5)
[2020-10-27 20:35:07,263 nonebot] ERROR: An exception occurred while running command ('更新卡池',):
[2020-10-27 20:35:07,263 nonebot] ERROR: local variable 'rsp' referenced before assignment
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.8/site-packages/nonebot/command/init.py", line 723, in _real_run_command
await asyncio.wait_for(future, timeout)
File "/usr/local/python3/lib/python3.8/asyncio/tasks.py", line 455, in wait_for
return await fut
File "/usr/local/python3/lib/python3.8/site-packages/nonebot/command/init.py", line 101, in run
await self.func(session)
File "/root/HoshinoBot/hoshino/modules/priconne/gacha/update.py", line 261, in update_pool_chat
status = await update_pool()
File "/root/HoshinoBot/hoshino/modules/priconne/gacha/update.py", line 227, in update_pool
await update_pcrdata()
File "/root/HoshinoBot/hoshino/modules/priconne/gacha/update.py", line 73, in update_pcrdata
download_chara_icon(id, 1)
File "/root/HoshinoBot/hoshino/modules/priconne/chara.py", line 122, in download_chara_icon
if 200 == rsp.status_code:
UnboundLocalError: local variable 'rsp' referenced before assignment

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.