Giter Site home page Giter Site logo

itsmehemant7 / pymoviedb Goto Github PK

View Code? Open in Web Editor NEW
77.0 3.0 15.0 23 KB

A Simple IMDb API for Python

License: MIT License

Python 100.00%
imdb imdb-api imdb-information imdb-movies imdb-python imdb-rating imdb-scraper imdb-webscrapping actor film-ratings

pymoviedb's People

Contributors

itsmehemant7 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

Watchers

 avatar  avatar  avatar

pymoviedb's Issues

Get more data?

ok it functions, but only get a couple of useful data per movie/tv search. Is there a way to have it download all the user reviews for a movie/series for example?

get() returns json dump instead of dict

Thanks for all the effort, I just started utilizing your package in one of my works!

In most apis, data is returned as a dict instead of json dump. However in your work, I manually convert your method outputs to a dict at every call.

Do you have any intentions to update the get() output so that it returns a dict instead of json dump?

return json.dumps(output, indent=2)

Popular movie issue

hey man,
when i run the movie popular func i sometimes (like when i use Genre = 'Comedy') i got an error when there is no year in the IMDB web.
In line 343 in the imdb.py file, when you update the year:
"year = year.find('span', containing='(')[0] if bool(year.find('span', containing='(')) else "" "
when the year isn't display it get the value of "".
therefore when you got to the next line - "year = "".join(re.findall(r"\d+", year.text))" the code fail.
i change the else "" to: else "TBD" or whatever value you want to add.
and then added an if condition that test if year != "TBD" (there was a value in the find func before) then, it will run the "year = "".join(re.findall(r"\d+", year.text))" line and then its run smoothly.
i would like to know your thoughts about it.

something like this:
year = year.find('span', containing='(')[0] if bool(year.find('span', containing='(')) else "TBD"
if year != "TBD":
year = "".join(re.findall(r"\d+", year.text))

No results from API

Hi I'm using this API and different endpoint such as imdb.get_by_name('House Of The Dragon', tv=True) , or imdb.get_by_id("tt12593682") and I have always the result below:

{"status": 404, "message": "No Result Found!", "result_count": 0, "results": []}
โ€‹
I have installed sucessfully and followed all the steps..

Example `get_by_name()` from README.md does not work

from PyMovieDb import IMDB
imdb = IMDB()
r = imdb.get_by_name('House Of The Dragon', tv=True)
print(r)
'{"status": 404, "message": "No Result Found!", "result_count": 0, "results": []}'

Version: 0.0.8
Python Version: 3.8

404 on some IMDB id's

I think this library is awesome, however I ran into problems with some IMDB id's.

I applied the imdb.get_by_id() against 575 movies I have metadata.

13% of the results were status=404, however the ID's were correct.

Here's a list to help debugging the issue:

IMBD failed on tt0118556 / Addicted.to.Love.1997.nfo
IMBD failed on tt0058586 / A.Shot.in.the.Dark.1964.nfo
IMBD failed on tt0034492 / Bambi.1.1942.nfo
IMBD failed on tt0118689 / Bean.1997.nfo
IMBD failed on tt1529569 / Beautiful.Lies.2010.nfo
IMBD failed on tt0054698 / Breakfast.at.Tiffany's.1961.nfo
IMBD failed on tt5716464 / Breathe.2017.nfo
IMBD failed on tt0049038 / Bus.Stop.1956.nfo
IMBD failed on tt0056923 / Charade.1963.nfo
IMBD failed on tt0042332 / Cinderella.1950.nfo
IMBD failed on tt0038427 / Courage.of.Lassie.1946.nfo
IMBD failed on tt3660770 / Disney.Monkey.Kingdom.nfo
IMBD failed on tt0765128 / Disney.Oceans.nfo
IMBD failed on tt0127536 / Elizabeth.1998.nfo
IMBD failed on tt0266543 / Finding.Nemo.2003.nfo
IMBD failed on tt0083987 / Gandhi.1982.nfo
IMBD failed on tt0093209 / Hope.and.Glory.1987.nfo
IMBD failed on tt2100546 / Ice.Age-A.Mammoth.Christmas.nfo
IMBD failed on tt2718492 / Ida.2013.nfo
IMBD failed on tt2073128 / IMAX.To.the.Arctic.nfo
IMBD failed on tt0329737 / It's.a.Very.Merry.Muppet.Christmas.Movie.2002.nfo
IMBD failed on tt1619029 / Jackie.2016.nfo
IMBD failed on tt0058150 / James.Bond.007.1964.Goldfinger.nfo
IMBD failed on tt0064757 / James.Bond.007.1969.On.Her.Majesty's.Secret.Service.nfo
IMBD failed on tt0070328 / James.Bond.007.1973.Live.and.Let.Die.nfo
IMBD failed on tt0076752 / James.Bond.007.1977.The.Spy.Who.Loved.Me.nfo
IMBD failed on tt0113189 / James.Bond.007.1995.Goldeneye.nfo
IMBD failed on tt0246460 / James.Bond.007.2002.Die.Another.Day.nfo
IMBD failed on tt0830515 / James.Bond.007.2008.Quantum.of.Solace.nfo
IMBD failed on tt2379713 / James.Bond.007.2015.Spectre.nfo
IMBD failed on tt0118308 / Jane.Austen.Emma.1996.nfo
IMBD failed on tt0114388 / Jane.Austen.Sense.and.Sensibility.1995.nfo
IMBD failed on tt1229822 / Jane.Eyre.2011.nfo
IMBD failed on tt0274166 / Johnny.English.2003.nfo
IMBD failed on tt0048280 / Lady.and.the.Tramp.1955.nfo
IMBD failed on tt0351283 / Madagascar.1.2005.nfo
IMBD failed on tt1365483 / Main.Street.2010.nfo
IMBD failed on tt0405159 / Million.Dollar.Baby.2004.nfo
IMBD failed on tt4824302 / Mother's.Day.2016.nfo
IMBD failed on tt0203009 / Moulin.Rouge.2001.nfo
IMBD failed on tt1078912 / Night.at.the.Museum.2.Battle.of.the.Smithsonian.2009.nfo
IMBD failed on tt0032910 / Pinocchio.1940.nfo
IMBD failed on tt0377107 / Proof.2005.nfo
IMBD failed on tt0448694 / Puss.in.Boots.2011.nfo
IMBD failed on tt0070608 / Robin.Hood.1973.nfo
IMBD failed on tt0047437 / Sabrina.1954.nfo
IMBD failed on tt2872750 / Shaun.the.Sheep.Movie.2015.nfo
IMBD failed on tt1079448 / Snow.Buddies.2008.nfo
IMBD failed on tt0281373 / Snow.Dogs.2002.nfo
IMBD failed on tt0029583 / Snow.White.and.the.Seven.Dwarfs.1937.nfo
IMBD failed on tt1047011 / Song.for.Marion.2012.nfo
IMBD failed on tt0118715 / The.Big.Lebowski.1998.nfo
IMBD failed on tt0878804 / The.Blind.Side.2009.nfo
IMBD failed on tt0112579 / The.Bridges.of.Madison.County.1995.nfo
IMBD failed on tt0372824 / The.Chorus.2004.nfo
IMBD failed on tt0082474 / The.Great.Muppet.Caper.1981.nfo
IMBD failed on tt1454029 / The.Help.2011.nfo
IMBD failed on tt0061852 / The.Jungle.Book.1967.nfo
IMBD failed on tt2555736 / The.Second.Best.Exotic.Marigold.Hotel.2015.nfo
IMBD failed on tt2709768 / The.Secret.Life.of.Pets.1.2016.nfo
IMBD failed on tt0159097 / The.Virgin.Suicides.1999.nfo
IMBD failed on tt1441912 / The.Way.2010.nfo
IMBD failed on tt0209475 / The.Wedding.Planner.2001.nfo
IMBD failed on tt0430770 / The.Women.2008.nfo
IMBD failed on tt0117951 / Trainspotting.1996.nfo
IMBD failed on tt0358273 / Walk.the.Line.2005.nfo
IMBD failed on tt0910970 / Wall.E.2008.nfo

missing requirements file and lack of dependency packaging

Thanks for the great package! I am facing some issues:

env

windows10, python3.10, miniconda env

steps

pip install PyMovieDb 
from PyMovieDb import IMDB

imdb = IMDB()
res = imdb.get_by_id("asdsad")

error

Traceback (most recent call last):
  File "...\lib\site-packages\PyMovieDb\__init__.py", line 2, in <module>
    from .imdb import IMDB
  File "...\lib\site-packages\PyMovieDb\imdb.py", line 5, in <module>
    from requests_html import HTMLSession
ModuleNotFoundError: No module named 'requests_html'

search() throws an Assertion if the value for year is not an int

In [62]: year
Out[62]: '2007'

In [63]: title
Out[63]: 'Grindhouse.'

In [64]: res0 = imdb.search(title, year=year)
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
Cell In [64], line 1
----> 1 res0 = imdb.search(title, year=year)

File /usr/local/lib/python3.11/site-packages/PyMovieDb/imdb.py:73, in IMDB.search(self, name, year, tv, person)
     71     url = f"https://www.imdb.com/find?q={name}"
     72 else:
---> 73     assert isinstance(year, int)
     74     url = f"https://www.imdb.com/find?q={name}+{year}"
     75 # print(url)

AssertionError:

Not working!

Sometimes, get_by_name() doesn't work. It returns no results even for famous movies like Deadpool, and Avengers Endgame.

Some Doubts

Sir, I am currently using your library PyMovieDb. I have a doubt regarding it, that is what will be the structure of JSON if the movie does not exist on IMDB or it fails to fetch the data? And how can I handle it?

Not fixed!

issue #3 is not really fixed...it is still returning string not dict as result. I have compared the 0.0.6 release with the previous one and you haven't changed a thing, so how in the world did the issue get fixed? @itsmehemant7

pic

pic2

pic3

Get year data

Hi,

can:
imdb.get_by_id("tt12593682") #Example

Also return the year of the movie/show?

thanks!

Results url

Url in search results a bit not correct, it gives url like

https://www.imdb.comhttps://www.imdb.com/title/tt0073623/
{
  "type": "Movie",
  "name": "Satsujin ken 2",
  "url": "https://www.imdb.comhttps://www.imdb.com/title/tt0073623/",
  "poster": "https://m.media-amazon.com/images/M/MV5BNjg5N2UyMGYtNGMwNy00OTgzLTk1OTctZTZmZmIwZmQzODI5XkEyXkFqcGdeQXVyNzc5MjA3OA@@._V1_.jpg",
  "description": "Mercenary karate master Tsurugi gets mixed up in a plot by the American mafia to take over the karate dojos in Asia, aided by a corrupt dojo master.",
  "review": {
    "author": "HaemovoreRex",
    "dateCreated": "2007-05-01",
    "inLanguage": "English",
    "heading": "More Chiba mayhem!",
    "reviewBody": "Well, against the ostensible general tide of opinion I must say that I wasn&apos;t a particularly huge fan of the original film that this follows. In fact, for me at least, the only saving grace it boasted was in its violent excesses \u0096 the majority of which were saved until the final third of its running time. From reading many of the other reviews on this site, it furthermore seems indicative that the exact said graphic violence is the principle reason that most other reviewers have awarded the flick such lofty marks.\n\nInterestingly and conversely, this sequel actually tones down the blood letting somewhat and apparently as a result didn&apos;t hold quite as much appeal it would seem. Well, that&apos;s what I&apos;m assuming at least.\n\nFrom my own perspective however, whilst this sequel is indeed bereft of much of the old red stuff a flying, I would say that it actually surpasses the original in pure entertainment value by far. The martial arts sequences are far superior this time around including some rather nifty Kobudo weapons displays throughout. Also Sonny Chiba is on much better form here to \u0096 just check out the awesome sequence near the start of the film in which our protagonist allows himself to be taken to a police station in order to silence a witness. He makes his escape by kicking the bars out through the wall and leaping through the subsequent hole from a few stories up! \n\nAnother scene of amazing note involves our hero punching some poor chap so hard in the back of the head that his eyeballs literally pop out!!! (some great utilisation of ping-pong balls there!) It&apos;s also great to see the return of a supposedly deceased character from the first flick who returns here with the intention of exacting his revenge upon our hero.\n\nTo be quite honest, there&apos;s only one negative I can think of in this flick and that is the ill advised inclusion of Chiba&apos;s &apos;side-kick&apos; (the first film also suffered the indignity of including one to!) who in this instance is a veritably annoying chick boasting ridiculous looking pig tails and who furthermore, has a rather unfortunate propensity for warbling along to crappy music (badly at that!)\n\nAside from this minor gripe though, overall, this proves to be a tremendously entertaining affair throughout and is well worth tracking down!",
    "reviewRating": {
      "worstRating": 1,
      "bestRating": 10,
      "ratingValue": 8
    }
  },
  "rating": {
    "ratingCount": 2231,
    "bestRating": 10,
    "worstRating": 1,
    "ratingValue": 6.3
  },
  "contentRating": "X",
  "genre": [
    "Action",
    "Crime",
    "Drama"
  ],
  "datePublished": "1974-04-27",
  "keywords": "martial arts action,grindhouse film,exploitation film,psychotronic film,female nudity",
  "duration": "PT1H28M",
  "actor": [
    {
      "name": "Shin&apos;ichi Chiba",
      "url": "https://www.imdb.com/name/nm0002002/"
    },
    {
      "name": "Claude Gagnon",
      "url": "https://www.imdb.com/name/nm0300965/"
    },
    {
      "name": "Y\u00f4ko Ichiji",
      "url": "https://www.imdb.com/name/nm0406706/"
    }
  ],
  "director": [
    {
      "name": "Shigehiro Ozawa",
      "url": "https://www.imdb.com/name/nm0654725/"
    }
  ],
  "creator": [
    {
      "name": "Shigehiro Ozawa",
      "url": "https://www.imdb.com/name/nm0654725/"
    },
    {
      "name": "K\u00f4ji Takada",
      "url": "https://www.imdb.com/name/nm0847026/"
    },
    {
      "name": "Hajime Takaiwa",
      "url": "https://www.imdb.com/name/nm0847244/"
    }
  ]
}

i guess it's imdb.py, line 149 "url": self.baseURL + result.get('url'), issue, need to delete self.baseURL from this line

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.