refactor: prefix the manual entry-point scripts with run-
Makes it unambiguous at a glance that these are meant to be run by hand, not something a timer or another script calls. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011qAds5qr7nZRq5R4yAuxUk
This commit is contained in:
Executable
+56
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
# Run reels-sync.sh for every tracked ARTMS profile, one after another.
|
||||
# TOOLING.md ("Reels: the API is blocked, scrape by scrolling instead")
|
||||
# covers what this actually does and why it exists; this is just the loop
|
||||
# version of running reels-sync.sh six times by hand, which is what the
|
||||
# 2026-09-03 run was before this script existed.
|
||||
#
|
||||
# Deliberately not wired into gdl-cron.sh or a timer -- same reasoning as
|
||||
# reels-sync.sh itself: it drives your actual browser session and is slower
|
||||
# by design, both good reasons to run it deliberately, not unattended.
|
||||
#
|
||||
# Usage: ./reels-all.sh
|
||||
# GDL_ARTMS_LINKS=/path/to/list ./reels-all.sh # override the profile list
|
||||
set -eu
|
||||
|
||||
GDL_HOME="${GDL_HOME:-$HOME/gdl}"
|
||||
LINKS="${GDL_ARTMS_LINKS:-$GDL_HOME/artms_account_links.txt}"
|
||||
GDL_PYTHON="${GDL_PYTHON:-$HOME/.local/share/pipx/venvs/gallery-dl/bin/python3}"
|
||||
|
||||
if [ ! -f "$LINKS" ]; then
|
||||
echo "profile list not found: $LINKS" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Same parser gdl-sync.py uses for --urls-file (URLs or bare usernames, #
|
||||
# comments, blank lines, duplicates dropped), reused so this never drifts
|
||||
# from what a routine profiles.sh run actually tracks.
|
||||
mapfile -t PROFILES < <("$GDL_PYTHON" -c "
|
||||
import sys, importlib.util
|
||||
from pathlib import Path
|
||||
spec = importlib.util.spec_from_file_location('gdl_sync', Path('$GDL_HOME/gdl-sync.py'))
|
||||
gdl = importlib.util.module_from_spec(spec)
|
||||
sys.modules['gdl_sync'] = gdl
|
||||
spec.loader.exec_module(gdl)
|
||||
for p in gdl.read_urls_file(Path('$LINKS')):
|
||||
print(p)
|
||||
")
|
||||
|
||||
if [ "${#PROFILES[@]}" -eq 0 ]; then
|
||||
echo "no usable profiles in $LINKS" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "=== reels-all: ${#PROFILES[@]} profile(s) $(date -Is) ==="
|
||||
status=0
|
||||
for p in "${PROFILES[@]}"; do
|
||||
echo "=== starting $p ==="
|
||||
if ! "$(dirname "$0")/reels-sync.sh" "$p"; then
|
||||
status=1
|
||||
echo "=== $p FAILED ===" >&2
|
||||
fi
|
||||
echo "=== finished $p ==="
|
||||
done
|
||||
|
||||
echo "=== reels-all: exit $status at $(date -Is) ==="
|
||||
exit "$status"
|
||||
Reference in New Issue
Block a user