#!/bin/zsh set -euo pipefail # Download newest TVVLCKit 3.x xcframework from VideoLAN cocoapods prod (or artifacts). cd /tmp echo "Listing TVVLCKit packages (cocoapods prod)..." curl -fsSL https://download.videolan.org/pub/cocoapods/prod/ -o /tmp/tvvlc-prod.html || \ curl -fsSL https://download.videolan.org/pub/pub/cocoapods/prod/ -o /tmp/tvvlc-prod.html python3 - <<'PY' from pathlib import Path import re html = Path('/tmp/tvvlc-prod.html').read_text(errors='ignore') names = sorted(set(re.findall(r'href="(TVVLCKit-3\.[^"]+)"', html))) for n in names[-20:]: print(n) pick = None for n in reversed(names): if n.startswith('TVVLCKit-3.6') or n.startswith('TVVLCKit-3.5') or n.startswith('TVVLCKit-3.7'): pick = n break if not pick and names: pick = names[-1] print('PICK=' + (pick or '')) Path('/tmp/tvvlc-pick.txt').write_text(pick or '') PY PICK=$(cat /tmp/tvvlc-pick.txt) BASE="https://download.videolan.org/pub/cocoapods/prod" if [ -z "$PICK" ]; then echo "Falling back to artifacts.videolan.org TVVLCKit 3.7.3..." PICK="TVVLCKit-3.7.3-319ed2c0-79128878.tar.xz" BASE="https://artifacts.videolan.org/VLCKit/TVVLCKit" fi echo "Downloading $PICK ..." curl -fL --progress-bar "$BASE/$PICK" -o "/tmp/$PICK" mkdir -p /tmp/tvvlcunpack rm -rf /tmp/tvvlcunpack/* case "$PICK" in *.zip) unzip -q "/tmp/$PICK" -d /tmp/tvvlcunpack ;; *.tar.xz|*.txz) tar -xJf "/tmp/$PICK" -C /tmp/tvvlcunpack ;; *.tar.bz2) tar -xjf "/tmp/$PICK" -C /tmp/tvvlcunpack ;; *) tar -xf "/tmp/$PICK" -C /tmp/tvvlcunpack ;; esac echo "Unpacked:" find /tmp/tvvlcunpack -name '*.xcframework' -o -name '*.framework' | head -20