Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/bin/bash
  2. info=$(python python_list_remote_zip.py "$1" | grep -m 1 -A 5 "^$2\$" | tail -n +2)
  3. tmpfile=$(mktemp)
  4. wget -q --start-pos $(echo "$info" | grep offset | grep -o '[[:digit:]]*') -O - "$1" | head -c $(echo "$info" | grep -m 1 length | grep -o '[[:digit:]]*') >"$tmpfile"
  5. #printf '\x1f\x8b' # gzip magic
  6. #tail -c +9 <"$tmpfile" | head -c 1 # copy compression method
  7. #printf '\0\0\0\0\0\0\x03' # some flags and mtime
  8. tail -c "+$(expr 1 + $(echo "$info" | grep header | grep -o '[[:digit:]]*'))" <"$tmpfile"
  9. #tail -c +15 <"$tmpfile" | head -c 4 # The CRCs seem to be compatible.
  10. #tail -c +23 <"$tmpfile" | head -c 4
  11. rm "$tmpfile"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement