mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-05-09 06:02:40 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bc7b831de | ||
|
|
fe2056ae33 |
27
processor.py
27
processor.py
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1 +1 @@
|
||||
VERSION = "1.1.5"
|
||||
VERSION = "1.1.6"
|
||||
|
||||
Reference in New Issue
Block a user