Skip to content

Commit 4cb44ad

Browse files
committed
- minor cli fixes
- fixing x32 CLI build
1 parent d3b1ee7 commit 4cb44ad

File tree

3 files changed

+56
-44
lines changed

3 files changed

+56
-44
lines changed

.github/workflows/build_cli_linux.yml

Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -50,56 +50,69 @@ jobs:
5050

5151
build-pornfetch-cli-linux-32:
5252
runs-on: ubuntu-latest
53+
env:
54+
PY311_VERSION: "3.11.5"
55+
PY32_PREFIX: "/opt/python-32"
56+
LD_LIBRARY_PATH: "/opt/python-32/lib:/usr/lib/i386-linux-gnu"
57+
CC: "gcc -m32"
58+
CXX: "g++ -m32"
59+
CFLAGS: "-m32"
60+
LDFLAGS: "-m32"
5361
steps:
54-
- uses: actions/checkout@v3
62+
- uses: actions/checkout@v4
5563

56-
- name: Install dependencies for building Python
64+
- name: Enable i386 & install minimal 32-bit toolchain
5765
run: |
58-
sudo apt-get update
5966
sudo dpkg --add-architecture i386
6067
sudo apt-get update
61-
sudo apt-get install -y build-essential gcc-multilib libffi-dev zlib1g-dev libbz2-dev libsqlite3-dev binutils-dev libsqlite3-dev libgdbm-dev libc6-dev libbz2-dev
62-
sudo apt-get install -y libfl-dev zlib1g:i386 zlib1g-dev:i386 openssl libssl-dev libbz2-dev:i386 libgdbm-compat-dev:i386 libgdbm-dev:i386 libssl-dev:i386 libsqlite3-dev:i386 tk-dev:i386 libx11-dev:i386 libreadline-dev:i386 libffi-dev:i386 libncurses5-dev:i386 libncursesw5-dev:i386 liblzma-dev:i386 uuid-dev:i386
63-
64-
- name: Download and build Python 3.11 for x32
68+
sudo apt-get install -y \
69+
build-essential gcc-multilib make pkg-config wget xz-utils ca-certificates \
70+
libffi-dev:i386 zlib1g-dev:i386 libbz2-dev:i386 libsqlite3-dev:i386 \
71+
libgdbm-dev:i386 libgdbm-compat-dev:i386 libncurses5-dev:i386 libncursesw5-dev:i386 \
72+
libreadline-dev:i386 libssl-dev:i386 liblzma-dev:i386 uuid-dev:i386 \
73+
libcrypt-dev:i386
74+
75+
- name: Build Python ${{ env.PY311_VERSION }} (32-bit)
6576
run: |
66-
wget https://www.python.org/ftp/python/3.11.5/Python-3.11.5.tgz
67-
tar -xzf Python-3.11.5.tgz
68-
cd Python-3.11.5
69-
CFLAGS="-m32" LDFLAGS="-m32" ./configure --prefix=/usr/local/python-32 --with-ensurepip=install --enable-shared
70-
make -j $(nproc)
77+
wget https://www.python.org/ftp/python/${PY311_VERSION}/Python-${PY311_VERSION}.tgz
78+
tar -xzf Python-${PY311_VERSION}.tgz
79+
cd Python-${PY311_VERSION}
80+
./configure --prefix="${PY32_PREFIX}" --with-ensurepip=install --enable-shared
81+
make -j"$(nproc)"
7182
sudo make altinstall
72-
env:
73-
LD_LIBRARY_PATH: /usr/local/lib
83+
echo "${PY32_PREFIX}/bin" >> "$GITHUB_PATH"
7484
75-
- name: Install Python packages
85+
- name: Create 32-bit venv & install deps (no av)
86+
shell: bash
7687
run: |
77-
export LD_LIBRARY_PATH=/usr/local/python-32/lib:$LD_LIBRARY_PATH
78-
/usr/local/python-32/bin/python3.11 -m venv venv
88+
python3.11 -m venv venv
7989
source venv/bin/activate
80-
pip install --upgrade pip
81-
pip install pyinstaller
90+
python -m pip install --upgrade pip wheel setuptools
91+
# Build PyInstaller from source so its bootloader is compiled for i686
92+
pip install --no-binary=:all: pyinstaller
8293
pip install -r requirements_cli.txt
8394
84-
- name: Build Porn Fetch (CLI) (PyInstaller - Termux)
95+
- name: Build Porn Fetch (CLI) (PyInstaller - x32)
96+
shell: bash
8597
run: |
86-
export LD_LIBRARY_PATH=/usr/local/python-32/lib:$LD_LIBRARY_PATH
8798
source venv/bin/activate
88-
pyinstaller -F Porn_Fetch_CLI.py && cd dist && mv Porn_Fetch_CLI PornFetch_Linux_CLI_x32 && chmod +x PornFetch_Linux_CLI_x32
89-
90-
- name: Generate SHA256 Checksum
91-
run: |
92-
sha256sum dist/PornFetch_Linux_CLI_x32 > dist/PornFetch_Linux_CLI_x32.sha256
93-
94-
- name: Publish SHA256 to GitHub Actions Summary
95-
run: |
96-
echo "### SHA256 Checksum for PornFetch_Linux_CLI_x32" >> $GITHUB_STEP_SUMMARY
97-
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
98-
cat dist/PornFetch_Linux_CLI_x32.sha256 >> $GITHUB_STEP_SUMMARY
99-
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
100-
101-
- name: Archive Porn Fetch CLI (Linux_32) build
102-
uses: actions/upload-artifact@v4
103-
with:
104-
name: PornFetch_Linux_CLI_x32
105-
path: dist/PornFetch_Linux_CLI_x32
99+
pyinstaller -F Porn_Fetch_CLI.py
100+
cd dist && mv Porn_Fetch_CLI PornFetch_Linux_CLI_x32 && chmod +x PornFetch_Linux_CLI_x32
101+
102+
- name: Generate SHA256 Checksum
103+
run: sha256sum dist/PornFetch_Linux_CLI_x32 > dist/PornFetch_Linux_CLI_x32.sha256
104+
105+
- name: Publish SHA256 to GitHub Actions Summary
106+
run: |
107+
{
108+
echo "### SHA256 Checksum for PornFetch_Linux_CLI_x32";
109+
echo '```';
110+
cat dist/PornFetch_Linux_CLI_x32.sha256;
111+
echo '```';
112+
} >> "$GITHUB_STEP_SUMMARY"
113+
114+
- name: Archive Porn Fetch CLI (Linux_32) build
115+
uses: actions/upload-artifact@v4
116+
with:
117+
name: PornFetch_Linux_CLI_x32
118+
path: dist/PornFetch_Linux_CLI_x32

requirements_cli.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ requests
1111
hue_shift
1212
markdown
1313
rich
14-
mutagen
14+
mutagen
15+
spankbang_api

src/backend/CLI_model_feature_addon.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ def show_help():
152152
"""
153153
help_text = """
154154
Automatic Model Downloader:
155-
156-
This feature tracks videos per model without immediate download.
155+
This feature tracks videos per model with download capabilities.
157156
158157
Options:
159158
1) Show this help text.
@@ -168,8 +167,7 @@ def show_help():
168167
State file (`download_state.json`) stores for each model:
169168
- downloaded: list of URLs already downloaded
170169
- pending: list of URLs to download next
171-
172-
After gathering pending URLs, you can separately process `state["models"][model_url]["pending"]` with your existing download code.
170+
173171
"""
174172
print(help_text)
175173

0 commit comments

Comments
 (0)