import os,sys,re,urllib #NZB_ = {'Details':[], 'Genre':[], 'Year':[], 'Tagline':[], 'Plot':[], 'Rating':[], 'Runtime':[], 'Actor':[], 'Alias':[]} def Title(url): IMDb_ = {'Title':[]} title = re.compile(r'
.*') in_details = re.compile(r'">(.*?)
') sock = urllib.urlopen(url) page = sock.readlines() sock.close() for i in page: if details.match(i) != None: try: IMDb_['Details'].append(in_details.search(i).group(1).strip()) except: IMDb_['Details'].append('None') return str(IMDb_['Details'])[2:-2] def Genre(url): IMDb_ = {'Genre':[]} genres = re.compile(r'(.*?)') sock = urllib.urlopen(url) page = sock.readlines() sock.close() for i in page: if year.match(i) != None: try: IMDb_['Year'].append(in_year.search(i).group(1).strip()) except: IMDb_['Year'].append('None') return str(IMDb_['Year'])[2:-2] def Tagline(url): IMDb_ = {'Tagline':[]} tagline = re.compile(r'Tagline:.*') in_tagline = re.compile(r"(.*)") sock = urllib.urlopen(url) page = sock.readlines() sock.close() for i in page: if tagline.match(i) != None: try: IMDb_['Tagline'].append(in_tagline.search(i).group(1).strip()) except: IMDb_['Tagline'].append('None') return str(IMDb_['Tagline'])[2:-72] def Plot(url): IMDb_ = {'Plot':[]} plot = re.compile(r'Plot Outline:.*') in_plot = re.compile(r"(.*?).*/.*.*') in_rating = re.compile(r"(.*?)/.* .*") sock = urllib.urlopen(url) page = sock.readlines() sock.close() for i in page: if rating.match(i) != None: try: IMDb_['Rating'].append(in_rating.search(i).group(1).strip()) except: IMDb_['Rating'].append('None') return str(IMDb_['Rating'][0]) def Runtime(url): IMDb_ = {'Runtime':[]} runtime = re.compile(r'(.*?) min') in_runtime = re.compile(r"(.*?) min") sock = urllib.urlopen(url) page = sock.readlines() sock.close() for i in page: if runtime.match(i) != None: try: IMDb_['Runtime'].append(in_runtime.search(i).group(1).strip()) except: IMDb_['Runtime'].append('None') return str(IMDb_['Runtime'][0]) + " min" def Director(url): IMDb_ = {'Director':[]} director = re.compile(r'Directed by