A-kirami / nonebot-plugin-moyu

nonebot2 摸鱼日历
MIT License
14 stars 5 forks source link

fix_url_redirect_cause_error #9

Closed cjxzdzh closed 1 year ago

cjxzdzh commented 1 year ago

这个 PR 带来了什么样的更改?

这个 PR 是否存在破坏性变更?

描述

动机和背景

其他信息

检查工作

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.41%.

Quality metrics Before After Change
Complexity 7.44 ⭐ 7.56 ⭐ 0.12 👎
Method Length 64.00 🙂 63.30 🙂 -0.70 👍
Working memory 8.00 🙂 8.11 🙂 0.11 👎
Quality 67.24% 🙂 66.83% 🙂 -0.41% 👎
Other metrics Before After Change
Lines 112 110 -2
Changed files Quality Before Quality After Quality Change
nonebot_plugin_moyu/__init__.py 67.24% 🙂 66.83% 🙂 -0.41% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
nonebot_plugin_moyu/__init__.py moyu 19 😞 163 😞 13 😞 39.22% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
nonebot_plugin_moyu/__init__.py handle_time 6 ⭐ 128 😞 8 🙂 63.74% 🙂 Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

A-kirami commented 1 year ago

httpx 支持重定向参数,没必要更换

cjxzdzh commented 1 year ago

额,我使用httpx,在我的环境下测试不通过,返回302: 抓包发现没有重定向后访问新的链接。 <!DOCTYPE html>

Redirecting to https://pic.imgdb.cn/item/63e910924757feff33ca1530.png Redirecting to https://pic.imgdb.cn/item/63e910924757feff33ca1530.png.

图片raw数据如上 环境:pyhon37,httpx==0.23.3

A-kirami commented 1 year ago

已在 #10 修复此问题