Ted Talks Subtitles Downloader

Fecha: February 5th, 2010 | Categoría: Internet | 16 Comments »

As my mother tongue is not english, I've been always appreciative of things like Ted Translations, because it allows me to share my findings on the web with people from my country, where not everybody is as fluent in english as to hear and understand every word of a TED Talk. But I've found annoying that you could watch the video with subtitles online, but you couldn't download them in a appropriate format (I generally use the '.srt' format).

I did some research, created a python script that lets you download the subtitles, and parse them from JSON to the '.srt' format; but in these days a black-and-white command-line script is not acceptable. So I made it my first web-app, a TED Talk Subtitle Downloader.

http://tedtalksubtitledownload.appspot.com/

(online implementation of http://estebanordano.com.ar/ted-talks-download-subtitles/)


  • http://estebanordano.com.ar/ted-talks-download-subtitles/ TED Talks Download Subtitles | estebanordano.com.ar

    [...] UPDATE: Online version [...]

  • http://www.crossmovie.com Lee

    Thanks for your great works! Subtitle is important for english video to non-english people.

  • http://Website Charles

    I copy pasted the text to notepad, but the subtitles do not load into the video with VLC player. Is other software needed to get the subtitles into the video file?

  • http://estebanordano.com.ar/ eordano

    Charles: You shouldn't copy n paste, try with "Save page as..." and add the .srt extension to the file downloaded.

  • http://Website Charles

    Esteban:

    You are great!

    Is it possible to have 2 or 3 languages as subtitles in one video? Copy and pasting each sentence works. Is there a method for copying pasting the entire text from one saved .SRT file into another?

  • http://estebanordano.com.ar/ eordano

    Hi. It's your lucky day. Since I was very bored studying, I took a break and modified the script to allow multiple languages in the same subtitle.

    Here you go:
    http://pastebin.com/FHnW1V2h

  • http://Website Charles

    What a lucky day! A gift from the programming gods to the world!

  • http://estebanordano.com.ar/ eordano

    Let me know if it was helpful!

    Thanks for giving me something to do :P

  • http://Website Charles

    I have got as far as saving the code as a .py file, downloading a python interpreter then double clicking on the .py file. HAHA after some more hours the code and process will not seem like black magic!

    An online version would be great!

    http://www.imageupload.org/share.php?id=760A_4C455CB3

  • http://Website Charles

    For Python27
    Line 3: import simplejson
    change to
    Line 3: import json

    Where do you find the ID numbers for the tedtalks?

    I'm getting the "could not fetch subtitles!" message

  • http://Website Charles

    changed simplejson to json in line 58;

    now...
    entering 2+ languages leaves error lines on 88, 82 and 62

    entering 1 language gives the text of the speech

  • http://Website Charles

    > eng spa
    Downloading subtitles for languages: eng spa
    Traceback (most recent call last):
    File "tedm.py", line 88, in
    main(sys.argv[1])
    File "tedm.py", line 82, in main
    downloadSub(idtalk, availables, int(vidpar['introDura
    File "tedm.py", line 62, in downloadSub
    salida = file('subs_%s_%s.srt'%(idtalk,reduce(lambda
    'w')
    File "tedm.py", line 62, in
    salida = file('subs_%s_%s.srt'%(idtalk,reduce(lambda
    'w')
    TypeError: can only concatenate list (not "str") to list

    3 days to get here! haha.... It took 15 hours to figure out that executing scripts is done in the dos command prompt, that scripts must be in the same folder as the python program, and the command is python xxx.py. Hope to see an online version soon hahaha wow, you programmers are crazy.

  • http://Website Roberto

    Hola Esteban.
    Antes que neda te felicito, me ha sido de mucha utilidad tu sitio, ahora puedo ver el video en mi TV con subtitulos GRACIAS, sigue ayudando a los demas.

    Habras realizado un programa similar pero para los demas sitios como YouTube y similares ?

  • http://estebanordano.com.ar/ eordano

    Me alegro mucho que te haya servido Roberto!

    YouTube no sé cómo guarda sus subtitulos. Los que son autogenerados, no creo que sea fácil!... los que sube un usuario por ahí es menos difícil.

  • http://Website swatiaski

    hi may I know how you get the time intro from TED talk?

  • http://estebanordano.com.ar/ eordano

    I use the one from the site, somewhere there is a javascript associative array with that info. Check out the source code (sorry if it's too awful) here: http://github.com/eordano/Ted-Talk-Subtitle-Download

    Sometimes it isn't the same as the mp4 that you can download, and you have to change that manually. This is the link that you can use to do so:

    http://tedtalksubtitledownload.appspot.com/get_subtitle?tedtalkid=XX&lang=YY&timeIntro=ZZ

    Fill in the XX, YY and ZZ with appropiate info.

    If you need further help, please contact me here or you can find my email address on the top of this page.