2011-09-11, 18:57
I have started to create a Basic TVShack Addon.
ie Movies - AtoZ - MovieNames - Show AvailLinks
I have managed to get the Movies listed , but for the life of me cannot see where i am going wrong getting the mega whatever links.
I have enable debugging in the settings, and when i run my addon everything works till i click a movie link and want to return a list of links to play but dont know where the log is to tell me why my addon Script Failed.
snippet from def that trys to find the mega link. I select A then 'A Beautiful Mind' which should give me http://tvsearch.co/movies/watch/HWR2BVTZ/
I then pass this URL to below and it should find 4 links.
def GENERATE_SOURCE(url,name):
req = urllib2.Request(url)
MainURL = 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 = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('<li class="searchList"><a href="(.+?)" onclick="switchMirror.+?">(.+?)</a>').findall(link)
for url,name in match:
adddir(name,MainURL + "/" + url,4,'')
any help is appreciated. If req can supply code of what i have so far.
ie Movies - AtoZ - MovieNames - Show AvailLinks
I have managed to get the Movies listed , but for the life of me cannot see where i am going wrong getting the mega whatever links.
I have enable debugging in the settings, and when i run my addon everything works till i click a movie link and want to return a list of links to play but dont know where the log is to tell me why my addon Script Failed.
snippet from def that trys to find the mega link. I select A then 'A Beautiful Mind' which should give me http://tvsearch.co/movies/watch/HWR2BVTZ/
I then pass this URL to below and it should find 4 links.
def GENERATE_SOURCE(url,name):
req = urllib2.Request(url)
MainURL = 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 = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('<li class="searchList"><a href="(.+?)" onclick="switchMirror.+?">(.+?)</a>').findall(link)
for url,name in match:
adddir(name,MainURL + "/" + url,4,'')
any help is appreciated. If req can supply code of what i have so far.