Skip to content

Commit

Permalink
Add vtt subtitle positining support for youtube
Browse files Browse the repository at this point in the history
  • Loading branch information
fawazahmed0 committed Jan 5, 2021
1 parent e9f3aa4 commit a3e25d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hardcodesubv2.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ async function uploadSub (chapter, subLink) {
// upload the subtitle for english language, as it is the default title & description language
for(let i=0;i<2;i++){
try {
await subPart(path.join(subtitlesPath, holdersubmap.English, chapter + '.srt'), localPage)
await subPart(path.join(subtitlesPath, holdersubmap.English, chapter + '.vtt'), localPage)
break;
} catch (error) {
const nextText = i === 0 ? ' trying again' : ' failed again, stopping subtitle upload'
Expand All @@ -693,7 +693,7 @@ async function uploadSub (chapter, subLink) {
// Sometimes publish button exists which can cause issue
if(await checkClickPublishBtn(localPage))
break;
console.log('uploading first subtitle failed for ', path.join(subtitlesPath, holdersubmap.English, chapter + '.srt'), nextText)
console.log('uploading first subtitle failed for ', path.join(subtitlesPath, holdersubmap.English, chapter + '.vtt'), nextText)
if(i===1)
return
}
Expand Down Expand Up @@ -751,11 +751,11 @@ async function uploadSub (chapter, subLink) {
for(let i=0;i<2;i++){

try {
await subPart(path.join(subtitlesPath, value, chapter + '.srt'), localPage)
await subPart(path.join(subtitlesPath, value, chapter + '.vtt'), localPage)
break;
} catch (error) {
const nextText = i === 0 ? ' trying again' : ' skipping for now'
console.log('uploading subtitle failed for ', path.join(subtitlesPath, value, chapter + '.srt'), nextText)
console.log('uploading subtitle failed for ', path.join(subtitlesPath, value, chapter + '.vtt'), nextText)
console.error(error)
// The uploading subtitles fails for filipino, so don't waste time trying again for it
if(key==="Filipino")
Expand Down

0 comments on commit a3e25d3

Please sign in to comment.