Bumping version

This commit is contained in:
ForgQi committed 2024-04-17 23:33:36 +08:00
1 parent 18ef73a312
commit 0d156ff280
11 files changed
+45 -35

No files matched your search

-2
View File
@@ -34,8 +34,6 @@ Twitch,YY直播等,并于录制结束后自动上传到哔哩哔哩视频网
**更新日志**:[CHANGELOG.md](https://biliup.github.io/biliup/docs/guide/changelog)
**文档地址**:[DOCS.md](https://biliup.github.io/biliup/docs/guide/introduction/)
**社区教程**: [图文教程](https://www.bilibili.com/read/cv33195912) by [@ikun1993](https://github.com/ikun1993)
## Quick Start
+2 -4
View File
@@ -2,8 +2,6 @@
// The extra argument will be passed via the `arg` property of the 2nd parameter.
// In the example below, `arg` will be `'my_token'`
export async function sendRequest<T>(url: string, { arg }: {arg: T}) {
console.log(JSON.stringify(arg));
const res = await fetch((process.env.NEXT_PUBLIC_API_SERVER ?? '') + url, {
method: 'POST',
headers: {
@@ -38,7 +36,7 @@ export const proxy = async (input: RequestInfo | URL, init?: RequestInit | undef
}
export async function requestDelete<T>(url: string, { arg }: {arg: T}) {
const res = await fetch(`${(process.env.NEXT_PUBLIC_API_SERVER ?? '')}${url}/${arg}`, {
const res = await fetch(`${process.env.NEXT_PUBLIC_API_SERVER ?? ''}${url}/${arg}`, {
method: 'DELETE',
})
if (!res.ok) {
@@ -48,7 +46,7 @@ export async function requestDelete<T>(url: string, { arg }: {arg: T}) {
}
export async function put<T>(url: string, { arg }: {arg: T}) {
const res = await fetch(`${(process.env.NEXT_PUBLIC_API_SERVER ?? '')}${url}`, {
const res = await fetch(`${process.env.NEXT_PUBLIC_API_SERVER ?? ''}${url}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
+1 -1
View File
@@ -2,7 +2,7 @@ import logging
import platform
import sys
__version__ = "0.4.50"
__version__ = "0.4.51"
LOG_CONF = {
'version': 1,
+20
View File
@@ -1,3 +1,9 @@
import logging
import subprocess
logger = logging.getLogger('biliup')
class NamedLock:
"""
简单实现的命名锁
@@ -52,3 +58,17 @@ def get_file_create_timestamp(file: str) -> float:
pass
return stat_result.st_mtime
def processor(processors, data):
for process in processors:
if process.get('run'):
try:
process_output = subprocess.check_output(
process['run'], shell=True,
input=data,
stderr=subprocess.STDOUT, text=True)
logger.info(process_output.rstrip())
except subprocess.CalledProcessError as e:
logger.exception(e.output)
continue
+1 -1
View File
@@ -1 +1 @@
# from .db import DB # noqa: F401
# from .db import DB # noqa: F401
+4 -2
View File
@@ -5,6 +5,7 @@ import subprocess
import sys
import time
import shutil
from abc import ABC, abstractmethod
from typing import Generator, List
from urllib.parse import urlparse
@@ -21,7 +22,7 @@ from biliup.config import config
logger = logging.getLogger('biliup')
class DownloadBase:
class DownloadBase(ABC):
def __init__(self, fname, url, suffix=None, opt_args=None):
self.danmaku = None
self.room_title = None
@@ -80,6 +81,7 @@ class DownloadBase:
self.default_output_args += \
['-fs', f"{config.get('file_size', '2621440000')}"]
@abstractmethod
def check_stream(self, is_check=False):
# is_check 是否是检测可以避免在检测是否可以录制的时候忽略一些耗时的操作
logger.debug(self.fname, is_check)
@@ -245,7 +247,7 @@ class DownloadBase:
try:
segment_processor = config['streamers'].get(self.fname, {}).get('segment_processor')
if segment_processor:
from biliup.handler import processor
from biliup.common.tools import processor
from multiprocessing import Process
from biliup.database.db import get_file_list
with SessionLocal() as db:
+4 -15
View File
@@ -10,7 +10,7 @@ from typing import List
from biliup.config import config
from .app import event_manager, context
from .common.tools import NamedLock
from .common.tools import NamedLock, processor
from .database.db import get_stream_info_by_filename, SessionLocal
from .downloader import download
from .engine.event import Event
@@ -72,6 +72,7 @@ def pre_processor(name, url):
}, ensure_ascii=False))
yield Event(DOWNLOAD, (name, url))
@event_manager.register(DOWNLOAD, block='Asynchronous1')
def process(name, url):
url_status = context['PluginInfo'].url_status
@@ -96,6 +97,7 @@ def process(name, url):
# 下载结束
url_status[url] = 0
@event_manager.register(DOWNLOADED, block='Asynchronous1')
def processed(stream_info):
name = stream_info['name']
@@ -144,6 +146,7 @@ def process_upload(stream_info):
with NamedLock(f'upload_count_{url}'):
url_upload_count[url] -= 1
def uploaded(name, live_cover_path, data: List):
# data = file_list
post_processor = config['streamers'].get(name, {}).get("postprocessor", None)
@@ -188,17 +191,3 @@ def uploaded(name, live_cover_path, data: List):
except subprocess.CalledProcessError as e:
logger.exception(e.output)
continue
def processor(processors, data):
for processor in processors:
if processor.get('run'):
try:
process_output = subprocess.check_output(
processor['run'], shell=True,
input=data,
stderr=subprocess.STDOUT, text=True)
logger.info(process_output.rstrip())
except subprocess.CalledProcessError as e:
logger.exception(e.output)
continue
-8
View File
@@ -545,7 +545,6 @@ async def service(args):
res.append(web.get('/' + str(fname.with_suffix('')).replace('\\', '/'), _copy(fname)))
# res.append(web.static('/'+fdir.replace('\\', '/'), files('biliup.web').joinpath('public/'+fdir)))
print(res)
res.append(web.static('/', files('biliup.web').joinpath('public')))
app.add_routes(res)
if args.password:
@@ -576,13 +575,6 @@ async def service(args):
return runner
# @web.middleware
# async def get_session(request, handler):
#
# resp = await handler(request)
# return resp
async def handle_404(request):
return web.FileResponse(files('biliup.web').joinpath('public').joinpath('404.html'))
@@ -1,5 +1,5 @@
+++
title = "Introduction"
title = "说明"
description = "AdiDoks is a Zola theme helping you build modern documentation websites, which is a port of the Hugo theme Doks for Zola."
date = 2021-05-01T08:00:00+00:00
updated = 2021-05-01T08:00:00+00:00
+11
View File
@@ -19,6 +19,17 @@ top = false
- 🔧已修复的问题
- ⚠️需要手动操作的更新信息
## 0.4.50
### What's Changed
* 修复排序错误 by @xxxxuanran in https://github.com/biliup/biliup/pull/865
* 修复Youtube在下载完成前的意外错误 by @CoolZxp in https://github.com/biliup/biliup/pull/869
* 适配FlexTv by @CoolZxp in https://github.com/biliup/biliup/pull/870
* 避免虎牙在选取码率时发生错误后依旧继续执行 by @CoolZxp in https://github.com/biliup/biliup/pull/871
* 适配 Twitcasting.TV by @xxxxuanran in https://github.com/biliup/biliup/pull/874
**Full Changelog**: https://github.com/biliup/biliup/compare/v0.4.49...v0.4.50
## 0.4.47-0.4.49
### What's Changed
* 修复录播管理页卡片重叠问题 by @alpzmj9 in https://github.com/biliup/biliup/pull/851
+1 -1
View File
@@ -1,5 +1,5 @@
+++
title = "说明"
title = "Introduction"
description = "AdiDoks is a Zola theme helping you build modern documentation websites, which is a port of the Hugo theme Doks for Zola."
date = 2021-05-01T08:00:00+00:00
updated = 2021-05-01T08:00:00+00:00