Transcode any HEVC file under 10 minutes

This commit is contained in:
Nexus 2024-04-16 00:43:25 +01:00
parent 94b07ac7f3
commit 73d0f204dc
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -60,6 +60,13 @@ class AutoResponder(commands.Cog):
info = await cog._run_ffprobe(uri, True)
if not info:
raise ValueError("No info found for %r" % uri)
if float(info["format"].get("duration", 600.1)) > 600.0:
self.log.warning(
"Video %r is %.2f seconds long (more than 10 minutes). Refusing to process further.",
uri,
float(info["format"].get("duration", 600.1))
)
return
streams = info.get("streams", [])
for stream in streams:
self.log.info("Found stream: %s", stream.get("codec_name"))
@ -145,6 +152,7 @@ class AutoResponder(commands.Cog):
1229496078726860921,
421698654189912064
}:
# links = self.extract_links(message.content, "static-assets-1.truthsocial.com")
links = self.extract_links(message.content, "static-assets-1.truthsocial.com")
if links:
for link in links: