Giter Site home page Giter Site logo

imdb's Introduction

imdb's People

Contributors

garfunkel avatar jswright avatar maxdanilov avatar stalkr avatar windblows95 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

Watchers

 avatar  avatar  avatar

imdb's Issues

NewTitle function not working any more

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

Can not get search results

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.

imdb: parsing error: id

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.

Get Release Info

How to get release Movie or Tv ? Like date month & year

Thnks,

imdb: parsing error: list when trying to search title

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.

Seartch with IMDB ID dosnt work

image

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())
}

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.