Download subtitle from your terminal.
subdb -p "movie path" -l "language[en,es,fr,it,nl,pl,pt,ro,sv,tr]"
Download subtitle from your terminal.
License: GNU General Public License v2.0
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"
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.
}
subdb -f movie.mp4
subdb -f movie.mp4 -l it
This will make it easy for VLC to pick up the file
Currently
...
resp, err := client.Do(req)
if err != nil {
fmt.Println(err) // only on connection error etc.
}
Should be:
...
resp, err := client.Do(req)
if err != nil {
fmt.Println(err) // only on connection error etc.
os.Exit(1)
}
It is annoying having to type a dot in the name.
It does not work on my Mac
According to the api documentation, the possible statusCodes are:
400 = Bad Request
404 = Not Found
200 = Success
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.