Created
March 16, 2022 12:19
-
-
Save jrejaud/372c7fe75a1335fb5f969ec9152e58d3 to your computer and use it in GitHub Desktop.
Merge Subtitles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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