def getHTML(url): try: from resources.lib.modules import net scrape = net.Net() html = scrape.http_GET(url) return html.content except Exception: return
def get_google_link(url, quality): # html = client.request(url) response = net.Net().http_GET(url) html = response.content links = _parse_gdocs(html) links = sorted(links, reverse=True) headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'} if response is not None: res_headers = response.get_headers(as_dict=True) if 'Set-Cookie' in res_headers: headers['Cookie'] = res_headers['Set-Cookie'] for l in links: if str(quality) in l[0]: return l[1] + append_headers(headers) return links[0][1] + append_headers(headers)
'resources/art/porn00/fanart.jpg')) icon = xbmc.translatePath( os.path.join('special://home/addons/' + addon_id, 'resources/art/porn00/icon.png')) HISTORY_FILE = xbmc.translatePath( os.path.join('special://profile/addon_data/' + addon_id, 'history.xml')) FAVOURITES_FILE = xbmc.translatePath( os.path.join('special://profile/addon_data/' + addon_id, 'favourites.xml')) DOWNLOADS_FILE = xbmc.translatePath( os.path.join('special://profile/addon_data/' + addon_id, 'downloads.xml')) DATA_FOLDER = xbmc.translatePath( os.path.join('special://profile/addon_data/' + addon_id)) SEARCH_FILE = xbmc.translatePath(os.path.join(DATA_FOLDER, 'search.xml')) TEMP_COOKIES = xbmc.translatePath( os.path.join('special://profile/addon_data/' + addon_id, 'cookies.txt')) net = net.Net() NEW_URL = 'http://www.porn00.org/' MOST_VIEW = 'http://www.porn00.org/most-viewed/' def MAIN_MENU(): common.addDir("[COLOR red][B]SEARCH[/B][/COLOR]", 'url', 64, icon, fanart) common.addDir("[COLOR pink][I]New Videos[/I][/COLOR]", NEW_URL, 211, icon, fanart) common.addDir("[COLOR pink][I]Most Viewed[/I][/COLOR]", MOST_VIEW, 211, icon, fanart) result = common.open_url('http://www.porn00.org/')