def get_movies_and_music_videos(name, url, language, mode): ADDON_USERDATA_FOLDER = xbmc.translatePath(ADDON.getAddonInfo('profile')) COOKIE_FILE = os.path.join(ADDON_USERDATA_FOLDER, 'cookies') html = HTTPInterface.http_get(url, cookie_file=COOKIE_FILE) match = re.compile( '<div class="(video|music)-object-thumb"><a href="(.+?)">(.+?<a class="movie-cover-wrapper".+?>)?<img src="(.+?)" alt="(.+?)"' ).findall(html) # Bit of a hack MOVIES_URL = "http://www.einthusan.com/movies/" for _, page_link, _, image, name in match: if (mode == 1): image = MOVIES_URL + image addDir(name, MOVIES_URL + page_link, 2, image, image) numerical_nav = re.compile( '<div class="numerical-nav">(.+?)</div>').findall(html) if (len(numerical_nav) > 0): next_page = re.compile( '<a class="numerical-nav-selected" href=".+?">.+?</a><a href=".+?">(.+?)</a>' ).findall(numerical_nav[0]) if (len(next_page) == 1): addDir("Next >>", url + "&page=" + next_page[0], mode, "http://www.sahara.co.za/Images/next.jpg", '') xbmcplugin.endOfDirectory(int(sys.argv[1]))
def http_request_with_login(url): username = xbmcplugin.getSetting(int(sys.argv[1]), 'username') password = xbmcplugin.getSetting(int(sys.argv[1]), 'password') ADDON_USERDATA_FOLDER = xbmc.translatePath(ADDON.getAddonInfo('profile')) COOKIE_FILE = os.path.join(ADDON_USERDATA_FOLDER, 'cookies') return HTTPInterface.http_get(url, COOKIE_FILE,username, password)
def http_request_with_login(url): username = xbmcplugin.getSetting(int(sys.argv[1]), 'username') password = xbmcplugin.getSetting(int(sys.argv[1]), 'password') ADDON_USERDATA_FOLDER = xbmc.translatePath(ADDON.getAddonInfo('profile')) COOKIE_FILE = os.path.join(ADDON_USERDATA_FOLDER, 'cookies') return HTTPInterface.http_get(url, COOKIE_FILE, username, password)
def get_movies_and_music_videos(name, url, language, mode): ADDON_USERDATA_FOLDER = xbmc.translatePath(ADDON.getAddonInfo("profile")) COOKIE_FILE = os.path.join(ADDON_USERDATA_FOLDER, "cookies") html = HTTPInterface.http_get(url, cookie_file=COOKIE_FILE) match = re.compile( '<div class="(video|music)-object-thumb"><a href="(.+?)">(.+?<a class="movie-cover-wrapper".+?>)?<img src="(.+?)" alt="(.+?)"' ).findall(html) # Bit of a hack MOVIES_URL = "http://www.einthusan.com/movies/" for _, page_link, _, image, name in match: if mode == 1: image = MOVIES_URL + image addDir(name, MOVIES_URL + page_link, 2, image, image) numerical_nav = re.compile('<div class="numerical-nav">(.+?)</div>').findall(html) if len(numerical_nav) > 0: next_page = re.compile('<a class="numerical-nav-selected" href=".+?">.+?</a><a href=".+?">(.+?)</a>').findall( numerical_nav[0] ) if len(next_page) == 1: addDir("Next >>", url + "&page=" + next_page[0], mode, "http://www.sahara.co.za/Images/next.jpg", "") xbmcplugin.endOfDirectory(int(sys.argv[1]))
def show_featured_movies(name, url, language, mode): page_url = 'http://www.einthusan.com/index.php?lang=' + language html = HTTPInterface.http_get(page_url) matches = re.compile('<a class="movie-cover-wrapper" href="(.+?)"><img src="(.+?)" alt="(.+?)" ').findall(html) BASE_URL = 'http://www.einthusan.com/' for link, image, name in matches: addDir(name, BASE_URL + link, 2, BASE_URL + image, language) xbmcplugin.endOfDirectory(int(sys.argv[1]))
def get_movie_detail(movie_id): time.sleep(0.4) API_URL = 'http://www.einthusan.com/webservice/movie.php?id=' + str(movie_id) html = HTTPInterface.http_get(API_URL) response_json = {} try: response_json = json.loads(html) except ValueError: print "Value Error: Error when decoding JSON" print html return response_json['movie_id'], response_json['movie'], response_json['cover']
def get_movie_detail(movie_id): time.sleep(0.4) API_URL = 'http://www.einthusan.ca/webservice/movie.php?id=' + str(movie_id) html = HTTPInterface.http_get(API_URL) response_json = {} try: response_json = json.loads(html) except ValueError: print "Value Error: Error when decoding JSON" print html return response_json['movie_id'], response_json['movie'], response_json['cover']
def show_featured_movies(name, url, language, mode): page_url = 'http://www.einthusan.com/index.php?lang=' + language ADDON_USERDATA_FOLDER = xbmc.translatePath(ADDON.getAddonInfo('profile')) COOKIE_FILE = os.path.join(ADDON_USERDATA_FOLDER, 'cookies') html = HTTPInterface.http_get(page_url, cookie_file = COOKIE_FILE) matches = re.compile('class="movie-cover-wrapper" .+? href="(.+?)"><img src="(.+?)" alt="(.+?)"').findall(html) BASE_URL = 'http://www.einthusan.com/' for link, image, name in matches: addDir(name, BASE_URL + link, 2, BASE_URL + image, language) xbmcplugin.endOfDirectory(int(sys.argv[1]))
def show_search_box(name, url, language, mode): search_term = GUIEditExportName("") search_url = 'http://www.einthusan.com/search/?search_query=' + search_term + "&lang=" + language html = HTTPInterface.http_get(search_url) match = re.compile('<a href="(../movies/watch.php.+?)">(.+?)</a>').findall(html) # Bit of a hack again MOVIES_URL = "http://www.einthusan.com/movies/" for url,name in match: addDir(name, MOVIES_URL + url, 2, '') xbmcplugin.endOfDirectory(int(sys.argv[1]))
def get_movies_and_music_videos(name, url, language, mode): html = HTTPInterface.http_get(url) match = re.compile('<div class="(video|music)-object-thumb"><a href="(.+?)">(.+?<a class="movie-cover-wrapper".+?>)?<img src="(.+?)" alt="(.+?)"').findall(html) # Bit of a hack MOVIES_URL = "http://www.einthusan.com/movies/" for _, page_link, _, image, name in match: if (mode == 1): image = MOVIES_URL + image addDir(name, MOVIES_URL + page_link, 2, image, image) numerical_nav = re.compile('<div class="numerical-nav">(.+?)</div>').findall(html) if (len(numerical_nav) > 0): next_page = re.compile('<a class="numerical-nav-selected" href=".+?">.+?</a><a href=".+?">(.+?)</a>').findall(numerical_nav[0]) if (len(next_page) == 1): addDir("Next >>", url + "&page=" + next_page[0], mode, "http://www.sahara.co.za/Images/next.jpg", '') xbmcplugin.endOfDirectory(int(sys.argv[1]))
def show_list(name, b_url, language, mode): url = b_url + 'index.php?organize=Director' if (mode == 9): url = b_url + 'index.php?organize=Year' elif (mode == 10): url = b_url + 'index.php?organize=Cast' url = url + "&lang="+language BASE_URL = b_url + 'index.php' html = HTTPInterface.http_get(url) list_div = re.compile('<div class="video-organizer-element-wrapper">(.+?)</div>').findall(html) if len(list_div) > 0: years = re.compile('<a href="(.+?)">(.+?)</a>').findall(list_div[0]) for year_url,year in years: addDir(year, BASE_URL + year_url, 1, '') xbmcplugin.endOfDirectory(int(sys.argv[1]))
def show_featured_movies(name, url, language, mode): page_url = 'http://www.einthusan.com/index.php?lang=' + language ADDON_USERDATA_FOLDER = xbmc.translatePath(ADDON.getAddonInfo('profile')) COOKIE_FILE = os.path.join(ADDON_USERDATA_FOLDER, 'cookies') html = HTTPInterface.http_get(page_url, cookie_file=COOKIE_FILE) matches = re.compile( '<a class="movie-cover-wrapper" style="position: absolute;" href="(.+?)"><img src="(.+?)" alt="(.+?)" ' ).findall(html) print 'log: show featured movies----> ', matches BASE_URL = 'http://www.einthusan.com/' for link, image, name in matches: name = name.replace(' tamil movie online', '', 1) name = name.replace(' malayalam movie online', '', 1) name = name.replace(' telugu movie online', '', 1) name = name.replace(' hindi movie online', '', 1) name = name.replace(' kannada movie online', '', 1) name = name.replace(' punjabi movie online', '', 1) name = name.replace(' marathi movie online', '', 1) name = name.replace(' bengali movie online', '', 1) name = name.replace(' gujarathi movie online', '', 1) addDir(name, BASE_URL + link, 2, BASE_URL + image, language) xbmcplugin.endOfDirectory(int(sys.argv[1]))
def get_movie_detail(movie_id): time.sleep(0.4) API_URL = 'http://www.einthusan.com/webservice/movie.php?id=' + str(movie_id) html = HTTPInterface.http_get(API_URL) response_json = json.loads(html) return response_json['movie_id'], response_json['movie'], response_json['cover']
def http_request_with_login(url): username = xbmcplugin.getSetting(int(sys.argv[1]), 'username') password = xbmcplugin.getSetting(int(sys.argv[1]), 'password') return HTTPInterface.http_get(url, username, password)