Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discard auto-generated transcript #36

Open
kaanguneyli opened this issue Jul 31, 2024 · 2 comments
Open

Discard auto-generated transcript #36

kaanguneyli opened this issue Jul 31, 2024 · 2 comments

Comments

@kaanguneyli
Copy link

Is there a way to discard the auto-generated transcripts. When I pick language "en", the program directly picks the auto-generated one although there is original transcript for the video. I looked for some options but couldn't find any?

@aehlke
Copy link

aehlke commented Aug 9, 2024

any luck?

@Marceltbn
Copy link

Marceltbn commented Aug 14, 2024

Either the languageCode is wrong or the order.
Posting your captionTracks would help. If the order is wrong I would search/"find" for vssId (a.ja signifies automated, .ja normal) and not the languageCode.

[
    {
        "baseUrl": "",
        "name": {
            "simpleText": "Japans (automatisch gegenereerd)"
        },
        "vssId": "a.ja",
        "languageCode": "ja",
        "kind": "asr",
        "isTranslatable": true,
        "trackName": ""
    },
    {
        "baseUrl": "",
        "name": {
            "simpleText": "Japans"
        },
        "vssId": ".ja",
        "languageCode": "ja",
        "isTranslatable": true,
        "trackName": ""
    }
]

I'm on an old custom version but this is how mine looks like:

if (langCode) {
    captionTrack =
        availableCaptions.find((track: any) => {
            /* track.languageCode.includes(langCode); */
            return track.vssId === '.' + langCode;
        }) ?? undefined;

    if (captionTrack === undefined) {
        captionTrack =
            availableCaptions.find((track: any) => {
                /* track.languageCode.includes(langCode); */
                return track.vssId === 'a.' + langCode;
            }) ?? availableCaptions?.[0];
    }
}

For the current version this could work? Haven't tried it though

    let transcriptURL: any
    transcriptURL = 
      config?.lang
        ? captions.captionTracks.find(
            (track) => track.vssId === '.' + config.lang
          )  // returns undefined if not found
        : undefined 

    if(transcriptURL === undefined){
        transcriptURL = (
          config?.lang
            ? captions.captionTracks.find(
                (track) => track.languageCode === config?.lang
              )
            : captions.captionTracks[0]
        ).baseUrl;
    } else {
        transcriptURL = transcriptURL.baseUrl
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants