def _get_video_info(self,video_id):
     opener=CustomUrlOpener()
     url='http://www.megavideo.com/xml/videolink.php?v='+video_id
     page=opener.open(url)
     response=page.read()
     page.close()
     
     errort = re.compile(' errortext="(.+?)"').findall(response)
     if len(errort) <= 0:
         s = re.compile(' s="(.+?)"').findall(response)
         k1 = re.compile(' k1="(.+?)"').findall(response)
         k2 = re.compile(' k2="(.+?)"').findall(response)
         un = re.compile(' un="(.+?)"').findall(response)
         video_url='http://www' + s[0] + '.megavideo.com/files/' + self._decrypt(un[0], k1[0], k2[0]) + '/?.flv'
         return video_url
     else:
         self._logger.error('We couldn''t get the megavideo url of this video: %s',video_id)
         return None
 def _get_video_info(self,video_url):
      #class="dm_widget_videoplayer"
      
     opener=CustomUrlOpener()
     page=opener.open(video_url)
     response=page.read()
     page.close()
     
     soup = BeautifulSoup(''.join(response),convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
     
     div=soup.find('div',{'class':'dm_widget_videoplayer'})
     script=div.find('script')
     if script!=None:
         urls= re.compile('addVariable\("video", "(.*?)"\);').findall(script.string)
         if urls!=None and len(urls)>0:
             return self._split_urls(urls[0])
         else:
             return None
     else:
         self._logger.error('We couldn''t get the dailymotion url of this video: %s',video_id)
         return None