Python Forum
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cinemagoer library problem
#10
(Sep-05-2023, 03:24 AM)menator01 Wrote: Could use filmography but, returns a lot of stuff that I don't know if it even involves jolie
I think it's the database. I used harrison ford and got movies that he was not in. The years were 1962 and 1967.
Samething with Jason Statham. The database has input year errors.

Here is the ouput for Statham

Output:
Jason Statham 0005458 +---------------------------------------+------+---------+ | Title | Year | ID | +---------------------------------------+------+---------+ | The Italian Job | 1969 | 0064505 | | Lock, Stock and Two Smoking Barrels | 1998 | 0120735 | | The Bank Job | 2008 | 0200465 | | Snatch | 2000 | 0208092 | | Turn It Up | 2000 | 0216772 | | Ghosts of Mars | 2001 | 0228333 | | The One | 2001 | 0267804 | | Mean Machine | 2001 | 0291341 | | The Transporter | 2002 | 0293662 | | The Italian Job | 2003 | 0317740 | | Death Race | 2008 | 0452608 | | Crank | 2006 | 0479884 | | War | 2007 | 0499556 | | Crank: High Voltage | 2009 | 1121931 | | The Expendables | 2010 | 1320253 | | Fast & Furious 6 | 2013 | 1905041 | | Homefront | 2013 | 2312718 | | Furious 7 | 2015 | 2820852 | | Spy | 2015 | 3079380 | | The Fate of the Furious | 2017 | 4630562 | | Fast & Furious Presents: Hobbs & Shaw | 2019 | 6806448 | +---------------------------------------+------+---------+
one more question, hopefully it will be the last. I try to search via company name with the search_company function. I then pass the definitive name to the get_company function which requests an ID for the parameter. How can i get the ID of the company straight from the search_company function? I tried printing it but i only get the name of the company printed. ive tried a generic movie_id or movieId or id option but i get a KeyError

my code follows

this is the function that gets all the results based by the name to find the correct company name which the user is looking for.


        for i in range(len(search)):
            if messagebox.askokcancel(title=f"Company Name",message=f"Is {search[i]}  the company you are looking for?"):
                id=search[i]
                print(id)
                get_data_company(id)
the above function loads another function that will follow below


def get_data_company(id):
    print(id)
company=cg.get_company(str(id))
    print(company["name"])
the elements i have yet to add to this function are the name retrievals from the films and i want to create a new list of the 10 most recent films made by the company that the user is looking for


EDIT: i set up the search by actor name function. It works ok but there is a small problem. I splice the actors filmography to get the first 10 films sorted by release year but it doesnt actually contain the newest ones. For example i searched for Keanu Reeves and his newest film in the list was Matrix Revolutions not John Wick Chapter 4 as it is in real life. My code follows below

def get_data_actor_name(id):
    data=[]
    global cg
    search = cg.search_person(id)
    person=search[0]
    filmography=cg.get_person_biography(id)
    for film in filmography["titlesRefs"].values():
        try:
            year=film["year"]
        except KeyError:
            year="No date available"
        data.append((film["title"],year))
    data.sort(key=lambda a: a[1])
    data.reverse()
    headers=["Movie","Year"]
    filmography=data[:10]
    messagebox.showinfo(title=f"{search}'s latest film information", message=f"{headers}\n"
                                                                            f"{filmography[0]}\n"
                                                                             f"{filmography[1]}\n"
                                                                             f"{filmography[2]}\n"
                                                                             f"{filmography[3]}\n"
                                                                             f"{filmography[4]}\n"
                                                                             f"{filmography[5]}\n"
                                                                             f"{filmography[6]}\n"
                                                                             f"{filmography[7]}\n"
                                                                             f"{filmography[8]}\n"
                                                                             f"{filmography[9]}\n"
                                                                             f"")
Reply


Messages In This Thread
cinemagoer library problem - by lunacy90 - Sep-04-2023, 06:19 PM
RE: cinemagoer library problem - by menator01 - Sep-04-2023, 06:28 PM
RE: cinemagoer library problem - by deanhystad - Sep-04-2023, 06:45 PM
RE: cinemagoer library problem - by lunacy90 - Sep-04-2023, 07:55 PM
RE: cinemagoer library problem - by deanhystad - Sep-04-2023, 08:15 PM
RE: cinemagoer library problem - by menator01 - Sep-05-2023, 12:59 AM
RE: cinemagoer library problem - by deanhystad - Sep-05-2023, 01:41 AM
RE: cinemagoer library problem - by menator01 - Sep-05-2023, 03:24 AM
RE: cinemagoer library problem - by lunacy90 - Sep-05-2023, 10:12 AM
RE: cinemagoer library problem - by lunacy90 - Sep-05-2023, 10:58 AM
RE: cinemagoer library problem - by menator01 - Sep-07-2023, 04:47 PM
RE: cinemagoer library problem - by lunacy90 - Sep-05-2023, 11:58 AM
RE: cinemagoer library problem - by deanhystad - Sep-05-2023, 12:24 PM
RE: cinemagoer library problem - by lunacy90 - Sep-05-2023, 01:30 PM
RE: cinemagoer library problem - by menator01 - Sep-05-2023, 09:30 PM
RE: cinemagoer library problem - by deanhystad - Sep-05-2023, 10:21 PM
RE: cinemagoer library problem - by menator01 - Sep-05-2023, 11:50 PM
RE: cinemagoer library problem - by menator01 - Sep-06-2023, 08:06 AM
RE: cinemagoer library problem - by lunacy90 - Sep-08-2023, 03:16 PM
RE: cinemagoer library problem - by deanhystad - Sep-07-2023, 06:37 PM
RE: cinemagoer library problem - by menator01 - Sep-07-2023, 06:56 PM
RE: cinemagoer library problem - by menator01 - Sep-08-2023, 04:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with importing python-telegram library into the project gandonio 1 1,639 Nov-01-2022, 02:19 AM
Last Post: deanhystad
  Problem with using Crypto library reks2004 2 2,475 Mar-27-2020, 05:38 AM
Last Post: buran
  Problem installing library thunderspeed 2 2,379 Mar-22-2020, 11:04 PM
Last Post: thunderspeed
  Problem importing resource library ChrisM 8 4,073 Oct-23-2019, 01:40 PM
Last Post: ChrisM
  Problem Using Python Library abir99 8 5,500 Nov-21-2017, 03:12 PM
Last Post: sparkz_alot
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,891 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020