예제 #1
0
 def test_scrape_file_url(self):
     """
     scrape_file_url() should return a URL to download the given Vimeo
     video.
     """
     file_url = vimeo.scrape_file_url(BASE_URL)
     self.assertTrue(file_url.startswith(
             "http://www.vimeo.com/moogaloop/play/clip:2/"), file_url)
예제 #2
0
 def test_scrape_file_url(self):
     """
     scrape_file_url() should return a URL to download the given Vimeo
     video.
     """
     file_url = vimeo.scrape_file_url(BASE_URL)
     self.assertTrue(
         file_url.startswith("http://www.vimeo.com/moogaloop/play/clip:2/"),
         file_url)
예제 #3
0
파일: vimeo.py 프로젝트: appsembler/unisubs
def parse_entry(entry):
    parsed = {
        'title': entry['title'],
        'description': entry['caption'],
        'link': entry['urls']['url']['_content'],
        'thumbnail_url': entry['thumbnails']['thumbnail'][-1]['_content'],
        'publish_date': datetime.strptime(entry['upload_date'],
                                          '%Y-%m-%d %H:%M:%S'),
        'user': entry['owner']['fullname'],
        'user_url': 'http://vimeo.com/%s' % entry['owner']['username'],
        }
    parsed['file_url'] = vimeo_scraper.scrape_file_url(parsed['link'])
    parsed['embed'] = vimeo_scraper.get_embed(parsed['link'])
    if 'tags' in entry:
        parsed['tags'] = [tag['_content'] for tag in entry['tags']['tag']]

    return parsed