Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# f"{date}-{artist}直播回放" - 20250328-Streamer直播回放
DESC = "{artist}直播回放,直播间地址:{source_link} 内容仅供娱乐,直播中主播的言论、观点和行为均由主播本人负责,不代表录播员的观点或立场。"
# You can change the description as you like.
GIFT_PRICE_FILTER = 1 # The gift whose price is less than this value will be filtered, unit: RMB
# ============================ The video slice configuration ==================
AUTO_SLICE = False
SLICE_DURATION = 60 # better not exceed 300 seconds
Expand Down
4 changes: 3 additions & 1 deletion src/danmaku/adjust_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
import xml.etree.ElementTree as ET
from src.config import GIFT_PRICE_FILTER

def update_danmaku_prices(file_path):
"""Adjust the price of sc and guard, see this:
Expand Down Expand Up @@ -41,7 +42,8 @@ def update_danmaku_prices(file_path):
# Remove 'gift' elements with price less than 1000
for gift in root.findall('gift'):
price_gift = gift.get('price')
if int(price_gift) < 1000:
converted_price = int(GIFT_PRICE_FILTER * 1000)
if int(price_gift) < converted_price:
root.remove(gift)

# Write the updated XML back to the file
Expand Down