def getUrl(url): req = mechanize.Request(url) req.add_header('User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3') response = mechanize.urlopen(req) link=response.read() response.close() return link
def getUrl(url): req = mechanize.Request(url) req.add_header( 'User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = mechanize.urlopen(req) link = response.read() response.close() return link
def VIDEOLINKS(url): content = getUrl(url) match=re.findall('flashvars.playlist = \'(.*?)\';', content) for url in match: url='http://ua.canna.to/canna/'+url content = getUrl(url) match=re.findall('<location>(.*?)</location>', content) for url in match: url='http://ua.canna.to/canna/'+url req = mechanize.Request('http://ua.canna.to/canna/single.php') response = mechanize.urlopen(req) req = mechanize.Request(url) req.add_header('User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3') response = mechanize.urlopen(req) response.close() code=response.info().getheader('Content-Location') url='http://ua.canna.to/canna/avzt/'+code print url print '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' listitem = xbmcgui.ListItem(path=url) return xbmcplugin.setResolvedUrl(pluginhandle, True, listitem)
def jahre(url): mainurl='http://ua.canna.to/canna/' req = mechanize.Request(url) req.add_header('User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3') response = mechanize.urlopen(req) link=response.read().replace('\n', '') response.close() match=re.compile('<td align="left" style="border-style:solid; border-width:1px;">.*?<b>(.*?)</b>.*?<b>(.*?)</b>.*?onClick="window.open..(.*?)...CannaPowerChartsPlayer.*?</span>').findall(link) for title1,title2,url in match: url=mainurl+url title=title1+' '+':'+' '+title2 title = title.replace(":", "-") addLink(title,url,6,icon)
def Index(url): mainurl='http://ua.canna.to/canna/' req = mechanize.Request(url) req.add_header('User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3') response = mechanize.urlopen(req) link=response.read().replace('\n', '') response.close() match=re.findall('<tr>.*?<font>(.*?)</font>.*?class="obutton" onClick="window.open..(.*?)...CannaPowerChartsPlayer.*?</tr>', link) for title,url in match: url=mainurl+url print url print title title = title.replace(":", "-") addLink(title,url,6,icon)
def VIDEOLINKS(url): content = getUrl(url) match = re.findall('flashvars.playlist = \'(.*?)\';', content) for url in match: url = 'http://ua.canna.to/canna/' + url content = getUrl(url) match = re.findall('<location>(.*?)</location>', content) for url in match: url = 'http://ua.canna.to/canna/' + url req = mechanize.Request('http://ua.canna.to/canna/single.php') response = mechanize.urlopen(req) req = mechanize.Request(url) req.add_header( 'User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = mechanize.urlopen(req) response.close() code = response.info().getheader('Content-Location') url = 'http://ua.canna.to/canna/avzt/' + code print url print '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' listitem = xbmcgui.ListItem(path=url) return xbmcplugin.setResolvedUrl(pluginhandle, True, listitem)
def Index1(url): if 'jahrescharts' in url: icon = iconpath+'jc_1930.png' mainurl='http://ua.canna.to/canna/' req = mechanize.Request(url) req.add_header('User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3') response = mechanize.urlopen(req) link=response.read().replace('\n', '') response.close() match=re.compile('<b><font face="Arial" size="5" color="#FFCC00"><a href="(.*?)">(.*?)</a></font></b>').findall(link) for url, title in match: url=mainurl+url print url print title title = title.replace(":", "-") addDir(title,url,5,icon)
def jahre(url): mainurl = 'http://ua.canna.to/canna/' req = mechanize.Request(url) req.add_header( 'User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = mechanize.urlopen(req) link = response.read().replace('\n', '') response.close() match = re.compile( '<td align="left" style="border-style:solid; border-width:1px;">.*?<b>(.*?)</b>.*?<b>(.*?)</b>.*?onClick="window.open..(.*?)...CannaPowerChartsPlayer.*?</span>' ).findall(link) for title1, title2, url in match: url = mainurl + url title = title1 + ' ' + ':' + ' ' + title2 title = title.replace(":", "-") addLink(title, url, 6, icon)
def Index(url): mainurl = 'http://ua.canna.to/canna/' req = mechanize.Request(url) req.add_header( 'User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = mechanize.urlopen(req) link = response.read().replace('\n', '') response.close() match = re.findall( '<tr>.*?<font>(.*?)</font>.*?class="obutton" onClick="window.open..(.*?)...CannaPowerChartsPlayer.*?</tr>', link) for title, url in match: url = mainurl + url print url print title title = title.replace(":", "-") addLink(title, url, 6, icon)
def Index1(url): if 'jahrescharts' in url: icon = iconpath + 'jc_1930.png' mainurl = 'http://ua.canna.to/canna/' req = mechanize.Request(url) req.add_header( 'User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = mechanize.urlopen(req) link = response.read().replace('\n', '') response.close() match = re.compile( '<b><font face="Arial" size="5" color="#FFCC00"><a href="(.*?)">(.*?)</a></font></b>' ).findall(link) for url, title in match: url = mainurl + url print url print title title = title.replace(":", "-") addDir(title, url, 5, icon)
def getHeaderLocationUrl(self): opened = mechanize.urlopen(self.__sUrl) return opened.geturl()