Skip to content

Commit 2efed41

Browse files
committed
- windows ARM support (2nd try)
1 parent b13d58c commit 2efed41

File tree

6 files changed

+25
-12
lines changed

6 files changed

+25
-12
lines changed

.github/workflows/build_cli_linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
pip install pyinstaller
27+
pip install pyinstaller av
2828
if [ -f requirements_cli.txt ]; then pip install -r requirements_cli.txt; fi
2929
3030
- name: Build Porn Fetch (CLI) (PyInstaller - Termux)
@@ -78,7 +78,7 @@ jobs:
7878
/usr/local/python-32/bin/python3.11 -m venv venv
7979
source venv/bin/activate
8080
pip install --upgrade pip
81-
pip install pyinstaller
81+
pip install pyinstaller av
8282
pip install -r requirements_cli.txt
8383
8484
- name: Build Porn Fetch (CLI) (PyInstaller - Termux)

.github/workflows/build_cli_windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
pip install pyinstaller
31-
pip install -r requirements_cli.txt
31+
pip install -r requirements_cli.txt av
3232
3333
- name: Build Porn Fetch (CLI - Windows - X64) (PyInstaller)
3434
run: |
@@ -68,7 +68,7 @@ jobs:
6868
- name: Install dependencies
6969
run: |
7070
python -m pip install --upgrade pip
71-
pip install pyinstaller
71+
pip install pyinstaller av
7272
pip install -r requirements_cli.txt
7373
7474
- name: Build Porn Fetch (CLI - Windows - X32) (PyInstaller)

.github/workflows/build_gui_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
virtualenv venv
3232
source venv/bin/activate
3333
pip install -r requirements.txt
34-
pip install PySide6 nuitka zstandard
34+
pip install PySide6 nuitka zstandard av
3535
3636
- name: Build application for x64
3737
run: |

.github/workflows/build_gui_windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
virtualenv venv
3232
.\venv\Scripts\activate
3333
pip install -r requirements.txt
34-
pip install PySide6 nuitka zstandard pywin32
34+
pip install PySide6 nuitka zstandard pywin32 av
3535
.\src\frontend\update.ps1
3636
3737
- name: Build application for Windows x64

main.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
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+
19
import sys
210
from pathlib import Path
311
from PySide6.QtWidgets import QApplication, QWidget, QTextBrowser, QVBoxLayout, QPushButton
@@ -131,8 +139,6 @@ def __init__(self):
131139
import requests # Imported, although not used, because this triggers the certifi cacert.pem include workflow
132140
import src.backend.shared_functions as shared_functions
133141
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
136142
from threading import Event, Lock
137143
from io import TextIOWrapper
138144
from itertools import islice, chain
@@ -767,6 +773,13 @@ def run(self):
767773
time.sleep(int(self.consistent_data.get("processing_delay")))
768774
self.logger.debug(f"Downloading Video to: {self.output_path}")
769775
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+
770783

771784
# We need to specify the sources, so that it knows which individual progressbar to use
772785
if isinstance(self.video, shared_functions.hq_Video) or isinstance(self.video, shared_functions.ep_Video):
@@ -782,12 +795,12 @@ def run(self):
782795
elif isinstance(self.video, shared_functions.ph_Video): # Assuming 'Video' is the class for Pornhub
783796
video_source = "general"
784797
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,
786799
display=lambda pos, total: self.generic_callback(pos, total))
787800

788801
else:
789802
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))
791804

792805
except Exception:
793806
error = traceback.format_exc()
@@ -797,7 +810,8 @@ def run(self):
797810
finally:
798811
if self.consistent_data.get("write_metadata"):
799812
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))
801815

802816
except Exception:
803817
error = traceback.format_exc()

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ requests
1313
httpx
1414
hue_shift
1515
Markdown
16-
av
1716
mutagen

0 commit comments

Comments
 (0)