Browse Source

Silence BrokenPipeError

master
JustAnotherArchivist 1 year ago
parent
commit
98ebc667f2
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      html-extract-stupid

+ 1
- 1
html-extract-stupid View File

@@ -32,7 +32,7 @@
perl -pe "s,^([a-zA-Z]+) (['\"])(.*)\2$,\1 \3," |

# img srcset splitting
python3 -c 'import re, sys'$'\n''for l in map(str.strip, sys.stdin):'$'\n'' tag, value = l.split(" ", 1)'$'\n'' tag = tag.lower()'$'\n'' if tag != "imgsrcset":'$'\n'' print(l); continue'$'\n'' for url in re.split(r"\s+\d+[wx]\s*(?:,\s*|$)|,\s+", value.strip()):'$'\n'' if url: print(f"img {url}")' |
python3 -c 'import re, sys'$'\n''for l in map(str.strip, sys.stdin):'$'\n'' try:'$'\n'' tag, value = l.split(" ", 1)'$'\n'' tag = tag.lower()'$'\n'' if tag != "imgsrcset":'$'\n'' print(l); continue'$'\n'' for url in re.split(r"\s+\d+[wx]\s*(?:,\s*|$)|,\s+", value.strip()):'$'\n'' if url: print(f"img {url}")'$'\n'' except BrokenPipeError: break' |

# Decode HTML references
python3 -c 'import html, sys'$'\n''for l in sys.stdin:'$'\n'' try: print(html.unescape(l.strip()))'$'\n'' except BrokenPipeError: break' |


Loading…
Cancel
Save