vivy: tv: friendship ended with funi & subsplease
Erai-Raws has good funi audio still if amazon isn't out in time
This commit is contained in:
parent
f94427318c
commit
69c3ddaa61
4
.gitignore
vendored
4
.gitignore
vendored
@ -6,8 +6,12 @@
|
|||||||
*.png
|
*.png
|
||||||
*.aac
|
*.aac
|
||||||
*.m4a
|
*.m4a
|
||||||
|
*.h264
|
||||||
*.h265
|
*.h265
|
||||||
*.eac3
|
*.eac3
|
||||||
|
*.ass
|
||||||
|
*.mka
|
||||||
|
*.xml
|
||||||
cudnn_data/
|
cudnn_data/
|
||||||
*.webm
|
*.webm
|
||||||
ffmpeg2pass*.log
|
ffmpeg2pass*.log
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import vapoursynth as vs
|
|
||||||
|
|
||||||
import acsuite
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from subprocess import DEVNULL, call
|
|
||||||
|
|
||||||
from vivy_common.util import FUNI_FILENAME, FUNI_INTRO, glob_crc
|
|
||||||
|
|
||||||
EPNUM: int = int(sys.argv[1])
|
|
||||||
|
|
||||||
ac = acsuite.AC()
|
|
||||||
core = vs.core
|
|
||||||
|
|
||||||
funi: str = glob_crc(os.path.join(f"{EPNUM:02d}", FUNI_FILENAME.format(epnum=EPNUM)))
|
|
||||||
src = core.ffms2.Source(funi)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
funi_audio: str = f"{EPNUM:02d}/funi.aac"
|
|
||||||
if not os.path.isfile(funi_audio):
|
|
||||||
call(["ffmpeg",
|
|
||||||
"-i", funi,
|
|
||||||
"-vn",
|
|
||||||
"-sn",
|
|
||||||
"-map_metadata", "-1",
|
|
||||||
"-c:a", "copy",
|
|
||||||
funi_audio],
|
|
||||||
stdout=DEVNULL, stderr=DEVNULL
|
|
||||||
)
|
|
||||||
ac.eztrim(src, (FUNI_INTRO, 0), funi_audio, f"{EPNUM:02d}/{EPNUM:02d}_cut.mka")
|
|
@ -24,7 +24,7 @@ ignore_errors = False
|
|||||||
|
|
||||||
allow_untyped_globals = False
|
allow_untyped_globals = False
|
||||||
allow_redefinition = False
|
allow_redefinition = False
|
||||||
implicit_reexport = False
|
implicit_reexport = True
|
||||||
strict_equality = True
|
strict_equality = True
|
||||||
|
|
||||||
show_error_context = False
|
show_error_context = False
|
||||||
@ -34,6 +34,8 @@ color_output = True
|
|||||||
error_summary = True
|
error_summary = True
|
||||||
pretty = True
|
pretty = True
|
||||||
|
|
||||||
|
mypy_path = .
|
||||||
|
|
||||||
[mypy-cytoolz.*]
|
[mypy-cytoolz.*]
|
||||||
ignore_errors = True
|
ignore_errors = True
|
||||||
|
|
||||||
|
@ -184,13 +184,16 @@ class AudioGetter():
|
|||||||
print(f"{SUCCESS}Found Amazon audio{RESET}")
|
print(f"{SUCCESS}Found Amazon audio{RESET}")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# as of Ep4 SubsPlease is using new funi 128kbps aac while erai has 256kbps still
|
||||||
try:
|
try:
|
||||||
|
if os.path.isfile(ER_FILENAME.format(epnum=epnum)):
|
||||||
|
self.audio_file = ER_FILENAME.format(epnum=epnum)
|
||||||
|
self.video_src = core.ffms2.Source(ER_FILENAME.format(epnum=epnum))
|
||||||
if os.path.isfile(glob_crc(SUBSPLS_FILENAME.format(epnum=epnum))):
|
if os.path.isfile(glob_crc(SUBSPLS_FILENAME.format(epnum=epnum))):
|
||||||
self.audio_file = glob_crc(SUBSPLS_FILENAME.format(epnum=epnum))
|
self.audio_file = glob_crc(SUBSPLS_FILENAME.format(epnum=epnum))
|
||||||
self.video_src = core.ffms2.Source(glob_crc(SUBSPLS_FILENAME.format(epnum=epnum)))
|
self.video_src = core.ffms2.Source(glob_crc(SUBSPLS_FILENAME.format(epnum=epnum)))
|
||||||
elif os.path.isfile(ER_FILENAME.format(epnum=epnum)):
|
if (epnum >= 4):
|
||||||
self.audio_file = ER_FILENAME.format(epnum=epnum)
|
print(f"{WARNING}Using SubsPlease, audio may be worse than Erai-Raws{RESET}")
|
||||||
self.video_src = core.ffms2.Source(ER_FILENAME.format(epnum=epnum))
|
|
||||||
else:
|
else:
|
||||||
raise FileNotFoundError()
|
raise FileNotFoundError()
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
@ -305,7 +308,8 @@ class SelfRunner():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
print(f"{STATUS}--- MUXING FILE ---{RESET}")
|
print(f"{STATUS}--- MUXING FILE ---{RESET}")
|
||||||
if self._mux(f"{TITLE.lower()}_{epnum:02d}_{args.suffix}.mkv", not args.no_metadata) != 0:
|
if self._mux(f"{TITLE.lower()}_{epnum:02d}_{args.suffix}.mkv", not args.no_metadata,
|
||||||
|
not args.no_metadata and start == 0 and end == self.clip.num_frames) != 0:
|
||||||
raise Exception("mkvmerge failed")
|
raise Exception("mkvmerge failed")
|
||||||
except Exception:
|
except Exception:
|
||||||
print(f"{ERROR}--- MUXING FAILED ---{RESET}")
|
print(f"{ERROR}--- MUXING FAILED ---{RESET}")
|
||||||
@ -321,7 +325,7 @@ class SelfRunner():
|
|||||||
|
|
||||||
print(f"{SUCCESS}--- ENCODE COMPLETE ---{RESET}")
|
print(f"{SUCCESS}--- ENCODE COMPLETE ---{RESET}")
|
||||||
|
|
||||||
def _mux(self, name: str, metadata: bool = True) -> int:
|
def _mux(self, name: str, metadata: bool = True, chapters: bool = True) -> int:
|
||||||
mkvtoolnix_args = [
|
mkvtoolnix_args = [
|
||||||
"mkvmerge",
|
"mkvmerge",
|
||||||
"--output", name,
|
"--output", name,
|
||||||
@ -337,10 +341,12 @@ class SelfRunner():
|
|||||||
mkvtoolnix_args += [
|
mkvtoolnix_args += [
|
||||||
"--title", f"[{SUBGROUP}] {TITLE_LONG} - {self.epnum:02d}",
|
"--title", f"[{SUBGROUP}] {TITLE_LONG} - {self.epnum:02d}",
|
||||||
]
|
]
|
||||||
chapters = [f for f in ["{self.epnum:02d}.xml", "chapters.xml"] if os.path.isfile(f)]
|
|
||||||
if len(chapters) != 0:
|
if chapters:
|
||||||
|
chap = [f for f in ["{self.epnum:02d}.xml", "chapters.xml"] if os.path.isfile(f)]
|
||||||
|
if len(chap) != 0:
|
||||||
mkvtoolnix_args += [
|
mkvtoolnix_args += [
|
||||||
"--chapters", chapters[0],
|
"--chapters", chap[0],
|
||||||
]
|
]
|
||||||
|
|
||||||
print("+ " + " ".join(mkvtoolnix_args))
|
print("+ " + " ".join(mkvtoolnix_args))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user