Git Product home page Git Product logo

ted2srt's Introduction

ted2srt

Donate

This is the source code of ted2srt.org, a website to download bilingual subtitles of TED talks. The backend is written in Haskell, while the frontend is in PureScript.

Set up development environment

Nix is required for development.

Frontend

cd frontend
nix-shell
spago build -w
yarn
yarn start

Run yarn build once, so that backend can start correctly.

Backend

cd backend
nix-shell
stack build

While stack is running, you can setup the database. Postgres and Redis are needed, you can either use your system wide version or nix installed version. Following is how to use the nix version.

# enter nix shell to use postgres and redis installed by nix
nix-shell

# start redis
redis-server --daemonize yes

# start postgres, you only need to initdb and createdb for the first time
initdb -D data -U postgres
pg_ctl -D data -l logfile start
createdb -U postgres ted2srt

One last step, create your own .env file and modify it to your needs.

cp .env.example .env

If stack build has finished now, run

stack exec ted2srt

to start the server.

Then navigate to http://localhost:3001, try paste a TED talk url to the search bar, cheers.

ted2srt's People

Contributors

itsjw avatar panaeon avatar rnons avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ted2srt's Issues

Video "not found"

Almost all of the newly updated videos can not be visited with error message "not found".

stop using `last`

last is a partial function that can fail without any trace, at least use lastMaybe.

Can get mediaPad from talk object, so that functions using last can be removed.

Update to ted.com changes

As noted in #4, smallint is not enough for talk id now.
There are also other page changes of ted.com, just update the backend to make fetching talk data work again.

"Something went wrong" issue

When I click on the most of the videos, "something went wrong" has been appearing on my screen for the last 2 days. It would be perfect if there is a way to solve this problem. Thanks so much in advance.

frontend build error

Hi, rnons. I follow to instruction to build the front end. When excute yarn build, I got some errors

ERROR in ./src/HomePage.ts
Module not found: Error: Can't resolve 'Home' in '/home/ubuntu/ted2srt/frontend/src'
resolve 'Home' in '/home/ubuntu/ted2srt/frontend/src'
  Parsed request is a module
  using description file: /home/ubuntu/ted2srt/frontend/package.json (relative path: ./src)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      /home/ubuntu/ted2srt/frontend/src/node_modules doesn't exist or is not a directory
      /home/ubuntu/ted2srt/frontend/src/dce-output doesn't exist or is not a directory
      /home/ubuntu/ted2srt/frontend/src/src doesn't exist or is not a directory
      /home/ubuntu/ted2srt/frontend/dce-output doesn't exist or is not a directory
      /home/ubuntu/ted2srt/node_modules doesn't exist or is not a directory
      /home/ubuntu/ted2srt/dce-output doesn't exist or is not a directory
      /home/ubuntu/ted2srt/src doesn't exist or is not a directory
      /home/ubuntu/node_modules doesn't exist or is not a directory
      /home/ubuntu/dce-output doesn't exist or is not a directory
      /home/ubuntu/src doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /home/dce-output doesn't exist or is not a directory
      /home/src doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      /dce-output doesn't exist or is not a directory
      /src doesn't exist or is not a directory
      looking for modules in /home/ubuntu/ted2srt/frontend/node_modules
        using description file: /home/ubuntu/ted2srt/frontend/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
      looking for modules in /home/ubuntu/ted2srt/frontend/src
        using description file: /home/ubuntu/ted2srt/frontend/package.json (relative path: ./src)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: /home/ubuntu/ted2srt/frontend/package.json (relative path: ./node_modules/Home)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
          using description file: /home/ubuntu/ted2srt/frontend/package.json (relative path: ./src/Home)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /home/ubuntu/ted2srt/frontend/node_modules/Home doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /home/ubuntu/ted2srt/frontend/src/Home is not a file
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /home/ubuntu/ted2srt/frontend/node_modules/Home.js doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /home/ubuntu/ted2srt/frontend/src/Home.js doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /home/ubuntu/ted2srt/frontend/node_modules/Home.ts doesn't exist
              /home/ubuntu/ted2srt/frontend/src/Home.ts doesn't exist
            as directory
              /home/ubuntu/ted2srt/frontend/node_modules/Home doesn't exist
            as directory
              existing directory
                using path: /home/ubuntu/ted2srt/frontend/src/Home/index
                  using description file: /home/ubuntu/ted2srt/frontend/package.json (relative path: ./src/Home/index)
                    no extension
                      Field 'browser' doesn't contain a valid alias configuration
                      /home/ubuntu/ted2srt/frontend/src/Home/index doesn't exist
                    .js
                      Field 'browser' doesn't contain a valid alias configuration
                      /home/ubuntu/ted2srt/frontend/src/Home/index.js doesn't exist
                    .ts
                      Field 'browser' doesn't contain a valid alias configuration
                      /home/ubuntu/ted2srt/frontend/src/Home/index.ts doesn't exist

Can you give some tips how to resolve it. Thank you ;)

subtitle merge issue

Dear rnons,

I notice the merging strategy of subtitles may cause strange behaviour if two language script is not synchronization. For example, this pages, Single language subtitle works fine. But if I choose two language(en & zh-cn), the english text is not proper match the timeline. I notice in the srt file, timestamp have two lines. So can the merging procedure intelligently process the asynchronization issue or generate two vtt in the subtitle section.
Same problem appears in the main content, if two language don't match, the longer one will be cut.

I'm not sure if I have make myself clear. Thanks~

"Something went wrong" problem.

When I clicked any of the titles a blank page with error messge "Something went wrong" appeared. Is there any thing wrong here ? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.