소스 검색

Filter out lines with invalid UTF-8

master
JustAnotherArchivist 11 달 전
부모
커밋
a85ffe791b
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. +3
    -0
      html-extract-stupid

+ 3
- 0
html-extract-stupid 파일 보기

@@ -34,6 +34,9 @@
# Filter out lines without an attribute value
grep -Pva '^[a-zA-Z]+ $' |

# Remove lines with invalid UTF-8
LANG=C.UTF-8 grep -a '^.*$' |

# img srcset splitting
python3 -c 'import os, re, sys'$'\n''try:'$'\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}")'$'\n''except BrokenPipeError:'$'\n'' os.dup2(os.open(os.devnull, os.O_WRONLY), sys.stdout.fileno()); sys.exit(1)' |



불러오는 중...
취소
저장