Giter Club home page Giter Club logo

themoviedb's Introduction

Hi 👋, I'm Leandro César

Tech lead and Python backend developer at Cloudia. Control and Automation Engineer (UNIFEI).

Projects:


Linkedin Twitter Instagram Facebook dev.to

themoviedb's People

Contributors

leandcesar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

joostlek tobiasge

themoviedb's Issues

Crash on tv details

from themoviedb import TMDb
tmdb = TMDb(key=TMDB_API_KEY, language="de-DE",region="DE")
data = tmdb.tv(95558).details()
Traceback (most recent call last):
  File "/home/merlink/Schreibtisch/Pythondatei 2.py", line 75, in <module>
    data = tmdb.tv(95558).details()
  File "/home/merlink/.local/lib/python3.10/site-packages/themoviedb/routes_sync/tv.py", line 18, in details
    return utils.as_dataclass(schemas.TV, data)
  File "/home/merlink/.local/lib/python3.10/site-packages/themoviedb/utils.py", line 35, in as_dataclass
    return from_dict(data_class, data, config=config)
  File "/home/merlink/.local/lib/python3.10/site-packages/dacite/core.py", line 69, in from_dict
    raise WrongTypeError(field_path=field.name, field_type=field_type, value=value)
dacite.exceptions.WrongTypeError: wrong value type for field "next_episode_to_air" - should be "NoneType" instead of value "{'id': 4194489, 'name': 'Episode 8', 'overview': '', 'vote_average': 0.0, 'vote_count': 0, 'air_date': '2023-05-04', 'episode_number': 8, 'production_code': '', 'runtime': None, 'season_number': 1, 'show_id': 95558, 'still_path': '/1d0h7n3ShxgK6b9iAyD6AvnUMIB.jpg'}" of type "dict"

Manage Tmdb user data

Hi!

I want to ask, If there is functionality for managing user data as lists, favorite movies, actors, etc? Or may you planned add it to your library?

mportError: cannot import name 'route' from partially initialized module 'tmdb'

Using any of your base samples to get this working fails with "cannot import name 'xxxxxx'"

Error:
Traceback (most recent call last):
File "/Volumes/OneDrive/Python/rss/tmdb.py", line 2, in
from tmdb import route
File "/Volumes/OneDrive/Python/rss/tmdb.py", line 2, in
from tmdb import route
ImportError: cannot import name 'route' from partially initialized module 'tmdb' (most likely due to a circular import) (/Volumes/OneDrive/Python/rss/tmdb.py)

Support for Configuration

  • Get API Configuration
  • Get Countries
  • Get Jobs
  • Get Languages
  • Get Primary Translations
  • Get Timezones

Consider making aiohttp an optional dependency

I only use the sync part of the library and it would be nice if I could only install the dependencies needed for this.
If you think this would be a good idea, I can prepare a PR for this.

Support for Account

  • Get Details
  • Get Created Lists
  • Get Favorite Movies
  • Get Favorite TV Shows
  • Mark as Favorite
  • Get Rated Movies
  • Get Rated TV Shows
  • Get Rated TV Episodes
  • Get Movie Watchlist
  • Get TV Show Watchlist
  • Add to Watchlist
  • Get Movie (by movie_id) Account States
  • Rate Movie (by movie_id)
  • Delete Movie Rating (by movie_id)
  • Get TV Show (by tv_id) Account States
  • Rate TV Show (by tv_id)
  • Delete TV Show Rating (by tv_id)
  • Get Season (by season_id) Account States
  • Get Episode (by episode_id) Account States
  • Rate TV Episode (by episode_id)
  • Delete TV Episode Rating (by episode_id)

Many unclosed client session/connector errors

The library instantiates a session for you, but I guess doesn't close it. If you make many requests your terminal will be spammed with these errors:

2023-01-02 19:45:42,721 ERROR (asyncio): Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f5462704450>
2023-01-02 19:45:42,722 ERROR (asyncio): Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f544a7f5e10>, 300713.727671935)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f5462704490>

Support for People

  • Get Details
  • Get Movie Credits
  • Get TV Credits
  • Get Combined Credits
  • Get External IDs
  • Get Images
  • Get Tagged Images
  • Get Translations
  • Get Latest
  • Get Popular

Pypi install not working

Installed from Pypi onto Windows 11Pro x64 MD-DOS CLI.
(After the MS-DOS CLI attempt, I tried installing form WSL Ubuntu and got:
"Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-093q6bjq/aiohttp/"
and "No module named 'tmdb'" when I tried to run the example script from the Pypi webpage.)
I noticed the "Unclosed client session" and successfully accessed the db using a web browser. Tried script again, same result.

In MD-DOS CLI, I got this:

Microsoft Windows [Version 10.0.22621.1702]
(c) Microsoft Corporation. All rights reserved.

C:\Users\jimly\Desktop\Movie databases\TMDb>python script01.py
Traceback (most recent call last):
File "C:\Users\jimly\Desktop\Movie databases\TMDb\script01.py", line 19, in
asyncio.run(main())
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
return future.result()
File "C:\Users\jimly\Desktop\Movie databases\TMDb\script01.py", line 11, in main
movies = await route.Movie().search("fight club")
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\site-packages\tmdb\route\movie.py", line 223, in search
return await self.request(
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\site-packages\tmdb\route\base.py", line 97, in request
response.raise_for_status()
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\client_reqrep.py", line 1005, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://api.themoviedb.org/3/search/movie?api_key=eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI0ZDZmZjhkNjUyMjIxNDE0ZWZkMDlkYjcwMjM1NTFlOCIsInN1YiI6IjYxOTQ2Y2Y2M2UwOWYzMDAyYzg2OTI4OSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.TB31RQQ7O_wRcAThjNBNgwWjHy5-UQ3dMlOcXs46NgQ&language=en-US&region=US&watch_region=US&query=fight+club&page=1&include_adult=false')
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001FEB38FD7E0>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001FEB38FD5D0>
Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x000001FEB38FE4D0>
transport: <_ProactorSocketTransport fd=808 read=<_OverlappedFuture cancelled>>
Traceback (most recent call last):
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\sslproto.py", line 684, in _process_write_backlog
self._transport.write(chunk)
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 361, in write
self._loop_writing(data=bytes(data))
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 397, in _loop_writing
self._write_fut = self._loop._proactor.send(self._sock, data)
AttributeError: 'NoneType' object has no attribute 'send'
Exception ignored in: <function _SSLProtocolTransport.del at 0x000001FEB2B68550>
Traceback (most recent call last):
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\sslproto.py", line 321, in del
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\sslproto.py", line 316, in close
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\sslproto.py", line 593, in _start_shutdown
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\sslproto.py", line 598, in _write_appdata
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\sslproto.py", line 706, in _process_write_backlog
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\sslproto.py", line 720, in _fatal_error
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 151, in _force_close
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 745, in call_soon
File "C:\Users\jimly\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 510, in _check_closed
RuntimeError: Event loop is closed
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x000001FEB387ABC0>, 10276.25)]']
connector: <aiohttp.connector.TCPConnector object at 0x000001FEB38FE6E0>

Pip install errors

When installing on Windows with pip, the following conflist arose:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
imdbpie 5.6.5 requires attrs<19.0.0,>=18.1.0, but you have attrs 23.1.0 which is incompatible.
json2xml 3.21.0 requires urllib3==1.26.13, but you have urllib3 2.0.3 which is incompatible.

Support for Lists

  • Get Details
  • Check Item Status
  • Create List
  • Add Movie
  • Remove Movie
  • Clear List
  • Delete List

Support for Movies

  • Get Details
  • Get Alternative Titles
  • Get Credits
  • Get External IDs
  • Get Images
  • Get Keywords
  • Get Lists
  • Get Recommendations
  • Get Release Dates
  • Get Reviews
  • Get Similar Movies
  • Get Translations
  • Get Videos
  • Get Watch Providers
  • Get Latest
  • Get Now Playing
  • Get Popular
  • Get Top Rated
  • Get Upcoming

Oppenheimer release date wrong

>>> s
<themoviedb.routes_sync.search.Search object at 0x7f6325f77a50>
>>> [_ for _ in s.movies('Oppenheimer') if len(_.title) < 14][0].release_date
datetime.date(2024, 1, 12)
>>> [_ for _ in s.movies('Oppenheimer') if len(_.title) < 14][0].title
'Oppenheimer'
>>> [_ for _ in s.movies('Oppenheimer') if len(_.title) < 14][0].id
872585
>>>

https://www.themoviedb.org/movie/872585-oppenheimer
Id of 872585 with name Oppenheimer has release date of 2023.

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.