Skip to content

Commit

Permalink
cmd/extract: replace / in filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinB committed Mar 30, 2024
1 parent 24e092b commit a1f4278
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ func writeFile(vmd *cobra.Command, resp *http.Response, record *warc.Record) err
filename = filename[:255-len(extension)] + extension
}

// Remove any invalid characters from the filename
filename = strings.ReplaceAll(filename, "/", "_")

// Check if the file already exists
outputDir := vmd.Flags().Lookup("output").Value.String()

Expand Down

0 comments on commit a1f4278

Please sign in to comment.