If you bought the books and screenplays, you acquired them in a way that doesn't infringe on copyright. If you borrowed them from the library, you acquired them in a way that doesn't infringe on copyright. You don't need a license because you aren't republishing.
ML training doesn't work without having a copy of the data (books and screenplays). That data can either be copied in a non-infringing way (buy the books; acquire a license) or in an infringing way (download the books from a corpus without explicit permission like these AI companies are accused of doing). LLM services need a license just like Facebook, Instagram, etc. need a license to republish the stuff you post. The copyright holder maintains their copyright and the service that republishes their work (Facebook, Instagram, etc.) or publishes derivative works (AI) needs a license.