You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.2 KiB

import requests
except ImportError:
print("You need to install 'requests'! Open up command prompt, jam in 'pip3 install requests' and hit enter!")
import webbrowser
import time
from requests.exceptions import HTTPError
title = input("Enter the title: ")
type = input("TV or Movie?: ")
typeparsed = ""
# grug brain can't figure out how to read string as capitalized
if type in ["T", "TV", "TV SHOW", "t", "tv", "tv show"]:
typeparsed = "T"
elif type in ["M", "MOVIE", "m", "movie"]:
typeparsed = "M"
if typeparsed == "T":
ep = input("Which episode? SeasonNumber-EpisodeNumber (Example: 2-8)")
response = requests.get('' + title.replace(" ", "+") + '&apikey=e5c6c48f&')
jsonResponse = response.json()
seriestype = jsonResponse["Type"]
if seriestype == "series":''+ jsonResponse["imdbID"] + '/' + ep + '/')
elif seriestype == "movie":''+ jsonResponse["imdbID"] + '/')
except Exception as err:
print("An error has occured! Try typing the title differently!")