소스 검색

Always decode stdin with surrogateescape to avoid breaking on binary input

master
JustAnotherArchivist 2 년 전
부모
커밋
6e5a019d9e
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. +2
    -1
      youtube-extract

+ 2
- 1
youtube-extract 파일 보기

@@ -110,7 +110,8 @@ matchers = [
for e in matchers:
e[0] = re.compile(e[0])

for origLine in sys.stdin:
for origLine in sys.stdin.buffer:
origLine = origLine.decode('utf-8', 'surrogateescape')
origLine = origLine.strip()
line = re.sub(r'https?://', '//', origLine)
line = domainPattern.sub('/www.youtube.com/', line)


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