sameera-madushan / PosterPy

Python script that helps you to search, download movie posters and set them as folder icons.
MIT License
54 stars 2 forks source link

Posterpy not working due to IMDBPY #13

Closed Xelbayria closed 1 year ago

Xelbayria commented 1 year ago

Hello,

I ran p.py to get the poster of the movie, so I inputted the name of the movie. That's where something went wrong. Please see the error below:

2022-12-22 01:37:19,742 CRITICAL [imdbpy] C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\site-packages\imdb\_exceptions.py:33: IMDbDataAccessError exception raised; args: ({'errcode': None, 'errmsg': 'None', 'url': 'https://www.imdb.com/find?q=The+lost+py&s=tt', 'proxy': '', 'exception type': 'IOError', 'original exception': <HTTPError 308: 'Permanent Redirect'>},); kwds: {}
Traceback (most recent call last):
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\site-packages\imdb\parser\http\__init__.py", line 219, in retrieve_unicode
    response = uopener.open(url)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 525, in open
    response = meth(req, response)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 634, in http_response
    response = self.parent.error(
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 563, in error
    return self._call_chain(*args)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 308: Permanent Redirect
Traceback (most recent call last):
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\site-packages\imdb\parser\http\__init__.py", line 219, in retrieve_unicode
    response = uopener.open(url)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 525, in open
    response = meth(req, response)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 634, in http_response
    response = self.parent.error(
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 563, in error
    return self._call_chain(*args)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 308: Permanent Redirect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\USERNAME\Desktop\Applications\Python Library\PosterPy\p.py", line 105, in <module>
    URL = 'https://api.themoviedb.org/3/find/tt{0}?api_key={1}&language=en-US&external_source=imdb_id'.format(search_movie(), api_key())
  File "C:\Users\USERNAME\Desktop\Applications\Python Library\PosterPy\p.py", line 64, in search_movie
    movies = ia.search_movie(user_input)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\site-packages\imdb\__init__.py", line 425, in search_movie
    res = self._search_movie(title, results)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\site-packages\imdb\parser\http\__init__.py", line 405, in _search_movie
    cont = self._get_search_content('tt', title, results)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\site-packages\imdb\parser\http\__init__.py", line 393, in _get_search_content
    cont = self._retrieve(self.urls['find'] % params)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\site-packages\imdb\parser\http\__init__.py", line 376, in _retrieve
    ret = self.urlOpener.retrieve_unicode(url, size=size)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\lib\site-packages\imdb\parser\http\__init__.py", line 247, in retrieve_unicode
    raise IMDbDataAccessError(
imdb._exceptions.IMDbDataAccessError: {'errcode': None, 'errmsg': 'None', 'url': 'https://www.imdb.com/find?q=The+lost+py&s=tt', 'proxy': '', 'exception type': 'IOError', 'original exception': <HTTPError 308: 'Permanent Redirect'>}

EDIT:

I did a bit of investigation and it turned out IMDBPY have been renamed to cinemagoer. The current version of IMDBPY via requirements.txt is not working well. The problem haven't been fixed yet

Xelbayria commented 1 year ago

I managed to solve it by uninstall Python and do a clean installation. I also re-install the requirements.txt via pip.

Now i am having the same issue mentioned in https://github.com/sameera-madushan/PosterPy/issues/12