Compare commits

..

2 Commits
1.1.5 ... 1.1.6

Author SHA1 Message Date
amtoaer
0bc7b831de chore: bump version from 1.1.5 to 1.1.6 2024-02-02 22:28:21 +08:00
amtoaer
fe2056ae33 fix: 修复无音频流视频下载失败的问题 2024-02-02 22:28:09 +08:00
3 changed files with 18 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
import asyncio
import datetime
import itertools
from asyncio import Semaphore, create_subprocess_exec
from asyncio.subprocess import DEVNULL
@@ -293,33 +294,33 @@ async def process_favorite_item(
process = await create_subprocess_exec(
FFMPEG_COMMAND,
"-i",
str(fav_item.tmp_video_path),
str(fav_item.video_path),
fav_item.tmp_video_path,
fav_item.video_path,
stdout=DEVNULL,
stderr=DEVNULL,
)
await process.communicate()
fav_item.tmp_video_path.unlink()
else:
await asyncio.gather(
download_content(streams[0].url, fav_item.tmp_video_path),
download_content(streams[1].url, fav_item.tmp_audio_path),
)
paths, tasks = [fav_item.tmp_video_path], [
download_content(streams[0].url, fav_item.tmp_video_path)
]
if streams[1]:
paths.append(fav_item.tmp_audio_path)
tasks.append(download_content(streams[1].url, fav_item.tmp_audio_path))
await asyncio.gather(*tasks)
process = await create_subprocess_exec(
FFMPEG_COMMAND,
"-i",
str(fav_item.tmp_video_path),
"-i",
str(fav_item.tmp_audio_path),
*list(itertools.chain(*zip(["-i"] * len(paths), paths))),
"-c",
"copy",
str(fav_item.video_path),
fav_item.video_path,
stdout=DEVNULL,
stderr=DEVNULL,
)
await process.communicate()
fav_item.tmp_video_path.unlink()
fav_item.tmp_audio_path.unlink()
for path in paths:
path.unlink()
fav_item.downloaded = True
except ResponseCodeException as e:
match e.code:

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "bili-sync"
version = "1.1.5"
version = "1.1.6"
description = ""
authors = ["amtoaer <amtoaer@gmail.com>"]
license = "GPL-3.0"
@@ -68,7 +68,7 @@ message = "chore: bump version from {current_version} to {new_version}"
tag = true
tag_name = "{new_version}"
tag_message = ""
current_version = "1.1.5"
current_version = "1.1.6"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
[[tool.bumpversion.files]]
@@ -80,6 +80,7 @@ filename = "pyproject.toml"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

View File

@@ -1 +1 @@
VERSION = "1.1.5"
VERSION = "1.1.6"