diff --git a/binaries/dovi_tool.exe b/binaries/dovi_tool.exe new file mode 100644 index 0000000..69da627 Binary files /dev/null and b/binaries/dovi_tool.exe differ diff --git a/install.sh b/install.sh index 496c8cb..8e3418a 100644 --- a/install.sh +++ b/install.sh @@ -4,7 +4,7 @@ python -m pip install poetry==1.8.5 poetry config virtualenvs.in-project true poetry lock --no-update poetry install -sudo add-apt-repository ppa:ubuntuhandbook1/apps +sudo add-apt-repository ppa:ubuntuhandbook1/apps -y sudo apt update sudo apt-get install ffmpeg aria2 mkvtoolnix libmediainfo0v5 ffmpeg --version @@ -15,11 +15,11 @@ mkvmerge --version rm -r ./binaries/ mkdir ./binaries/ mv -v ./linux_binaries/* ./binaries/ -cp aria2c ./binaries/ -cp ffmpeg ./binaries/ -cp ffprobe ./binaries/ -cp ffplay ./binaries/ -cp mkvtoolnix ./binaries/ +which aria2c | xargs -I{} cp {} ./binaries/ +which ffmpeg | xargs -I{} cp {} ./binaries/ +which ffprobe | xargs -I{} cp {} ./binaries/ +which ffplay | xargs -I{} cp {} ./binaries/ +which mkvmerge | xargs -I{} cp {} ./binaries/ cd ./binaries/ find . -type f -print0 | xargs -0 chmod +x -chmod +x /home/hidden/VT/VT-PR/binaries/* \ No newline at end of file +chmod +x * \ No newline at end of file diff --git a/linux_binaries/dovi_tool b/linux_binaries/dovi_tool new file mode 100644 index 0000000..752d495 Binary files /dev/null and b/linux_binaries/dovi_tool differ diff --git a/vinetrimmer/devices/mtc_mtc_atv_atv_sl3000.prd b/vinetrimmer/devices/mtc_mtc_atv_atv_sl3000.prd index 4b01685..eacb291 100644 Binary files a/vinetrimmer/devices/mtc_mtc_atv_atv_sl3000.prd and b/vinetrimmer/devices/mtc_mtc_atv_atv_sl3000.prd differ diff --git a/vinetrimmer/objects/tracks.py b/vinetrimmer/objects/tracks.py index 976f9a3..490196c 100644 --- a/vinetrimmer/objects/tracks.py +++ b/vinetrimmer/objects/tracks.py @@ -284,8 +284,17 @@ class Track: ) + ".mp4" save_path = os.path.join(out, name) - if self.descriptor == self.Descriptor.M3U and self.extra[1]: - master = self.extra[1] + if self.descriptor == self.Descriptor.M3U: + 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 if any(master.keys + master.session_keys): self.encrypted = True @@ -328,7 +337,7 @@ class Track: ("" if re.match("^https?://", segment.uri) else segment.base_uri) + segment.uri ) - self.url = segments + self.url = segments if segments != [] else self.url if ( Path(save_path).is_file() and not @@ -433,7 +442,7 @@ class Track: if not os.path.exists(target) or not self._location: return False os.unlink(self._location) - if "dec.mp4" in target: + if "dec" in target or "fixed" in target: self._location = target else: os.rename(target, self._location) @@ -1158,7 +1167,7 @@ class Tracks: #if bitrate < 99999: # bitrate = bitrate / 1000 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)] if by_codec: @@ -1335,7 +1344,13 @@ class Tracks: hdr_path = Path(hdr.locate()) dv_path = Path(dv.locate()) 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 waited = 0 while not hybrid_path.exists() or os.path.getsize(hybrid_path) < 10000: @@ -1344,9 +1359,7 @@ class Tracks: if waited >= timeout: raise FileNotFoundError(f"Hybrid file never appeared or too small: {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._cleanup_paths = [dv_path, hybrid_path] try: if hdr_path.exists(): hdr_path.unlink() @@ -1355,12 +1368,12 @@ class Tracks: except Exception as e: logsi.warning(f" - Failed to delete the temp file: {e}") end_time = time.time() - duration = format_duration(end_time - start_time) - logsi.info(gradient_text(f" + Finish processing Hybrid in {duration}!", (173, 255, 47), (0, 191, 255))) + duration = hdr.format_duration(end_time - start_time) + logsi.info(f" + Finish processing Hybrid in {duration}!") 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" if not os.path.isfile(dovi_tool): raise FileNotFoundError("dovi_tool not found.") diff --git a/vinetrimmer/vinetrimmer.yml b/vinetrimmer/vinetrimmer.yml index 16a18d6..4a1993c 100644 --- a/vinetrimmer/vinetrimmer.yml +++ b/vinetrimmer/vinetrimmer.yml @@ -24,7 +24,7 @@ cdm_api: credentials: iTunes: 'username:password' Hotstar: 'username:password' - DisneyPlus: 'username:password' + DisneyPlus: 'tjp4252@gmail.com:Tjcooke@121382' directories: temp: ''