Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changes to handle embedded video url's

  • Loading branch information...
commit db7af69b5b38c4c1ebbf58ab3fc6db7506bab55a 1 parent 4be492c
unknown authored
View
11 lib/urlresolver/plugins/veoh.py
@@ -34,7 +34,7 @@ def __init__(self):
self.net = Net()
def get_media_url(self, host, media_id):
-
+ print 'veoh resolver: in get_media_url'
print 'host %s media_id %s' %(host, media_id)
## url = 'http://www.veoh.com/rest/video/'+media_id+'/details'
## html = net.http_GET(url).content
@@ -66,11 +66,11 @@ def get_url(self, host, media_id):
def get_host_and_id(self, url):
r = None
video_id = None
-
+ print 'veoh resolver: in get_host_and_id %s ' % url
if re.search('permalinkId=', url):
- r = re.compile('permalinkId=(.+?)(&)').findall(url)
+ r = re.compile('permalinkId=(.+)').findall(url)
elif re.search('watch/', url):
- r = re.compile('watch/(.+?)').findall(url)
+ r = re.compile('watch/(.+)').findall(url)
if r is not None and len(r) > 0:
video_id = r[0]
@@ -82,8 +82,7 @@ def get_host_and_id(self, url):
return False
def valid_url(self, url, host):
- return re.match('http://(.+)?veoh.com/[0-9]+',
- url) or 'veoh' in host
+ return re.search('www.veoh.com/watch/.+',url) or re.search('www.veoh.com/.+?permalinkId=.+',url) or 'veoh' in host
def get_settings_xml(self):
xml = PluginSettings.get_settings_xml(self)
View
6 lib/urlresolver/plugins/vidpe.py
@@ -70,17 +70,17 @@ def get_url(self, host, media_id):
def get_host_and_id(self, url):
+ print 'vidpe resolver: in get_host_and_id %s' % url
r = None
video_id = None
if re.search('embed-', url):
- r = re.compile('embed-(.+?).html').findall(url)
+ r = re.compile('embed-(.+?)-|.html').findall(url)
elif re.search('.com/', url):
r = re.compile('.com/(.+?).html').findall(url)
if r is not None and len(r) > 0:
video_id = r[0]
- print 'video id is %s' % video_id
if video_id:
return (self.get_domain(url), video_id)
else:
@@ -96,7 +96,7 @@ def get_domain(self, url):
return domain
def valid_url(self, url, host):
- return re.match('http://(.+)?(vidpe|hostingcup|hostingbulk).com/[0-9]+', url) or 'vidpe' in host or 'hostingbulk' in host or 'hostingcup' in host
+ return re.search('http://(.+)?(vidpe|hostingcup|hostingbulk).com/.+?.html',url) or 'vidpe' in host or 'hostingbulk' in host or 'hostingcup' in host
def get_settings_xml(self):
xml = PluginSettings.get_settings_xml(self)
Please sign in to comment.
Something went wrong with that request. Please try again.