1
+ try :
2
+ from av import open as av_open # Don't ask
3
+ from av .audio .resampler import AudioResampler # Don't ask
4
+ FORCE_DISABLE_AV = False
5
+
6
+ except Exception :
7
+ FORCE_DISABLE_AV = True
8
+
1
9
import sys
2
10
from pathlib import Path
3
11
from PySide6 .QtWidgets import QApplication , QWidget , QTextBrowser , QVBoxLayout , QPushButton
@@ -131,8 +139,6 @@ def __init__(self):
131
139
import requests # Imported, although not used, because this triggers the certifi cacert.pem include workflow
132
140
import src .backend .shared_functions as shared_functions
133
141
import src .frontend .UI .resources # Your IDE may tell you that this is an unused import statement, but that is WRONG!
134
- from av import open as av_open # Don't ask
135
- from av .audio .resampler import AudioResampler # Don't ask
136
142
from threading import Event , Lock
137
143
from io import TextIOWrapper
138
144
from itertools import islice , chain
@@ -767,6 +773,13 @@ def run(self):
767
773
time .sleep (int (self .consistent_data .get ("processing_delay" )))
768
774
self .logger .debug (f"Downloading Video to: { self .output_path } " )
769
775
self .signals .total_progress_range .emit (total_segments )
776
+ global FORCE_DISABLE_AV
777
+ if not FORCE_DISABLE_AV :
778
+ remux = True
779
+
780
+ else :
781
+ remux = False
782
+
770
783
771
784
# We need to specify the sources, so that it knows which individual progressbar to use
772
785
if isinstance (self .video , shared_functions .hq_Video ) or isinstance (self .video , shared_functions .ep_Video ):
@@ -782,12 +795,12 @@ def run(self):
782
795
elif isinstance (self .video , shared_functions .ph_Video ): # Assuming 'Video' is the class for Pornhub
783
796
video_source = "general"
784
797
self .logger .debug ("Starting the Download!" )
785
- self .video .download (downloader = str (self .threading_mode ), path = self .output_path , quality = self .quality , remux = True , display_remux = self .callback_remux ,
798
+ self .video .download (downloader = str (self .threading_mode ), path = self .output_path , quality = self .quality , remux = remux , display_remux = self .callback_remux ,
786
799
display = lambda pos , total : self .generic_callback (pos , total ))
787
800
788
801
else :
789
802
self .video .download (downloader = str (self .threading_mode ), path = self .output_path , callback_remux = self .callback_remux , no_title = True ,
790
- quality = self .quality , remux = True , callback = lambda pos , total : self .generic_callback (pos , total ))
803
+ quality = self .quality , remux = remux , callback = lambda pos , total : self .generic_callback (pos , total ))
791
804
792
805
except Exception :
793
806
error = traceback .format_exc ()
@@ -797,7 +810,8 @@ def run(self):
797
810
finally :
798
811
if self .consistent_data .get ("write_metadata" ):
799
812
try :
800
- shared_functions .write_tags (path = self .output_path , data = video_data .data_objects .get (self .video_id ))
813
+ if not FORCE_DISABLE_AV :
814
+ shared_functions .write_tags (path = self .output_path , data = video_data .data_objects .get (self .video_id ))
801
815
802
816
except Exception :
803
817
error = traceback .format_exc ()
0 commit comments