Skip to content

Instantly share code, notes, and snippets.

@jrejaud
Created March 16, 2022 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrejaud/372c7fe75a1335fb5f969ec9152e58d3 to your computer and use it in GitHub Desktop.
Save jrejaud/372c7fe75a1335fb5f969ec9152e58d3 to your computer and use it in GitHub Desktop.
Merge Subtitles
#!/usr/bin/env zx
const URL = "https://subtitletools.com/api/v1/merge-subtitles/simple"
// These are real files
const fileOne = await fs.readFile('./input1.srt')
const fileTwo = await fs.readFile('./input2.srt')
const body = {
"subtitle": fileOne,
"second-subtitle": fileTwo,
"simpleTopBottom": "true",
"baseSubtitleColor": "#ffff54",
"mergeSubtitleColor": "#ffff54"
}
const response = await fetch(URL, {method: 'POST', body: body, headers: {Authorization: "Bearer MINE"}})
console.log(await response.text())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment