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.
Need a bit of help with TVShack Addon
k_zeon
Senior Member Joined: Aug 2011 Reputation: 0 |
2011-09-11 18:57
Post: #1
(This post was last modified: 2011-09-11 19:04 by k_zeon.)
|
| find quote |
k_zeon
Senior Member Joined: Aug 2011 Reputation: 0 |
2011-09-11 19:23
Post: #2
Dont worry. As i am new to Pyton did not realise most things are case Sensative
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,'') /\ was Lower case D on adddir changed to addDir next step is to use URLResolver to get and Play the Link |
| find quote |
k_zeon
Senior Member Joined: Aug 2011 Reputation: 0 |
2011-09-11 20:15
Post: #3
....
|
| find quote |

Search
Help