GithubHelp home page GithubHelp logo

subdb.go's Introduction

subdb.go

Download subtitle from your terminal.

Usage

subdb -p "movie path" -l "language[en,es,fr,it,nl,pl,pt,ro,sv,tr]"

subdb.go's People

Contributors

anirudhbhat avatar

Stargazers

 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

Forkers

ciceroverneck

subdb.go's Issues

Use flag for parameters

Use the flag package to parse the files; It allows you to provide named parameters, and a help menu (which is really nice in this case, since you don't actually provide an example of how the language is formatted).

And finally, in the url-string you use ",en", where you should really only use "en":
This:

url := "http://api.thesubdb.com/?action=download&hash=" + hash + "&language=" + language + ",en"

Should be:

url := "http://api.thesubdb.com/?action=download&hash=" + hash + "&language=" + language + "en"

Code for using flag:

var (
    filepath string
    language string
)

func init() {
    flag.StringVar(&filepath, "f", "", "Path to the movie file")
    flag.StringVar(&language, "l", "en", "The required language of the subtitles")
}

func main() {
        flag.Parse()

    if filepath == "" {
        fmt.Println("Provide path to movie file etc.")
        os.Exit(1)
    }

        // Validate that language is of length == 2 etc.
}

Example usage:

subdb -f movie.mp4
subdb -f movie.mp4 -l it

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.