Explorar el Código

Always decode stdin with surrogateescape to avoid breaking on binary input

master
JustAnotherArchivist hace 2 años
padre
commit
6e5a019d9e
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. +2
    -1
      youtube-extract

+ 2
- 1
youtube-extract Ver fichero

@@ -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)


Cargando…
Cancelar
Guardar