mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-09-20 02:23:38 +08:00
Compare commits
7 Commits
d6e7acf45f
...
1031e9f9a5
Author | SHA1 | Date | |
---|---|---|---|
1031e9f9a5 | |||
57e68ac0b9 | |||
29a807df5a | |||
59846642cc | |||
|
e45bf03e49 | ||
3421e3ac5e | |||
5a7396bada |
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
### Bug 修复
|
### Bug 修复
|
||||||
|
|
||||||
|
- :bug: 修复新版 httpx 中 proxy 不起效的问题 [@suyiiyii](https://github.com/suyiiyii) ([#669](https://github.com/MountainDash/nonebot-bison/pull/669))
|
||||||
- :bug: 修复 cookie 模块 type hint [@suyiiyii](https://github.com/suyiiyii) ([#658](https://github.com/MountainDash/nonebot-bison/pull/658))
|
- :bug: 修复 cookie 模块 type hint [@suyiiyii](https://github.com/suyiiyii) ([#658](https://github.com/MountainDash/nonebot-bison/pull/658))
|
||||||
- :bug: B站转发动态补充 DeletedItem 类型解析 [@AzideCupric](https://github.com/AzideCupric) ([#659](https://github.com/MountainDash/nonebot-bison/pull/659))
|
- :bug: B站转发动态补充 DeletedItem 类型解析 [@AzideCupric](https://github.com/AzideCupric) ([#659](https://github.com/MountainDash/nonebot-bison/pull/659))
|
||||||
- :bug: 小刻食堂cdn使用https [@phidiaLam](https://github.com/phidiaLam) ([#650](https://github.com/MountainDash/nonebot-bison/pull/650))
|
- :bug: 小刻食堂cdn使用https [@phidiaLam](https://github.com/phidiaLam) ([#650](https://github.com/MountainDash/nonebot-bison/pull/650))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM node:22.11.0 as frontend
|
FROM node:22.11.0 AS frontend
|
||||||
ADD . /app
|
ADD . /app
|
||||||
WORKDIR /app/admin-frontend
|
WORKDIR /app/admin-frontend
|
||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# syntax=docker/dockerfile:1.10
|
# syntax=docker/dockerfile:1.10
|
||||||
FROM python:3.11-slim-bullseye as base
|
FROM python:3.11-slim-bullseye AS base
|
||||||
|
|
||||||
FROM base as builder
|
FROM base AS builder
|
||||||
|
|
||||||
ENV PYTHONFAULTHANDLER=1 \
|
ENV PYTHONFAULTHANDLER=1 \
|
||||||
PYTHONUNBUFFERED=1 \
|
PYTHONUNBUFFERED=1 \
|
||||||
@ -12,7 +12,6 @@ ENV PYTHONFAULTHANDLER=1 \
|
|||||||
POETRY_NO_INTERACTION=1 \
|
POETRY_NO_INTERACTION=1 \
|
||||||
POETRY_VIRTUALENVS_CREATE=false \
|
POETRY_VIRTUALENVS_CREATE=false \
|
||||||
PATH="$PATH:/runtime/bin" \
|
PATH="$PATH:/runtime/bin" \
|
||||||
PYTHONPATH="$PYTHONPATH:/runtime/lib/python3.10/site-packages" \
|
|
||||||
# Versions:
|
# Versions:
|
||||||
POETRY_VERSION=1.7.1
|
POETRY_VERSION=1.7.1
|
||||||
RUN apt-get update && apt-get install -y build-essential unzip wget python-dev git
|
RUN apt-get update && apt-get install -y build-essential unzip wget python-dev git
|
||||||
@ -25,7 +24,7 @@ COPY README.md pyproject.toml poetry.lock /src/
|
|||||||
RUN poetry export --only=main,docker --without-hashes --no-interaction --no-ansi -f requirements.txt -o requirements.txt
|
RUN poetry export --only=main,docker --without-hashes --no-interaction --no-ansi -f requirements.txt -o requirements.txt
|
||||||
RUN pip install --prefix=/runtime --force-reinstall -r requirements.txt
|
RUN pip install --prefix=/runtime --force-reinstall -r requirements.txt
|
||||||
|
|
||||||
FROM base as runtime
|
FROM base AS runtime
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN --mount=type=cache,target=/var/cache/apt \
|
RUN --mount=type=cache,target=/var/cache/apt \
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# syntax=docker/dockerfile:1.10
|
# syntax=docker/dockerfile:1.10
|
||||||
FROM python:3.11-slim-bullseye as base
|
FROM python:3.11-slim-bullseye AS base
|
||||||
|
|
||||||
FROM base as builder
|
FROM base AS builder
|
||||||
|
|
||||||
ENV PYTHONFAULTHANDLER=1 \
|
ENV PYTHONFAULTHANDLER=1 \
|
||||||
PYTHONUNBUFFERED=1 \
|
PYTHONUNBUFFERED=1 \
|
||||||
@ -12,7 +12,6 @@ ENV PYTHONFAULTHANDLER=1 \
|
|||||||
POETRY_NO_INTERACTION=1 \
|
POETRY_NO_INTERACTION=1 \
|
||||||
POETRY_VIRTUALENVS_CREATE=false \
|
POETRY_VIRTUALENVS_CREATE=false \
|
||||||
PATH="$PATH:/runtime/bin" \
|
PATH="$PATH:/runtime/bin" \
|
||||||
PYTHONPATH="$PYTHONPATH:/runtime/lib/python3.10/site-packages" \
|
|
||||||
# Versions:
|
# Versions:
|
||||||
POETRY_VERSION=1.7.1
|
POETRY_VERSION=1.7.1
|
||||||
RUN apt-get update && apt-get install -y build-essential unzip wget python3-dev git
|
RUN apt-get update && apt-get install -y build-essential unzip wget python3-dev git
|
||||||
@ -25,7 +24,7 @@ COPY pyproject.toml poetry.lock /src/
|
|||||||
RUN poetry export --only=main,docker --without-hashes --no-interaction --no-ansi -f requirements.txt -o requirements.txt
|
RUN poetry export --only=main,docker --without-hashes --no-interaction --no-ansi -f requirements.txt -o requirements.txt
|
||||||
RUN pip install --prefix=/runtime --force-reinstall -r requirements.txt
|
RUN pip install --prefix=/runtime --force-reinstall -r requirements.txt
|
||||||
|
|
||||||
FROM base as runtime
|
FROM base AS runtime
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN --mount=type=cache,target=/var/cache/apt \
|
RUN --mount=type=cache,target=/var/cache/apt \
|
||||||
|
@ -91,9 +91,12 @@ class BilibiliClientManager(CookieClientManager):
|
|||||||
async def _choose_cookie(self, target: Target | None) -> CookieModel:
|
async def _choose_cookie(self, target: Target | None) -> CookieModel:
|
||||||
"""选择 cookie 的具体算法"""
|
"""选择 cookie 的具体算法"""
|
||||||
if self._current_user_cookie is None:
|
if self._current_user_cookie is None:
|
||||||
|
# 若当前没有选定用户 cookie 则尝试获取
|
||||||
self._current_user_cookie = await self._get_next_user_cookie()
|
self._current_user_cookie = await self._get_next_user_cookie()
|
||||||
if self._current_user_cookie:
|
if self._current_user_cookie:
|
||||||
|
# 如果当前有选定的用户 cookie 则直接返回
|
||||||
return self._current_user_cookie
|
return self._current_user_cookie
|
||||||
|
# 否则返回匿名 cookie
|
||||||
return (await config.get_cookie(self._site_name, is_anonymous=True))[0]
|
return (await config.get_cookie(self._site_name, is_anonymous=True))[0]
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -3,7 +3,7 @@ import httpx
|
|||||||
from nonebot_bison.plugin_config import plugin_config
|
from nonebot_bison.plugin_config import plugin_config
|
||||||
|
|
||||||
http_args = {
|
http_args = {
|
||||||
"proxies": plugin_config.bison_proxy or None,
|
"proxy": plugin_config.bison_proxy or None,
|
||||||
}
|
}
|
||||||
http_headers = {"user-agent": plugin_config.bison_ua}
|
http_headers = {"user-agent": plugin_config.bison_ua}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user