mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 00:52:16 -06:00
idx multimedia format/container type
This commit is contained in:
parent
1c69ccc6cd
commit
8ea1f4a751
|
@ -47,8 +47,8 @@ CONDITIONAL_UPLOAD = True
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
fp = sys.argv[1]
|
||||||
if CONDITIONAL_UPLOAD:
|
if CONDITIONAL_UPLOAD:
|
||||||
fp = sys.argv[1]
|
|
||||||
zb = sys.stdin.buffer.read()
|
zb = sys.stdin.buffer.read()
|
||||||
zs = zb.decode("utf-8", "replace")
|
zs = zb.decode("utf-8", "replace")
|
||||||
md = json.loads(zs)
|
md = json.loads(zs)
|
||||||
|
|
|
@ -97,7 +97,7 @@ def main():
|
||||||
zs = (
|
zs = (
|
||||||
"ffmpeg -y -hide_banner -nostdin -v warning"
|
"ffmpeg -y -hide_banner -nostdin -v warning"
|
||||||
+ " -err_detect +crccheck+bitstream+buffer+careful+compliant+aggressive+explode"
|
+ " -err_detect +crccheck+bitstream+buffer+careful+compliant+aggressive+explode"
|
||||||
" -xerror -i"
|
+ " -xerror -i"
|
||||||
)
|
)
|
||||||
|
|
||||||
cmd = zs.encode("ascii").split(b" ") + [fsenc(fp)]
|
cmd = zs.encode("ascii").split(b" ") + [fsenc(fp)]
|
||||||
|
|
|
@ -630,9 +630,9 @@ def run_argparse(argv: list[str], formatter: Any, retry: bool) -> argparse.Names
|
||||||
ap2.add_argument("--mtag-v", action="store_true", help="verbose tag scanning; print errors from mtp subprocesses and such")
|
ap2.add_argument("--mtag-v", action="store_true", help="verbose tag scanning; print errors from mtp subprocesses and such")
|
||||||
ap2.add_argument("-mtm", metavar="M=t,t,t", type=u, action="append", help="add/replace metadata mapping")
|
ap2.add_argument("-mtm", metavar="M=t,t,t", type=u, action="append", help="add/replace metadata mapping")
|
||||||
ap2.add_argument("-mte", metavar="M,M,M", type=u, help="tags to index/display (comma-sep.)",
|
ap2.add_argument("-mte", metavar="M,M,M", type=u, help="tags to index/display (comma-sep.)",
|
||||||
default="circle,album,.tn,artist,title,.bpm,key,.dur,.q,.vq,.aq,vc,ac,res,.fps,ahash,vhash")
|
default="circle,album,.tn,artist,title,.bpm,key,.dur,.q,.vq,.aq,vc,ac,fmt,res,.fps,ahash,vhash")
|
||||||
ap2.add_argument("-mth", metavar="M,M,M", type=u, help="tags to hide by default (comma-sep.)",
|
ap2.add_argument("-mth", metavar="M,M,M", type=u, help="tags to hide by default (comma-sep.)",
|
||||||
default=".vq,.aq,vc,ac,res,.fps")
|
default=".vq,.aq,vc,ac,fmt,res,.fps")
|
||||||
ap2.add_argument("-mtp", metavar="M=[f,]BIN", type=u, action="append", help="read tag M using program BIN to parse the file")
|
ap2.add_argument("-mtp", metavar="M=[f,]BIN", type=u, action="append", help="read tag M using program BIN to parse the file")
|
||||||
|
|
||||||
ap2 = ap.add_argument_group('ui options')
|
ap2 = ap.add_argument_group('ui options')
|
||||||
|
|
|
@ -178,7 +178,7 @@ def parse_ffprobe(txt: str) -> tuple[dict[str, tuple[int, Any]], dict[str, list[
|
||||||
]
|
]
|
||||||
|
|
||||||
if typ == "format":
|
if typ == "format":
|
||||||
kvm = [["duration", ".dur"], ["bit_rate", ".q"]]
|
kvm = [["duration", ".dur"], ["bit_rate", ".q"], ["format_name", "fmt"]]
|
||||||
|
|
||||||
for sk, rk in kvm:
|
for sk, rk in kvm:
|
||||||
v1 = strm.get(sk)
|
v1 = strm.get(sk)
|
||||||
|
@ -239,6 +239,9 @@ def parse_ffprobe(txt: str) -> tuple[dict[str, tuple[int, Any]], dict[str, list[
|
||||||
if ".q" in ret:
|
if ".q" in ret:
|
||||||
del ret[".q"]
|
del ret[".q"]
|
||||||
|
|
||||||
|
if "fmt" in ret:
|
||||||
|
ret["fmt"] = ret["fmt"].split(",")[0]
|
||||||
|
|
||||||
if ".resw" in ret and ".resh" in ret:
|
if ".resw" in ret and ".resh" in ret:
|
||||||
ret["res"] = "{}x{}".format(ret[".resw"], ret[".resh"])
|
ret["res"] = "{}x{}".format(ret[".resw"], ret[".resh"])
|
||||||
|
|
||||||
|
@ -310,6 +313,7 @@ class MTag(object):
|
||||||
"tope",
|
"tope",
|
||||||
],
|
],
|
||||||
"title": ["title", "tit2", "\u00a9nam"],
|
"title": ["title", "tit2", "\u00a9nam"],
|
||||||
|
"comment": ["comment"],
|
||||||
"circle": [
|
"circle": [
|
||||||
"album-artist",
|
"album-artist",
|
||||||
"tpe2",
|
"tpe2",
|
||||||
|
|
|
@ -11,6 +11,7 @@ var Ls = {
|
||||||
"q": "quality / bitrate",
|
"q": "quality / bitrate",
|
||||||
"Ac": "audio codec",
|
"Ac": "audio codec",
|
||||||
"Vc": "video codec",
|
"Vc": "video codec",
|
||||||
|
"Fmt": "format / container",
|
||||||
"Ahash": "audio checksum",
|
"Ahash": "audio checksum",
|
||||||
"Vhash": "video checksum",
|
"Vhash": "video checksum",
|
||||||
"Res": "resolution",
|
"Res": "resolution",
|
||||||
|
@ -348,6 +349,7 @@ var Ls = {
|
||||||
"q": "kvalitet / bitrate",
|
"q": "kvalitet / bitrate",
|
||||||
"Ac": "lyd-format",
|
"Ac": "lyd-format",
|
||||||
"Vc": "video-format",
|
"Vc": "video-format",
|
||||||
|
"Fmt": "format / innpakning",
|
||||||
"Ahash": "lyd-kontrollsum",
|
"Ahash": "lyd-kontrollsum",
|
||||||
"Vhash": "video-kontrollsum",
|
"Vhash": "video-kontrollsum",
|
||||||
"Res": "oppløsning",
|
"Res": "oppløsning",
|
||||||
|
|
Loading…
Reference in a new issue