def iWatchLINK(mname, url): link = main.OPENURL(url) movie_content = main.unescapes(link) movie_content = re.sub("\\\"", "\"", movie_content) movie_content = movie_content.replace('\'', '') from resources.universal import _common as univ_common link2 = univ_common.str_conv(decode(movie_content)) if selfAddon.getSetting("hide-download-instructions") != "true": main.addLink( "[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]", '', '') links = re.search('<tbody>(.+?)</tbody>', link2) if links: links = links.group(1) print links match = re.compile( '<a href="([^"]+?)" target="_blank" rel="nofollow"><img src=".+?> ([^<]+?)</td> <td><img src=".+?</td> <td>.+?</td> <td>([^<]+?)</td>', re.DOTALL).findall(links) for url, name, qua in match: name = name.replace(' ', '') if name[0:1] == '.': name = name[1:] name = name.split('.')[0] if main.supportedHost(name.lower()): main.addDown2( mname + ' [COLOR red](' + qua + ')[/COLOR]' + ' [COLOR blue]' + name.upper() + '[/COLOR]', url, 649, art + '/hosts/' + name.lower() + '.png', art + '/hosts/' + name.lower() + '.png')
def PANEL_REPLACER(content): panel_exists = True panel_id = 0 while panel_exists == True: panel_name = "panel-id." + str(panel_id) panel_search_pattern = "(?s)\"" + panel_name + "\"\:\[\{(.+?)\}\]" panel_data = re.search(panel_search_pattern, content) if panel_data: panel_data = panel_data.group(1) content = re.sub("begin " + panel_name, "-->" + panel_data + "<!--", content) content = re.sub(panel_search_pattern, "panel used", content) panel_id = panel_id + 1 else: panel_exists = False content = main.unescapes(content) content = re.sub("\\\"", "\"", content) from resources.universal import _common as univ_common content = univ_common.str_conv(decode(content)) return content
def iWatchLINK(mname,url): link=main.OPENURL(url) movie_content = main.unescapes(link) movie_content = re.sub("\\\"", "\"", movie_content) movie_content=movie_content.replace('\'','') from resources.universal import _common as univ_common link2 = univ_common.str_conv(decode(movie_content)) if selfAddon.getSetting("hide-download-instructions") != "true": main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','') links = re.search('<tbody>(.+?)</tbody>', link2) if links: links = links.group(1).replace(' ','') #print links href="([^"]+?)" target="_blank" rel="nofollow"><img src=".+?>([^<]+?)</td><td><img src=".+?</td><td>.+?</td><td>([^<]+?)</td> match=re.compile('href="([^"]+?)" target="_blank" rel="nofollow"><img src=".+?>([^<]+?)</td><td><img src=".+?</td><td>.+?</td><td>([^<]+?)</td>', re.DOTALL).findall(links) for url, name, qua in match: name=name.replace(' ','') if name[0:1]=='.': name=name[1:] name=name.split('.')[0] if main.supportedHost(name.lower()): main.addDown2(mname+' [COLOR red]('+qua+')[/COLOR]'+' [COLOR blue]'+name.upper()+'[/COLOR]',url,649,art+'/hosts/'+name.lower()+'.png',art+'/hosts/'+name.lower()+'.png')