Reverse engineered prompt

Build me a small Python project that can connect to an Xtream IPTV provider using a server name, username, password, and URL, then pull in the catalog in a way that is easy to use from code. I want it to authenticate first, then load groups, live channels, movies, and series, with series details like seasons and episodes fetched only when needed. It should let me search streams by keyword, get EPG info for live channels, and download video streams.

Please make it feel practical and beginner friendly, with a simple example script I can run after adding my provider details. If it makes sense, also include the optional local web page or REST service so I can search and try playing streams in a browser. Handle bad connections and missing provider fields gracefully, and keep compatibility in mind with apps that expect Hypnotix style data.

Add a few tests plus a functional test I can fill in with my account details. Look up current docs online if you need to.

Want more depth? Deep Reverse