Skip to content

Commit

Permalink
add support for non embed urls to ufliq plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
t0mm0 committed Nov 3, 2011
1 parent c095bd5 commit 306f1fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin.video.t0mm0.test/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
{'title': 'tubeplus url'})
addon.add_video_item({'host': 'tubeplus.me', 'media_id': '1962655'},
{'title': 'tubeplus media id'})
addon.add_video_item({'url': 'http://www.ufliq.com/embed-rw52re7f5aul.html'},
addon.add_video_item({'url': 'http://www.ufliq.com/rw52re7f5aul'},
{'title': 'ufliq url'})
addon.add_video_item({'host': 'ufliq', 'media_id': 'rw52re7f5aul'},
{'title': 'ufliq media id'})
Expand Down
6 changes: 3 additions & 3 deletions script.module.urlresolver/lib/urlresolver/plugins/ufliq.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self):
self.priority = int(p)
self.net = Net()
#e.g. http://www.ufliq.com/embed-rw52re7f5aul.html
self.pattern = 'http://((?:www.)?ufliq.com)/embed-([0-9a-zA-Z]+).html'
self.pattern = 'http://((?:www.)?ufliq.com)/(?:embed-)?([0-9a-zA-Z]+)'


def get_media_url(self, host, media_id):
Expand All @@ -47,7 +47,7 @@ def get_media_url(self, host, media_id):
html = self.net.http_GET(web_url).content
except urllib2.URLError, e:
common.addon.log_error(self.name + ': got http error %d fetching %s' %
(e.code, api_url))
(e.code, web_url))
return False

# get url from packed javascript
Expand Down Expand Up @@ -76,4 +76,4 @@ def get_host_and_id(self, url):


def valid_url(self, url, host):
return re.match(self.pattern, url) or self.name in host
return re.match(self.pattern, url) or self.name in host

0 comments on commit 306f1fc

Please sign in to comment.