cleaning up

This commit is contained in:
NikolajDanger
2020-03-23 22:34:53 +01:00
parent 775f3fe0c7
commit bc7048d493
21 changed files with 1234 additions and 691 deletions

28
funcs/other/movie.py Normal file
View File

@ -0,0 +1,28 @@
import imdb
import random
def movieFunc():
print("Running !movie")
print("Creating IMDb object")
ia = imdb.IMDb()
print("Picking a movie")
movs = open("movies.txt", "r")
movlist = movs.read().split("\n")
mov = random.choice(movlist)
movs.close()
print("Searching")
s_result = ia.search_movie(mov)
print("Picking the movie")
movie = s_result[0]
ia.update(movie)
cast = movie['cast']
pcast = ""
for x in range(3):
if cast[x]:
pcast += cast[x]['name']+", "
print("Successfully ran !movie")
print("")
return(movie['title'], movie['plot'][0].split("::")[0], movie['cover url'].replace("150","600").replace("101","404"), pcast[:-2])