From 4eadcb85399b108fdacb5e80e6dfd588db2b54f2 Mon Sep 17 00:00:00 2001 From: Brazman Date: Sat, 21 May 2022 02:28:46 +0000 Subject: [PATCH] Upload files to '' --- vidsrclinkgen.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 vidsrclinkgen.py diff --git a/vidsrclinkgen.py b/vidsrclinkgen.py new file mode 100644 index 0000000..451a75d --- /dev/null +++ b/vidsrclinkgen.py @@ -0,0 +1,36 @@ +try: + 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)") + + +try: + + response = requests.get('https://www.omdbapi.com/?t=' + title.replace(" ", "+") + '&apikey=e5c6c48f&') + response.raise_for_status() + jsonResponse = response.json() + seriestype = jsonResponse["Type"] + + if seriestype == "series": + webbrowser.open('https://vidsrc.me/embed/'+ jsonResponse["imdbID"] + '/' + ep + '/') + + elif seriestype == "movie": + webbrowser.open('https://vidsrc.me/embed/'+ jsonResponse["imdbID"] + '/') + +except Exception as err: + print("An error has occured! Try typing the title differently!") + time.sleep(10) \ No newline at end of file