DV+HDR test

This commit is contained in:
chu23465 2025-04-29 15:32:44 +05:30
parent 46fb3e7adf
commit 4eeda5414d
6 changed files with 32 additions and 19 deletions

BIN
binaries/dovi_tool.exe Normal file

Binary file not shown.

View File

@ -4,7 +4,7 @@ python -m pip install poetry==1.8.5
poetry config virtualenvs.in-project true poetry config virtualenvs.in-project true
poetry lock --no-update poetry lock --no-update
poetry install poetry install
sudo add-apt-repository ppa:ubuntuhandbook1/apps sudo add-apt-repository ppa:ubuntuhandbook1/apps -y
sudo apt update sudo apt update
sudo apt-get install ffmpeg aria2 mkvtoolnix libmediainfo0v5 sudo apt-get install ffmpeg aria2 mkvtoolnix libmediainfo0v5
ffmpeg --version ffmpeg --version
@ -15,11 +15,11 @@ mkvmerge --version
rm -r ./binaries/ rm -r ./binaries/
mkdir ./binaries/ mkdir ./binaries/
mv -v ./linux_binaries/* ./binaries/ mv -v ./linux_binaries/* ./binaries/
cp aria2c ./binaries/ which aria2c | xargs -I{} cp {} ./binaries/
cp ffmpeg ./binaries/ which ffmpeg | xargs -I{} cp {} ./binaries/
cp ffprobe ./binaries/ which ffprobe | xargs -I{} cp {} ./binaries/
cp ffplay ./binaries/ which ffplay | xargs -I{} cp {} ./binaries/
cp mkvtoolnix ./binaries/ which mkvmerge | xargs -I{} cp {} ./binaries/
cd ./binaries/ cd ./binaries/
find . -type f -print0 | xargs -0 chmod +x find . -type f -print0 | xargs -0 chmod +x
chmod +x /home/hidden/VT/VT-PR/binaries/* chmod +x *

BIN
linux_binaries/dovi_tool Normal file

Binary file not shown.

View File

@ -284,8 +284,17 @@ class Track:
) + ".mp4" ) + ".mp4"
save_path = os.path.join(out, name) save_path = os.path.join(out, name)
if self.descriptor == self.Descriptor.M3U and self.extra[1]: if self.descriptor == self.Descriptor.M3U:
master = self.extra[1] manifest = requests.get(as_list(self.url)[0], headers=headers, proxies={"all": proxy} if proxy else None).text
if "Denied" in manifest and self.source == "DSNP":
#DSNP sometimes gives errors with proxy. W/O headers also works. Sometimes it gives manifest after retrying. Dunno what triggers error. No geofencing for the segmenets themselves.
manifest = requests.get(as_list(self.url)[0], proxies={"all": proxy} if proxy else None).text
if "Denied" in manifest:
manifest = requests.get(as_list(self.url)[0]).text
master = m3u8.loads(
manifest,
uri=as_list(self.url)[0]
)
# Keys may be [] or [None] if unencrypted # Keys may be [] or [None] if unencrypted
if any(master.keys + master.session_keys): if any(master.keys + master.session_keys):
self.encrypted = True self.encrypted = True
@ -328,7 +337,7 @@ class Track:
("" if re.match("^https?://", segment.uri) else segment.base_uri) + ("" if re.match("^https?://", segment.uri) else segment.base_uri) +
segment.uri segment.uri
) )
self.url = segments self.url = segments if segments != [] else self.url
if ( if (
Path(save_path).is_file() and not Path(save_path).is_file() and not
@ -433,7 +442,7 @@ class Track:
if not os.path.exists(target) or not self._location: if not os.path.exists(target) or not self._location:
return False return False
os.unlink(self._location) os.unlink(self._location)
if "dec.mp4" in target: if "dec" in target or "fixed" in target:
self._location = target self._location = target
else: else:
os.rename(target, self._location) os.rename(target, self._location)
@ -1158,7 +1167,7 @@ class Tracks:
#if bitrate < 99999: #if bitrate < 99999:
# bitrate = bitrate / 1000 # bitrate = bitrate / 1000
self.videos = [x for x in self.videos if int(x.bitrate) <= int(bitrate)] self.videos = [x for x in self.videos if int(x.bitrate) <= int(bitrate)]
else: elif by_vbitrate:
self.videos = [x for x in self.videos if int(x.bitrate) <= int(int(by_vbitrate) * 1001)] self.videos = [x for x in self.videos if int(x.bitrate) <= int(int(by_vbitrate) * 1001)]
if by_codec: if by_codec:
@ -1335,7 +1344,13 @@ class Tracks:
hdr_path = Path(hdr.locate()) hdr_path = Path(hdr.locate())
dv_path = Path(dv.locate()) dv_path = Path(dv.locate())
hybrid_path = hdr_path.with_name(hdr_path.stem + "_hybrid.hevc") hybrid_path = hdr_path.with_name(hdr_path.stem + "_hybrid.hevc")
hybrid_path = Path(self.make_hybrid_dv_hdr(str(dv_path), str(hdr_path), str(hybrid_path))) hybrid_path = Path(
self.make_hybrid_dv_hdr(
dv_file=str(dv_path),
hdr_file=str(hdr_path),
output_file=str(hybrid_path)
)
)
timeout = 10 timeout = 10
waited = 0 waited = 0
while not hybrid_path.exists() or os.path.getsize(hybrid_path) < 10000: while not hybrid_path.exists() or os.path.getsize(hybrid_path) < 10000:
@ -1344,9 +1359,7 @@ class Tracks:
if waited >= timeout: if waited >= timeout:
raise FileNotFoundError(f"Hybrid file never appeared or too small: {hybrid_path}") raise FileNotFoundError(f"Hybrid file never appeared or too small: {hybrid_path}")
hdr.swap(str(hybrid_path)) hdr.swap(str(hybrid_path))
# Hapus DV-only
self.videos = [v for v in self.videos if not (v.dv and not v.hdr10)] self.videos = [v for v in self.videos if not (v.dv and not v.hdr10)]
#self._cleanup_paths = [dv_path, hybrid_path]
try: try:
if hdr_path.exists(): if hdr_path.exists():
hdr_path.unlink() hdr_path.unlink()
@ -1355,12 +1368,12 @@ class Tracks:
except Exception as e: except Exception as e:
logsi.warning(f" - Failed to delete the temp file: {e}") logsi.warning(f" - Failed to delete the temp file: {e}")
end_time = time.time() end_time = time.time()
duration = format_duration(end_time - start_time) duration = hdr.format_duration(end_time - start_time)
logsi.info(gradient_text(f" + Finish processing Hybrid in {duration}!", (173, 255, 47), (0, 191, 255))) logsi.info(f" + Finish processing Hybrid in {duration}!")
return str(hybrid_path) return str(hybrid_path)
def make_hybrid_dv_hdr(dv_file: str, hdr_file: str, output_file: str = None) -> str: def make_hybrid_dv_hdr(self, dv_file: str, hdr_file: str, output_file: str = None) -> str:
dovi_tool = shutil.which("dovi_tool") or "./binaries/dovi_tool" dovi_tool = shutil.which("dovi_tool") or "./binaries/dovi_tool"
if not os.path.isfile(dovi_tool): if not os.path.isfile(dovi_tool):
raise FileNotFoundError("dovi_tool not found.") raise FileNotFoundError("dovi_tool not found.")

View File

@ -24,7 +24,7 @@ cdm_api:
credentials: credentials:
iTunes: 'username:password' iTunes: 'username:password'
Hotstar: 'username:password' Hotstar: 'username:password'
DisneyPlus: 'username:password' DisneyPlus: 'tjp4252@gmail.com:Tjcooke@121382'
directories: directories:
temp: '' temp: ''