Get closed caption “cc” for Youtube video












10















Does any one know how to get the CC for any Youtube video that has the caption available? I know on the API 2.0 documentation mentions that it is only available for the owner of the video... but I was able to get some of the video's caption even though I'm not the owner of any....



There are two APIs (or links to API) can be used. they both rout to timpedtext API.
before I mention them we should note the parameters the API need. which are:





  • lang: {en, fr,...} required.


  • v: {video ID} required.


  • name: the track name, Required only if it is set. (and with this is my problem.)


  • tlang: translation to language. optional (should be set if you like to translate the CC to other language.


The API links are:




  1. http://video.google.com/timedtext?lang=fr&v=PILzP-bIeLo&name=french
    Note the above example would return nothing if you remove the name=French or set it to something else...


  2. http://www.youtube.com/api/timedtext?v=zzfCVBSsvqA&lang=en
    Note this example would return nothing if you set the name=...


  3. http://www.youtube.com/api/timedtext?v=ZdP0KM49IVk&lang=en
    yet the actual video has caption.



Example 3 does not return the CC data.



So I'm guessing that example 3 need to have the name parameter set. and my main problem is how do I find the name parameter if it is set or not. and if it is set how do I know what is it?










share|improve this question

























  • Possible duplicate of Extract automatic captions from YouTube video

    – maxymoo
    Apr 9 '17 at 23:07
















10















Does any one know how to get the CC for any Youtube video that has the caption available? I know on the API 2.0 documentation mentions that it is only available for the owner of the video... but I was able to get some of the video's caption even though I'm not the owner of any....



There are two APIs (or links to API) can be used. they both rout to timpedtext API.
before I mention them we should note the parameters the API need. which are:





  • lang: {en, fr,...} required.


  • v: {video ID} required.


  • name: the track name, Required only if it is set. (and with this is my problem.)


  • tlang: translation to language. optional (should be set if you like to translate the CC to other language.


The API links are:




  1. http://video.google.com/timedtext?lang=fr&v=PILzP-bIeLo&name=french
    Note the above example would return nothing if you remove the name=French or set it to something else...


  2. http://www.youtube.com/api/timedtext?v=zzfCVBSsvqA&lang=en
    Note this example would return nothing if you set the name=...


  3. http://www.youtube.com/api/timedtext?v=ZdP0KM49IVk&lang=en
    yet the actual video has caption.



Example 3 does not return the CC data.



So I'm guessing that example 3 need to have the name parameter set. and my main problem is how do I find the name parameter if it is set or not. and if it is set how do I know what is it?










share|improve this question

























  • Possible duplicate of Extract automatic captions from YouTube video

    – maxymoo
    Apr 9 '17 at 23:07














10












10








10


6






Does any one know how to get the CC for any Youtube video that has the caption available? I know on the API 2.0 documentation mentions that it is only available for the owner of the video... but I was able to get some of the video's caption even though I'm not the owner of any....



There are two APIs (or links to API) can be used. they both rout to timpedtext API.
before I mention them we should note the parameters the API need. which are:





  • lang: {en, fr,...} required.


  • v: {video ID} required.


  • name: the track name, Required only if it is set. (and with this is my problem.)


  • tlang: translation to language. optional (should be set if you like to translate the CC to other language.


The API links are:




  1. http://video.google.com/timedtext?lang=fr&v=PILzP-bIeLo&name=french
    Note the above example would return nothing if you remove the name=French or set it to something else...


  2. http://www.youtube.com/api/timedtext?v=zzfCVBSsvqA&lang=en
    Note this example would return nothing if you set the name=...


  3. http://www.youtube.com/api/timedtext?v=ZdP0KM49IVk&lang=en
    yet the actual video has caption.



Example 3 does not return the CC data.



So I'm guessing that example 3 need to have the name parameter set. and my main problem is how do I find the name parameter if it is set or not. and if it is set how do I know what is it?










share|improve this question
















Does any one know how to get the CC for any Youtube video that has the caption available? I know on the API 2.0 documentation mentions that it is only available for the owner of the video... but I was able to get some of the video's caption even though I'm not the owner of any....



There are two APIs (or links to API) can be used. they both rout to timpedtext API.
before I mention them we should note the parameters the API need. which are:





  • lang: {en, fr,...} required.


  • v: {video ID} required.


  • name: the track name, Required only if it is set. (and with this is my problem.)


  • tlang: translation to language. optional (should be set if you like to translate the CC to other language.


The API links are:




  1. http://video.google.com/timedtext?lang=fr&v=PILzP-bIeLo&name=french
    Note the above example would return nothing if you remove the name=French or set it to something else...


  2. http://www.youtube.com/api/timedtext?v=zzfCVBSsvqA&lang=en
    Note this example would return nothing if you set the name=...


  3. http://www.youtube.com/api/timedtext?v=ZdP0KM49IVk&lang=en
    yet the actual video has caption.



Example 3 does not return the CC data.



So I'm guessing that example 3 need to have the name parameter set. and my main problem is how do I find the name parameter if it is set or not. and if it is set how do I know what is it?







youtube-api closed-captions






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 14 '14 at 21:25









JensG

9,49132939




9,49132939










asked May 14 '14 at 21:19









Mohanad57Mohanad57

6018




6018













  • Possible duplicate of Extract automatic captions from YouTube video

    – maxymoo
    Apr 9 '17 at 23:07



















  • Possible duplicate of Extract automatic captions from YouTube video

    – maxymoo
    Apr 9 '17 at 23:07

















Possible duplicate of Extract automatic captions from YouTube video

– maxymoo
Apr 9 '17 at 23:07





Possible duplicate of Extract automatic captions from YouTube video

– maxymoo
Apr 9 '17 at 23:07












4 Answers
4






active

oldest

votes


















8














Your first example should work without the name= part.
This did the job for me:



video.google.com/timedtext?lang={languageID}&v={videoId}


To fetch the english CC version from the previous answer, it would look like this:



http://video.google.com/timedtext?lang=en&v=zzfCVBSsvqA





share|improve this answer

































    7














    You can get the list of available captions with http://video.google.com/timedtext?type=list&v=zzfCVBSsvqA request.



    Your 3rd video has only automatically generated captions, which you cannot fetch easily.






    share|improve this answer


























    • but video.google.com api is not there anymore for youtube.

      – Nirbhay Kundan
      Mar 31 '15 at 8:59



















    3














    Here my suggestions after spending some time:




    • Js library: https://github.com/syzer/youtube-captions-scraper => support auto-generated caption.



    • 2 quick methods below not support auto-generated caption




      • Get a list of subtitles: http://video.google.com/timedtext?type=list&v=lT3vGaOLWqE

      • Get subtitle with track id: http://video.google.com/timedtext?type=track&v=lT3vGaOLWqE&id=0&lang=en



    • Quick download:
      http://downsub.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dag_EJRhMfOM







    share|improve this answer































      0














      If video.google.com does not fetch your closed caption file OR you don't want your file in XML format, but would rather SRT (see note below), try:



      CC SUBS



      NOTE: SRT can be transformed into virtually ANY format - either using free subtitling tools OR
      by replacing nn with |, n with ; and then | into n, you get a CSV file that can be opened in a spreadsheet, for example.






      share|improve this answer























        Your Answer






        StackExchange.ifUsing("editor", function () {
        StackExchange.using("externalEditor", function () {
        StackExchange.using("snippets", function () {
        StackExchange.snippets.init();
        });
        });
        }, "code-snippets");

        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "1"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f23665343%2fget-closed-caption-cc-for-youtube-video%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        8














        Your first example should work without the name= part.
        This did the job for me:



        video.google.com/timedtext?lang={languageID}&v={videoId}


        To fetch the english CC version from the previous answer, it would look like this:



        http://video.google.com/timedtext?lang=en&v=zzfCVBSsvqA





        share|improve this answer






























          8














          Your first example should work without the name= part.
          This did the job for me:



          video.google.com/timedtext?lang={languageID}&v={videoId}


          To fetch the english CC version from the previous answer, it would look like this:



          http://video.google.com/timedtext?lang=en&v=zzfCVBSsvqA





          share|improve this answer




























            8












            8








            8







            Your first example should work without the name= part.
            This did the job for me:



            video.google.com/timedtext?lang={languageID}&v={videoId}


            To fetch the english CC version from the previous answer, it would look like this:



            http://video.google.com/timedtext?lang=en&v=zzfCVBSsvqA





            share|improve this answer















            Your first example should work without the name= part.
            This did the job for me:



            video.google.com/timedtext?lang={languageID}&v={videoId}


            To fetch the english CC version from the previous answer, it would look like this:



            http://video.google.com/timedtext?lang=en&v=zzfCVBSsvqA






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 19 at 18:25

























            answered Jun 2 '15 at 16:42









            dont_trust_medont_trust_me

            185317




            185317

























                7














                You can get the list of available captions with http://video.google.com/timedtext?type=list&v=zzfCVBSsvqA request.



                Your 3rd video has only automatically generated captions, which you cannot fetch easily.






                share|improve this answer


























                • but video.google.com api is not there anymore for youtube.

                  – Nirbhay Kundan
                  Mar 31 '15 at 8:59
















                7














                You can get the list of available captions with http://video.google.com/timedtext?type=list&v=zzfCVBSsvqA request.



                Your 3rd video has only automatically generated captions, which you cannot fetch easily.






                share|improve this answer


























                • but video.google.com api is not there anymore for youtube.

                  – Nirbhay Kundan
                  Mar 31 '15 at 8:59














                7












                7








                7







                You can get the list of available captions with http://video.google.com/timedtext?type=list&v=zzfCVBSsvqA request.



                Your 3rd video has only automatically generated captions, which you cannot fetch easily.






                share|improve this answer















                You can get the list of available captions with http://video.google.com/timedtext?type=list&v=zzfCVBSsvqA request.



                Your 3rd video has only automatically generated captions, which you cannot fetch easily.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 23 '17 at 12:26









                Community

                11




                11










                answered Sep 17 '14 at 10:25









                a.ch.a.ch.

                6,71332846




                6,71332846













                • but video.google.com api is not there anymore for youtube.

                  – Nirbhay Kundan
                  Mar 31 '15 at 8:59



















                • but video.google.com api is not there anymore for youtube.

                  – Nirbhay Kundan
                  Mar 31 '15 at 8:59

















                but video.google.com api is not there anymore for youtube.

                – Nirbhay Kundan
                Mar 31 '15 at 8:59





                but video.google.com api is not there anymore for youtube.

                – Nirbhay Kundan
                Mar 31 '15 at 8:59











                3














                Here my suggestions after spending some time:




                • Js library: https://github.com/syzer/youtube-captions-scraper => support auto-generated caption.



                • 2 quick methods below not support auto-generated caption




                  • Get a list of subtitles: http://video.google.com/timedtext?type=list&v=lT3vGaOLWqE

                  • Get subtitle with track id: http://video.google.com/timedtext?type=track&v=lT3vGaOLWqE&id=0&lang=en



                • Quick download:
                  http://downsub.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dag_EJRhMfOM







                share|improve this answer




























                  3














                  Here my suggestions after spending some time:




                  • Js library: https://github.com/syzer/youtube-captions-scraper => support auto-generated caption.



                  • 2 quick methods below not support auto-generated caption




                    • Get a list of subtitles: http://video.google.com/timedtext?type=list&v=lT3vGaOLWqE

                    • Get subtitle with track id: http://video.google.com/timedtext?type=track&v=lT3vGaOLWqE&id=0&lang=en



                  • Quick download:
                    http://downsub.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dag_EJRhMfOM







                  share|improve this answer


























                    3












                    3








                    3







                    Here my suggestions after spending some time:




                    • Js library: https://github.com/syzer/youtube-captions-scraper => support auto-generated caption.



                    • 2 quick methods below not support auto-generated caption




                      • Get a list of subtitles: http://video.google.com/timedtext?type=list&v=lT3vGaOLWqE

                      • Get subtitle with track id: http://video.google.com/timedtext?type=track&v=lT3vGaOLWqE&id=0&lang=en



                    • Quick download:
                      http://downsub.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dag_EJRhMfOM







                    share|improve this answer













                    Here my suggestions after spending some time:




                    • Js library: https://github.com/syzer/youtube-captions-scraper => support auto-generated caption.



                    • 2 quick methods below not support auto-generated caption




                      • Get a list of subtitles: http://video.google.com/timedtext?type=list&v=lT3vGaOLWqE

                      • Get subtitle with track id: http://video.google.com/timedtext?type=track&v=lT3vGaOLWqE&id=0&lang=en



                    • Quick download:
                      http://downsub.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dag_EJRhMfOM








                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 24 '18 at 18:15









                    SolominhSolominh

                    21125




                    21125























                        0














                        If video.google.com does not fetch your closed caption file OR you don't want your file in XML format, but would rather SRT (see note below), try:



                        CC SUBS



                        NOTE: SRT can be transformed into virtually ANY format - either using free subtitling tools OR
                        by replacing nn with |, n with ; and then | into n, you get a CSV file that can be opened in a spreadsheet, for example.






                        share|improve this answer




























                          0














                          If video.google.com does not fetch your closed caption file OR you don't want your file in XML format, but would rather SRT (see note below), try:



                          CC SUBS



                          NOTE: SRT can be transformed into virtually ANY format - either using free subtitling tools OR
                          by replacing nn with |, n with ; and then | into n, you get a CSV file that can be opened in a spreadsheet, for example.






                          share|improve this answer


























                            0












                            0








                            0







                            If video.google.com does not fetch your closed caption file OR you don't want your file in XML format, but would rather SRT (see note below), try:



                            CC SUBS



                            NOTE: SRT can be transformed into virtually ANY format - either using free subtitling tools OR
                            by replacing nn with |, n with ; and then | into n, you get a CSV file that can be opened in a spreadsheet, for example.






                            share|improve this answer













                            If video.google.com does not fetch your closed caption file OR you don't want your file in XML format, but would rather SRT (see note below), try:



                            CC SUBS



                            NOTE: SRT can be transformed into virtually ANY format - either using free subtitling tools OR
                            by replacing nn with |, n with ; and then | into n, you get a CSV file that can be opened in a spreadsheet, for example.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered May 1 '17 at 11:26









                            tony giltony gil

                            7,86245885




                            7,86245885






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f23665343%2fget-closed-caption-cc-for-youtube-video%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Homophylophilia

                                Updating UILabel text programmatically using a function

                                Cloud Functions - OpenCV Videocapture Read method fails for larger files from cloud storage