From eaca64aa3a303dc0152ce370eecc7870dd4427e6 Mon Sep 17 00:00:00 2001 From: xiaoyu <20634089+897601689@users.noreply.github.com> Date: Fri, 8 Aug 2025 13:08:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=85=E7=94=B5=E5=8F=82?= =?UTF-8?q?=E6=95=B0open=5Felec=E4=B8=BAcharging=5Fpay=20(#1410)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a62514bbf98df40e7a0e337df28d6cf2bb59d298e80c5f.json | 4 ++-- ...f128b46391474b34bcba311abc3e17f1b14ad5f04cfba1.json | 4 ++-- ...ae6f8b299d3bdf541324588021897cb8ca2594e428806c.json | 4 ++-- app/lib/api-streamer.ts | 2 +- app/ui/TemplateFields.tsx | 2 +- app/upload-manager/add/page.tsx | 2 +- app/upload-manager/edit/page.tsx | 4 ++-- biliup/database/models.py | 2 +- biliup/plugins/bili_webup.py | 2 +- biliup/plugins/bili_webup_sync.py | 10 +++++----- biliup/plugins/biliuprs.py | 6 +++--- biliup/plugins/stream_gears.py | 6 +++--- biliup/uploader.py | 4 ++-- crates/biliup-cli/migrations/1_initial.sql | 4 ++-- crates/biliup-cli/src/server/core/upload_streamers.rs | 6 +++--- .../repositories/upload_streamers_repository.rs | 10 +++++----- crates/biliup/src/uploader/bilibili.rs | 2 +- crates/stream-gears/src/lib.rs | 6 +++--- crates/stream-gears/src/uploader.rs | 6 +++--- crates/stream-gears/stream_gears/stream_gears.pyi | 4 ++-- crates/stream-gears/tests/test_upload.py | 2 +- public/config.toml | 2 +- public/config.yaml | 2 +- 23 files changed, 48 insertions(+), 48 deletions(-) diff --git a/.sqlx/query-244489f42e7a598ba2a62514bbf98df40e7a0e337df28d6cf2bb59d298e80c5f.json b/.sqlx/query-244489f42e7a598ba2a62514bbf98df40e7a0e337df28d6cf2bb59d298e80c5f.json index ce2d450..a5cb2b6 100644 --- a/.sqlx/query-244489f42e7a598ba2a62514bbf98df40e7a0e337df28d6cf2bb59d298e80c5f.json +++ b/.sqlx/query-244489f42e7a598ba2a62514bbf98df40e7a0e337df28d6cf2bb59d298e80c5f.json @@ -1,6 +1,6 @@ { "db_name": "SQLite", - "query": "select id,\n template_name as \"template_name!\",\n user,\n copyright as \"copyright!: u8\",\n \"source\" as \"source!\",\n tid as \"tid!: u16\",\n cover as \"cover!\",\n title as \"title!\",\n \"desc\" as \"desc!\",\n \"dynamic\" as \"dynamic!\",\n tag as \"tag!\",\n dtime as \"dtime: u32\",\n interactive as \"interactive!: u8\",\n mission_id as \"mission_id: u32\",\n dolby as \"dolby!: u8\",\n lossless_music as \"lossless_music!: u8\",\n no_reprint as \"no_reprint!: u8\",\n open_elec as \"open_elec!: u8\",\n up_selection_reply as \"up_selection_reply!: bool\",\n up_close_reply as \"up_close_reply!: bool\",\n up_close_danmu as \"up_close_danmu!: bool\"\n from upload_streamers", + "query": "select id,\n template_name as \"template_name!\",\n user,\n copyright as \"copyright!: u8\",\n \"source\" as \"source!\",\n tid as \"tid!: u16\",\n cover as \"cover!\",\n title as \"title!\",\n \"desc\" as \"desc!\",\n \"dynamic\" as \"dynamic!\",\n tag as \"tag!\",\n dtime as \"dtime: u32\",\n interactive as \"interactive!: u8\",\n mission_id as \"mission_id: u32\",\n dolby as \"dolby!: u8\",\n lossless_music as \"lossless_music!: u8\",\n no_reprint as \"no_reprint!: u8\",\n charging_pay as \"charging_pay!: u8\",\n up_selection_reply as \"up_selection_reply!: bool\",\n up_close_reply as \"up_close_reply!: bool\",\n up_close_danmu as \"up_close_danmu!: bool\"\n from upload_streamers", "describe": { "columns": [ { @@ -89,7 +89,7 @@ "type_info": "Int64" }, { - "name": "open_elec!: u8", + "name": "charging_pay!: u8", "ordinal": 17, "type_info": "Int64" }, diff --git a/.sqlx/query-29f8fa25bd2febaf16f128b46391474b34bcba311abc3e17f1b14ad5f04cfba1.json b/.sqlx/query-29f8fa25bd2febaf16f128b46391474b34bcba311abc3e17f1b14ad5f04cfba1.json index c71d9e7..fed1c44 100644 --- a/.sqlx/query-29f8fa25bd2febaf16f128b46391474b34bcba311abc3e17f1b14ad5f04cfba1.json +++ b/.sqlx/query-29f8fa25bd2febaf16f128b46391474b34bcba311abc3e17f1b14ad5f04cfba1.json @@ -1,6 +1,6 @@ { "db_name": "SQLite", - "query": "insert into upload_streamers(\n template_name,\n user,\n copyright,\n source,\n tid,\n cover,\n title,\n 'desc',\n dynamic,\n tag,\n dtime,\n interactive,\n mission_id,\n dolby,\n lossless_music,\n no_reprint,\n open_elec,\n up_selection_reply,\n up_close_reply,\n up_close_danmu\n )\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20)\n returning\n id,\n template_name as \"template_name!\",\n user as \"user!\",\n copyright as \"copyright!: u8\",\n source as \"source!\",\n tid as \"tid!: u16\",\n cover as \"cover!\",\n title as \"title!\",\n \"desc\" as \"desc!\",\n dynamic as \"dynamic!\",\n tag as \"tag!\",\n dtime as \"dtime: u32\",\n interactive as \"interactive!: u8\",\n mission_id as \"mission_id: u32\",\n dolby as \"dolby!: u8\",\n lossless_music as \"lossless_music!: u8\",\n no_reprint as \"no_reprint!: u8\",\n open_elec as \"open_elec!: u8\",\n up_selection_reply as \"up_selection_reply!: bool\",\n up_close_reply as \"up_close_reply!: bool\",\n up_close_danmu as \"up_close_danmu!: bool\"", + "query": "insert into upload_streamers(\n template_name,\n user,\n copyright,\n source,\n tid,\n cover,\n title,\n 'desc',\n dynamic,\n tag,\n dtime,\n interactive,\n mission_id,\n dolby,\n lossless_music,\n no_reprint,\n charging_pay,\n up_selection_reply,\n up_close_reply,\n up_close_danmu\n )\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20)\n returning\n id,\n template_name as \"template_name!\",\n user as \"user!\",\n copyright as \"copyright!: u8\",\n source as \"source!\",\n tid as \"tid!: u16\",\n cover as \"cover!\",\n title as \"title!\",\n \"desc\" as \"desc!\",\n dynamic as \"dynamic!\",\n tag as \"tag!\",\n dtime as \"dtime: u32\",\n interactive as \"interactive!: u8\",\n mission_id as \"mission_id: u32\",\n dolby as \"dolby!: u8\",\n lossless_music as \"lossless_music!: u8\",\n no_reprint as \"no_reprint!: u8\",\n charging_pay as \"charging_pay!: u8\",\n up_selection_reply as \"up_selection_reply!: bool\",\n up_close_reply as \"up_close_reply!: bool\",\n up_close_danmu as \"up_close_danmu!: bool\"", "describe": { "columns": [ { @@ -89,7 +89,7 @@ "type_info": "Int64" }, { - "name": "open_elec!: u8", + "name": "charging_pay!: u8", "ordinal": 17, "type_info": "Int64" }, diff --git a/.sqlx/query-f689c99cd87d324b7bae6f8b299d3bdf541324588021897cb8ca2594e428806c.json b/.sqlx/query-f689c99cd87d324b7bae6f8b299d3bdf541324588021897cb8ca2594e428806c.json index 13a74b0..033d340 100644 --- a/.sqlx/query-f689c99cd87d324b7bae6f8b299d3bdf541324588021897cb8ca2594e428806c.json +++ b/.sqlx/query-f689c99cd87d324b7bae6f8b299d3bdf541324588021897cb8ca2594e428806c.json @@ -1,6 +1,6 @@ { "db_name": "SQLite", - "query": "\n select\n id, template_name as \"template_name!\", user, copyright as \"copyright!: u8\", source as \"source!\", tid as \"tid!: u16\", cover as \"cover!\", title as \"title!\", desc as \"desc!\", dynamic as \"dynamic!\", tag as \"tag!\", dtime as \"dtime: u32\", interactive as \"interactive!: u8\", mission_id as \"mission_id: u32\", dolby as \"dolby!: u8\", lossless_music as \"lossless_music!: u8\", no_reprint as \"no_reprint!: u8\", open_elec as \"open_elec!: u8\", up_selection_reply as \"up_selection_reply!: bool\", up_close_reply as \"up_close_reply!: bool\", up_close_danmu as \"up_close_danmu!: bool\"\n from upload_streamers\n where\n id = $1\n ", + "query": "\n select\n id, template_name as \"template_name!\", user, copyright as \"copyright!: u8\", source as \"source!\", tid as \"tid!: u16\", cover as \"cover!\", title as \"title!\", desc as \"desc!\", dynamic as \"dynamic!\", tag as \"tag!\", dtime as \"dtime: u32\", interactive as \"interactive!: u8\", mission_id as \"mission_id: u32\", dolby as \"dolby!: u8\", lossless_music as \"lossless_music!: u8\", no_reprint as \"no_reprint!: u8\", charging_pay as \"charging_pay!: u8\", up_selection_reply as \"up_selection_reply!: bool\", up_close_reply as \"up_close_reply!: bool\", up_close_danmu as \"up_close_danmu!: bool\"\n from upload_streamers\n where\n id = $1\n ", "describe": { "columns": [ { @@ -89,7 +89,7 @@ "type_info": "Int64" }, { - "name": "open_elec!: u8", + "name": "charging_pay!: u8", "ordinal": 17, "type_info": "Int64" }, diff --git a/app/lib/api-streamer.ts b/app/lib/api-streamer.ts index 75b2b70..9a1c87c 100644 --- a/app/lib/api-streamer.ts +++ b/app/lib/api-streamer.ts @@ -189,7 +189,7 @@ export interface StudioEntity { up_selection_reply: number; up_close_reply: number; up_close_danmu: number; - open_elec: number; + charging_pay: number; credits: Credit[]; uploader: string; extra_fields?: string; diff --git a/app/ui/TemplateFields.tsx b/app/ui/TemplateFields.tsx index 4a4752f..858f677 100644 --- a/app/ui/TemplateFields.tsx +++ b/app/ui/TemplateFields.tsx @@ -101,7 +101,7 @@ const TemplateFields: React.FC> - + {({ add, arrayFields }) => ( diff --git a/app/upload-manager/add/page.tsx b/app/upload-manager/add/page.tsx index afd5556..6e3ab38 100644 --- a/app/upload-manager/add/page.tsx +++ b/app/upload-manager/add/page.tsx @@ -71,7 +71,7 @@ export default function Add() { up_selection_reply: values.interaction?.includes('up_selection_reply') ? 1 : 0, up_close_reply: values.interaction?.includes('up_close_reply') ? 1 : 0, up_close_danmu: values.interaction?.includes('up_close_danmu') ? 1 : 0, - open_elec: values.open_elec ? 1 : 0, + charging_pay: values.charging_pay ? 1 : 0, no_reprint: values.no_reprint ? 1 : 0, is_only_self: values.is_only_self ? 1 : 0, mission_id: values.mission_id, diff --git a/app/upload-manager/edit/page.tsx b/app/upload-manager/edit/page.tsx index 2ae8019..bad107e 100644 --- a/app/upload-manager/edit/page.tsx +++ b/app/upload-manager/edit/page.tsx @@ -57,7 +57,7 @@ const Edit = () => { interaction: (data.up_close_danmu === 1 ? ['up_close_danmu'] : []) .concat(data.up_close_reply === 1 ? ['up_close_reply'] : []) .concat(data.up_selection_reply === 1 ? ['up_selection_reply'] : []), - open_elec: data.open_elec === 1, + charging_pay: data.charging_pay === 1, no_reprint: data.no_reprint === 1, is_only_self: data.is_only_self === 1, isDtime: data.dtime ? true : false, @@ -87,7 +87,7 @@ const Edit = () => { up_selection_reply: values?.interaction.includes('up_selection_reply') ? 1 : 0, up_close_reply: values?.interaction.includes('up_close_reply') ? 1 : 0, up_close_danmu: values?.interaction.includes('up_close_danmu') ? 1 : 0, - open_elec: values?.open_elec ? 1 : 0, + charging_pay: values?.charging_pay ? 1 : 0, no_reprint: values?.no_reprint ? 1 : 0, is_only_self: values?.is_only_self ? 1 : 0, mission_id: values?.mission_id, diff --git a/biliup/database/models.py b/biliup/database/models.py index 7d545e6..ea55a6f 100644 --- a/biliup/database/models.py +++ b/biliup/database/models.py @@ -121,7 +121,7 @@ class UploadStreamers(BaseModel): dtime: Mapped[int] = mapped_column(nullable=True) # 设置延时发布时间,距离提交大于2小时,格式为时间戳 dolby: Mapped[int] = mapped_column(nullable=True) # 是否开启杜比音效, 1为开启 hires: Mapped[int] = mapped_column(nullable=True) # 是否开启Hi-Res, 1为开启 - open_elec: Mapped[int] = mapped_column(nullable=True) # 是否开启充电面板, 1为开启 + charging_pay: Mapped[int] = mapped_column(nullable=True) # 是否开启充电面板, 1为开启 no_reprint: Mapped[int] = mapped_column(nullable=True) # 自制声明, 1为未经允许禁止转载 is_only_self: Mapped[int] = mapped_column(nullable=True) # 可见范围, 1为仅自己可见 uploader: Mapped[str] = mapped_column(nullable=True) # 覆盖全局默认上传插件,Noop为不上传,但会执行后处理 diff --git a/biliup/plugins/bili_webup.py b/biliup/plugins/bili_webup.py index 3ba9700..a16e557 100644 --- a/biliup/plugins/bili_webup.py +++ b/biliup/plugins/bili_webup.py @@ -778,7 +778,7 @@ class Data: # interactive: int = 0 # no_reprint: int 1 - # open_elec: int 1 + # charging_pay: int 1 def __post_init__(self, open_subtitle): self.subtitle = {"open": int(open_subtitle), "lan": ""} diff --git a/biliup/plugins/bili_webup_sync.py b/biliup/plugins/bili_webup_sync.py index 9d4cdbf..aab644e 100644 --- a/biliup/plugins/bili_webup_sync.py +++ b/biliup/plugins/bili_webup_sync.py @@ -41,7 +41,7 @@ class BiliWebAsync(UploadBase): def __init__( self, principal, data, submit_api=None, copyright=2, postprocessor=None, dtime=None, dynamic='', lines='AUTO', threads=3, tid=122, tags=None, cover_path=None, description='', - dolby=0, hires=0, no_reprint=0, is_only_self=0, open_elec=0, credits=None, + dolby=0, hires=0, no_reprint=0, is_only_self=0, charging_pay=0, credits=None, user_cookie='cookies.json', copyright_source=None, extra_fields="", video_queue=None ): super().__init__(principal, data, persistence_path='bili.cookie', postprocessor=postprocessor) @@ -69,7 +69,7 @@ class BiliWebAsync(UploadBase): self.hires = hires self.no_reprint = no_reprint self.is_only_self = is_only_self - self.open_elec = open_elec + self.charging_pay = charging_pay self.copyright_source = copyright_source self.extra_fields = extra_fields @@ -112,7 +112,7 @@ class BiliWebAsync(UploadBase): videos.hires = self.hires videos.no_reprint = self.no_reprint videos.is_only_self = self.is_only_self - videos.open_elec = self.open_elec + videos.charging_pay = self.charging_pay thread_list = [] while True: @@ -797,13 +797,13 @@ class Data: hires: int = 0 no_reprint: int = 0 is_only_self: int = 0 - open_elec: int = 0 + charging_pay: int = 0 extra_fields: str = "" aid: int = None # interactive: int = 0 # no_reprint: int 1 - # open_elec: int 1 + # charging_pay: int 1 def __post_init__(self, open_subtitle): self.subtitle = {"open": int(open_subtitle), "lan": ""} diff --git a/biliup/plugins/biliuprs.py b/biliup/plugins/biliuprs.py index 503389e..5f4106f 100644 --- a/biliup/plugins/biliuprs.py +++ b/biliup/plugins/biliuprs.py @@ -15,7 +15,7 @@ class BiliWeb(UploadBase): self, principal, data, submit_api: Optional[Union[SubmitOption, str]] = None, copyright=2, postprocessor=None, dtime=None, dynamic='', lines='AUTO', threads=3, tid=122, tags=None, cover_path=None, description='', - dolby=0, hires=0, no_reprint=0, is_only_self=0, open_elec=0, credits=None, + dolby=0, hires=0, no_reprint=0, is_only_self=0, charging_pay=0, credits=None, user_cookie='cookies.json', copyright_source=None, extra_fields = "" ): super().__init__(principal, data, persistence_path='bili.cookie', postprocessor=postprocessor) @@ -43,7 +43,7 @@ class BiliWeb(UploadBase): self.hires = hires self.no_reprint = no_reprint self.is_only_self = is_only_self - self.open_elec = open_elec + self.charging_pay = charging_pay self.user_cookie = user_cookie self.copyright_source = copyright_source @@ -80,7 +80,7 @@ class BiliWeb(UploadBase): "dolby": self.dolby, "lossless_music": self.hires, "no_reprint": self.no_reprint, - "open_elec": self.open_elec, + "charging_pay": self.charging_pay, "limit": self.threads, "desc_v2": desc_v2, "extra_fields": self.extra_fields, diff --git a/biliup/plugins/stream_gears.py b/biliup/plugins/stream_gears.py index 5bc73b8..0414800 100644 --- a/biliup/plugins/stream_gears.py +++ b/biliup/plugins/stream_gears.py @@ -14,7 +14,7 @@ class BiliWeb(UploadBase): self, principal, data, submit_api: Optional[Union[SubmitOption, str]] = None, copyright=2, postprocessor=None, dtime=None, dynamic='', lines='AUTO', threads=3, tid=122, tags=None, cover_path=None, description='', - dolby=0, hires=0, no_reprint=0, open_elec=0, credits=None, + dolby=0, hires=0, no_reprint=0, charging_pay=0, credits=None, user_cookie='cookies.json', copyright_source=None, extra_fields = "" ): super().__init__(principal, data, persistence_path='bili.cookie', postprocessor=postprocessor) @@ -41,7 +41,7 @@ class BiliWeb(UploadBase): self.dolby = dolby self.hires = hires self.no_reprint = no_reprint - self.open_elec = open_elec + self.charging_pay = charging_pay self.user_cookie = user_cookie self.copyright_source = copyright_source @@ -94,7 +94,7 @@ class BiliWeb(UploadBase): dolby=self.dolby, lossless_music=self.hires, no_reprint=self.no_reprint, - open_elec=self.open_elec, + charging_pay=self.charging_pay, limit=self.threads, desc_v2=desc_v2, dtime=dtime, diff --git a/biliup/uploader.py b/biliup/uploader.py index aa3d3f0..faf4d3a 100644 --- a/biliup/uploader.py +++ b/biliup/uploader.py @@ -46,7 +46,7 @@ def upload(data): data['no_reprint'] = config.get('no_reprint', 0) data['extra_fields'] = json.dumps(merge_dict(context.get('extra_fields', {}), {"is_only_self": context.get('is_only_self', 0)})) - data['open_elec'] = config.get('open_elec', 0) + data['charging_pay'] = config.get('charging_pay', 0) sig = inspect.signature(cls) kwargs = {} for k in sig.parameters: @@ -72,7 +72,7 @@ def biliup_uploader(filelist, data): data['no_reprint'] = data.get('no_reprint', 0) data['extra_fields'] = json.dumps(merge_dict(data.get('extra_fields', ''), {"is_only_self": data.get('is_only_self', 0)})) - data['open_elec'] = data.get('open_elec', 0) + data['charging_pay'] = data.get('charging_pay', 0) sig = inspect.signature(cls) kwargs = {} for k in sig.parameters: diff --git a/crates/biliup-cli/migrations/1_initial.sql b/crates/biliup-cli/migrations/1_initial.sql index 9f63253..4fff3c9 100644 --- a/crates/biliup-cli/migrations/1_initial.sql +++ b/crates/biliup-cli/migrations/1_initial.sql @@ -28,7 +28,7 @@ create table if not exists upload_streamers dolby INTEGER not null default 0, lossless_music INTEGER not null default 0, no_reprint INTEGER not null default 0, - open_elec INTEGER not null default 0, + charging_pay INTEGER not null default 0, up_selection_reply INTEGER not null default 0, up_close_reply INTEGER not null default 0, up_close_danmu INTEGER not null default 0 @@ -76,6 +76,6 @@ create table if not exists videos -- -- create index if not exists users_email_idx on users (email); -- insert or ignore into upload_streamers (template_name, copyright, source, cover, title, desc, dynamic, tag, dtime, --- interactive, mission_id, dolby, lossless_music, no_reprint, open_elec, +-- interactive, mission_id, dolby, lossless_music, no_reprint, charging_pay, -- up_selection_reply, up_close_reply, up_close_danmu) -- values ('空模板', 1, '', '', '', '', '', '', null, 0, null, 0, 0, null, 0, 0, 0, null); \ No newline at end of file diff --git a/crates/biliup-cli/src/server/core/upload_streamers.rs b/crates/biliup-cli/src/server/core/upload_streamers.rs index 96375dc..769bc26 100644 --- a/crates/biliup-cli/src/server/core/upload_streamers.rs +++ b/crates/biliup-cli/src/server/core/upload_streamers.rs @@ -46,7 +46,7 @@ pub struct StudioEntity { pub dolby: u8, pub lossless_music: u8, pub no_reprint: u8, - pub open_elec: u8, + pub charging_pay: u8, pub up_selection_reply: bool, pub up_close_reply: bool, pub up_close_danmu: bool, @@ -75,7 +75,7 @@ impl StudioEntity { dolby: self.dolby, lossless_music: self.lossless_music, no_reprint: self.no_reprint, - open_elec: self.open_elec, + charging_pay: self.charging_pay, aid: None, up_selection_reply: self.up_selection_reply, up_close_reply: self.up_close_reply, @@ -121,7 +121,7 @@ impl Default for StudioEntity { dolby: 0, lossless_music: 0, no_reprint: 0, - open_elec: 0, + charging_pay: 0, up_selection_reply: false, up_close_reply: false, up_close_danmu: false, diff --git a/crates/biliup-cli/src/server/infrastructure/repositories/upload_streamers_repository.rs b/crates/biliup-cli/src/server/infrastructure/repositories/upload_streamers_repository.rs index d9c458d..cbf46d7 100644 --- a/crates/biliup-cli/src/server/infrastructure/repositories/upload_streamers_repository.rs +++ b/crates/biliup-cli/src/server/infrastructure/repositories/upload_streamers_repository.rs @@ -38,7 +38,7 @@ impl UploadStreamersRepository for SqliteUploadStreamersRepository { dolby, lossless_music, no_reprint, - open_elec, + charging_pay, up_selection_reply, up_close_reply, up_close_danmu @@ -62,7 +62,7 @@ impl UploadStreamersRepository for SqliteUploadStreamersRepository { dolby as "dolby!: u8", lossless_music as "lossless_music!: u8", no_reprint as "no_reprint!: u8", - open_elec as "open_elec!: u8", + charging_pay as "charging_pay!: u8", up_selection_reply as "up_selection_reply!: bool", up_close_reply as "up_close_reply!: bool", up_close_danmu as "up_close_danmu!: bool""#, @@ -82,7 +82,7 @@ impl UploadStreamersRepository for SqliteUploadStreamersRepository { studio.dolby, studio.lossless_music, studio.no_reprint, - studio.open_elec, + studio.charging_pay, studio.up_selection_reply, studio.up_close_reply, studio.up_close_danmu, @@ -120,7 +120,7 @@ impl UploadStreamersRepository for SqliteUploadStreamersRepository { dolby as "dolby!: u8", lossless_music as "lossless_music!: u8", no_reprint as "no_reprint!: u8", - open_elec as "open_elec!: u8", + charging_pay as "charging_pay!: u8", up_selection_reply as "up_selection_reply!: bool", up_close_reply as "up_close_reply!: bool", up_close_danmu as "up_close_danmu!: bool" @@ -136,7 +136,7 @@ impl UploadStreamersRepository for SqliteUploadStreamersRepository { StudioEntity, r#" select - id, template_name as "template_name!", user, copyright as "copyright!: u8", source as "source!", tid as "tid!: u16", cover as "cover!", title as "title!", desc as "desc!", dynamic as "dynamic!", tag as "tag!", dtime as "dtime: u32", interactive as "interactive!: u8", mission_id as "mission_id: u32", dolby as "dolby!: u8", lossless_music as "lossless_music!: u8", no_reprint as "no_reprint!: u8", open_elec as "open_elec!: u8", up_selection_reply as "up_selection_reply!: bool", up_close_reply as "up_close_reply!: bool", up_close_danmu as "up_close_danmu!: bool" + id, template_name as "template_name!", user, copyright as "copyright!: u8", source as "source!", tid as "tid!: u16", cover as "cover!", title as "title!", desc as "desc!", dynamic as "dynamic!", tag as "tag!", dtime as "dtime: u32", interactive as "interactive!: u8", mission_id as "mission_id: u32", dolby as "dolby!: u8", lossless_music as "lossless_music!: u8", no_reprint as "no_reprint!: u8", charging_pay as "charging_pay!: u8", up_selection_reply as "up_selection_reply!: bool", up_close_reply as "up_close_reply!: bool", up_close_danmu as "up_close_danmu!: bool" from upload_streamers where id = $1 diff --git a/crates/biliup/src/uploader/bilibili.rs b/crates/biliup/src/uploader/bilibili.rs index b6c16f0..49f0a92 100644 --- a/crates/biliup/src/uploader/bilibili.rs +++ b/crates/biliup/src/uploader/bilibili.rs @@ -107,7 +107,7 @@ pub struct Studio { /// 是否开启充电, 0-关闭 1-开启 #[cfg_attr(feature = "cli", clap(long, default_value = "0"))] #[serde(default)] - pub open_elec: u8, + pub charging_pay: u8, /// aid 要追加视频的 avid #[cfg_attr(feature = "cli", clap(skip))] diff --git a/crates/stream-gears/src/lib.rs b/crates/stream-gears/src/lib.rs index 4220f9b..76ba482 100644 --- a/crates/stream-gears/src/lib.rs +++ b/crates/stream-gears/src/lib.rs @@ -241,7 +241,7 @@ fn login_by_web_qrcode( #[allow(clippy::too_many_arguments)] #[pyfunction] -#[pyo3(signature = (video_path, cookie_file, title, tid=171, tag="".to_string(), copyright=2, source="".to_string(), desc="".to_string(), dynamic="".to_string(), cover="".to_string(), dolby=0, lossless_music=0, no_reprint=0, open_elec=0, up_close_reply=false, up_selection_reply=false, up_close_danmu=false, limit=3, desc_v2=vec![], dtime=None, line=None, extra_fields="".to_string(), submit=None, proxy=None))] +#[pyo3(signature = (video_path, cookie_file, title, tid=171, tag="".to_string(), copyright=2, source="".to_string(), desc="".to_string(), dynamic="".to_string(), cover="".to_string(), dolby=0, lossless_music=0, no_reprint=0, charging_pay=0, up_close_reply=false, up_selection_reply=false, up_close_danmu=false, limit=3, desc_v2=vec![], dtime=None, line=None, extra_fields="".to_string(), submit=None, proxy=None))] fn upload( py: Python<'_>, video_path: Vec, @@ -257,7 +257,7 @@ fn upload( dolby: u8, lossless_music: u8, no_reprint: u8, - open_elec: u8, + charging_pay: u8, up_close_reply: bool, up_selection_reply: bool, up_close_danmu: bool, @@ -313,7 +313,7 @@ fn upload( .dolby(dolby) .lossless_music(lossless_music) .no_reprint(no_reprint) - .open_elec(open_elec) + .charging_pay(charging_pay) .up_close_reply(up_close_reply) .up_selection_reply(up_selection_reply) .up_close_danmu(up_close_danmu) diff --git a/crates/stream-gears/src/uploader.rs b/crates/stream-gears/src/uploader.rs index 8fae6bf..30b3c1d 100644 --- a/crates/stream-gears/src/uploader.rs +++ b/crates/stream-gears/src/uploader.rs @@ -58,7 +58,7 @@ pub struct StudioPre { dolby: u8, lossless_music: u8, no_reprint: u8, - open_elec: u8, + charging_pay: u8, #[builder(default = false)] up_close_reply: bool, #[builder(default = false)] @@ -92,7 +92,7 @@ pub async fn upload(studio_pre: StudioPre, submit: Option<&str>, proxy: Option<& dolby, lossless_music, no_reprint, - open_elec, + charging_pay, up_close_reply, up_selection_reply, up_close_danmu, @@ -171,7 +171,7 @@ pub async fn upload(studio_pre: StudioPre, submit: Option<&str>, proxy: Option<& .dolby(dolby) .lossless_music(lossless_music) .no_reprint(no_reprint) - .open_elec(open_elec) + .charging_pay(charging_pay) .up_close_reply(up_close_reply) .up_selection_reply(up_selection_reply) .up_close_danmu(up_close_danmu) diff --git a/crates/stream-gears/stream_gears/stream_gears.pyi b/crates/stream-gears/stream_gears/stream_gears.pyi index 4aabac2..bc7630e 100644 --- a/crates/stream-gears/stream_gears/stream_gears.pyi +++ b/crates/stream-gears/stream_gears/stream_gears.pyi @@ -148,7 +148,7 @@ def upload(video_path: List[str], dolby: int, lossless_music: int, no_reprint: int, - open_elec: int, + charging_pay: int, limit: int, desc_v2: List[Credit], dtime: Optional[int], @@ -173,7 +173,7 @@ def upload(video_path: List[str], :param int dolby: 是否开启杜比音效, 0-关闭 1-开启 :param int lossless_music: 是否开启Hi-Res, 0-关闭 1-开启 :param int no_reprint: 是否禁止转载, 0-允许 1-禁止 - :param int open_elec: 是否开启充电, 0-关闭 1-开启 + :param int charging_pay: 是否开启充电, 0-关闭 1-开启 :param int limit: 单视频文件最大并发数 :param List[Credit] desc_v2: 视频简介v2 :param Optional[dtime] int dtime: 定时发布时间, 距离提交大于2小时小于15天, 格式为10位时间戳 diff --git a/crates/stream-gears/tests/test_upload.py b/crates/stream-gears/tests/test_upload.py index 595cbd5..3e775c0 100644 --- a/crates/stream-gears/tests/test_upload.py +++ b/crates/stream-gears/tests/test_upload.py @@ -37,7 +37,7 @@ if __name__ == '__main__': # dolby=0, # 不开启杜比音效 # lossless_music=0, # 不开启Hi-Res # no_reprint=0, # 允许转载 - # open_elec=0, # 不开启充电 + # charging_pay=0, # 不开启充电 # up_close_reply=False, # 不关闭评论 # up_selection_reply=False, # 不开启精选评论 # up_close_danmu=False, # 不关闭弹幕 diff --git a/public/config.toml b/public/config.toml index 68365f8..a37ccc6 100644 --- a/public/config.toml +++ b/public/config.toml @@ -221,7 +221,7 @@ dynamic = "#空间动态#" #dtime = 14_400 ### 设置延时发布时间,距离提交大于2小时,格式为时间戳 #dolby = 0 ### 是否开启杜比音效, 1为开启 #hires = 0 ### 是否开启Hi-Res, 1为开启 -#open_elec = 0 ### 是否开启充电面板, 1为开启 +#charging_pay = 0 ### 是否开启充电面板, 1为开启 #no_reprint = 0 ### 自制声明, 1为未经允许禁止转载 #is_only_self = 0 ### 可见范围, 1为仅自己可见 #uploader = "biliup-rs" ### 覆盖全局默认上传插件,Noop为不上传,但会执行后处理 diff --git a/public/config.yaml b/public/config.yaml index 6bc5ee4..37f19f1 100644 --- a/public/config.yaml +++ b/public/config.yaml @@ -214,7 +214,7 @@ streamers: #dtime: 14_400 ### 设置延时发布时间,距离提交大于2小时,格式为时间戳 #dolby: 0 ### 是否开启杜比音效, 1为开启 #hires: 0 ### 是否开启Hi-Res, 1为开启 - #open_elec: 0 ### 是否开启充电面板, 1为开启 + #charging_pay: 0 ### 是否开启充电面板, 1为开启 #no_reprint: 0 ### 自制声明, 1为未经允许禁止转载 #is_only_self: 0 ### 可见范围, 1为仅自己可见 uploader: biliup-rs ### 覆盖全局默认上传插件,Noop为不上传,但会执行后处理