Last active
April 15, 2026 03:39
-
-
Save avrahamappel/5e3ec43d8a71e2aefecad91005c447f9 to your computer and use it in GitHub Desktop.
Download a full masechta from realcleardaf.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env nix-shell | |
| #!nix-shell -p curl fd pdftk | |
| MASECHTA=${MASECHTA:-berachos} | |
| DAFIM=${DAFIM:-200} | |
| mkdir -p "$MASECHTA" | |
| for daf in $(seq 2 "$DAFIM"); do | |
| for amud in {a..b}; do | |
| echo "Downloading $MASECHTA daf $daf$amud" | |
| curl --silent --fail --output-dir "$MASECHTA" -O "https://www.realcleardaf.com/wp-content/uploads/daf/$MASECHTA-$daf$amud.pdf" | |
| if [[ $? != 0 ]]; then | |
| echo "Downloaded all pages" | |
| break 2 | |
| fi | |
| done | |
| done | |
| echo "Assembling final PDF" | |
| pdftk $(fd . ./megillah | sort --version-sort | paste -sd' ') cat output megillah.pdf && rm -rf "./$MASECHTA" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment