'license': 'public domain',
'compatible': [1], # compatible module API versions
'depends': [], # other modules required to work properly?
'license': 'public domain',
'compatible': [1], # compatible module API versions
'depends': [], # other modules required to work properly?
-url_regex = re.compile('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+')
-yturl_regex = re.compile('(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?')
+yturl_regex = re.compile(r'https?://(?:www\.)?youtube\.com/watch\?[a-zA-Z0-9=&_\-]+')
- print "Meow"
- for url in url_regex.findall(linetx):
- if checkfor in url:
- url_data = urlparse.urlparse(url)
- query = urlparse.parse_qs(url_data.query)
- video = query["v"][0]
- api_url = 'http://gdata.youtube.com/feeds/api/videos/%s?alt=json&v=2' % video
+ for url in yturl_regex.findall(linetx):
+ url_data = urlparse.urlparse(url)
+ query = urlparse.parse_qs(url_data.query)
+ video = query["v"][0]
+ api_url = 'http://gdata.youtube.com/feeds/api/videos/%s?alt=json&v=2' % video
+ try:
author = video_info['entry']['author'][0]['name']['$t']
bot.msg(line.split()[2], "Youtube: %s (%s)" % (title, author))
author = video_info['entry']['author'][0]['name']['$t']
bot.msg(line.split()[2], "Youtube: %s (%s)" % (title, author))