go get github.com/StalkR/imdb
Bugs, comments, questions: create a new issue.
Also, IMDb has alternative interfaces.
IMDb Go API
Home Page: https://godoc.org/github.com/StalkR/imdb
License: Apache License 2.0
go get github.com/StalkR/imdb
Bugs, comments, questions: create a new issue.
Also, IMDb has alternative interfaces.
Hi
It seems, that the call
`title, err := imdb.SearchTitle(client, movie_name)`
if returning an error:
`imdb: parsing error: id`
Tested with latest version v1.0.15
Maybe it is due to an imdb server update ?
Cheers
I think imdb changed their web search result page and removed the /table item. So no results are returned.
It does that some of the times, I get no results about half of the times.
Hello, i see issue imdb: parsing error: languages. Please help.
Thnks,
It seems that IMDb has made some changes to their website. Parsing is no longer working, and I keep receiving the message: imdb: parsing error: id
`
It appears that the issue might be related to the URLs.
Hi, i have issue parsing error id when i get movie by IMDB id.
search IMDB ID: tt6856242, result year = 0, wanted year = 2021
How to get release Movie or Tv ? Like date month & year
Thnks,
Hey, love the package
My tests recently broken and I didn't change anything - I am getting this error from the package
"imdb: parsing error: list"
It seems to be coming from this callsite: https://github.com/StalkR/imdb/blob/master/search.go#L98
Here is the code that worked as of three days ago
results, err := imdb.SearchTitle(client, title)
if err != nil {
return 0, err
}
//Where client is
client := &http.Client{
Timeout: 10 * time.Second,
Transport: &customTransport{http.DefaultTransport},
}
// which is being called from this function. I tried adding these headers (originally had user agent and language) but it did not help. Not sure if its WAF blocking me or IMDB changed something on purpose. But it would be helpful to have more detailed error messages
func getImdbTechInfo(titleID string, client *http.Client) ([]soup.Root, error) {
// set fake header and stuff so imdb doesnt block
soup.Header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36")
soup.Header("Authority", "m.media-amazon.com")
soup.Header("Accept", "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8")
soup.Header("Accept-Language", "en-US,en;q=0.9")
soup.Header("Cache-Control", "max-age=0")
soup.Header("Sec-Ch-Ua-Mobile", "?0")
soup.Header("Sec-Ch-Ua-Platform", "\"macOS\"")
soup.Header("Sec-Fetch-Dest", "image")
soup.Header("Sec-Fetch-Mode", "no-cors")
soup.Header("Sec-Fetch-Site", "cross-site")
soup.Header("Sec-Fetch-User", "?1")
soup.Header("Referer", "https://www.imdb.com/")
soup.Header("Content-Type", "text/plain;charset=UTF-8")
soup.Header("Origin", "https://www.imdb.com")
soup.Header("X-Imdb-Client-Name", "imdb-ics-tpanswerscta")
// use our slow client
resp, err := soup.GetWithClient(fmt.Sprintf("https://www.imdb.com/title/%s/technical", titleID), client)
if err != nil {
return []soup.Root{}, err
}
log.Debug("Done getting soup response")
docs := soup.HTMLParse(resp)
// the page uses tr/td to display the info
res := docs.Find("div", "id", "technical_content").Find("table").FindAll("tr")
return res, nil
}
I ran search_test.go from your library and it works, but I put this test into my test suite and got the same error... strange
client := &http.Client{
Timeout: 10 * time.Second,
Transport: &customTransport{http.DefaultTransport},
}
title := "Lord of the rings"
r, err := imdb.SearchTitle(client, title)
if err != nil {
t.Fatalf("SearchTitle(%s) error: %v", title, err)
}
if len(r) < 10 {
t.Fatalf("SearchTitle(%s) len < 50: %d", title, len(r))
}
if accepted := map[string]bool{
"tt7631058": true, // The Lord of the Rings (TV Series)
"tt0120737": true, // The Lord of the Rings: The Fellowship of the Ring (2001)
}; !accepted[r[0].ID] {
t.Errorf("SearchTitle(%s)[0].ID = %v; want any of %v", title, r[0].ID, accepted)
}
Any idea? Should I stop coding late at night? I am at a loss how your suite runs locally but even if I copy/paste your tests they fail with the same error.
i am searching using imdb id, and this is what i get (tryd from 2 computers amd & Arm) on version 1.0.11
full code snipet:
package main
import (
"flag"
"fmt"
"net/http"
"os"
"github.com/StalkR/imdb"
)
func main() {
flag.Parse()
if flag.NArg() == 0 {
fmt.Fprintf(os.Stderr, "Usage: %s <search title>\n", os.Args[0])
os.Exit(1)
}
client := http.DefaultClient
fmt.Println(flag.Arg(0))
t, err := imdb.NewTitle(client, flag.Arg(0))
if err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(2)
}
fmt.Println(t.String())
}
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.