2013-02-13 01:04:39 +04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
from you_get import *
|
2013-09-11 15:45:34 +04:00
|
|
|
from you_get.extractor.__main__ import url_to_module
|
2013-02-13 01:04:39 +04:00
|
|
|
|
2013-03-01 01:02:12 +04:00
|
|
|
def test_urls(urls):
|
|
|
|
for url in urls:
|
2014-02-15 00:09:57 +04:00
|
|
|
url_to_module(url)[0].download(url, info_only = True)
|
2013-03-01 01:02:12 +04:00
|
|
|
|
2013-02-13 01:04:39 +04:00
|
|
|
class YouGetTests(unittest.TestCase):
|
2014-02-15 00:09:57 +04:00
|
|
|
|
2013-04-10 19:41:23 +04:00
|
|
|
def test_freesound(self):
|
|
|
|
test_urls([
|
|
|
|
"http://www.freesound.org/people/Corsica_S/sounds/184419/",
|
|
|
|
])
|
2014-02-15 00:09:57 +04:00
|
|
|
|
2014-02-15 00:58:43 +04:00
|
|
|
def test_magisto(self):
|
|
|
|
test_urls([
|
|
|
|
"http://www.magisto.com/album/video/f3x9AAQORAkfDnIFDA",
|
|
|
|
])
|
|
|
|
|
2013-02-13 01:04:39 +04:00
|
|
|
def test_mixcloud(self):
|
2013-03-01 01:02:12 +04:00
|
|
|
test_urls([
|
2013-02-13 01:04:39 +04:00
|
|
|
"http://www.mixcloud.com/beatbopz/beat-bopz-disco-mix/",
|
|
|
|
"http://www.mixcloud.com/DJVadim/north-america-are-you-ready/",
|
2013-03-01 01:02:12 +04:00
|
|
|
])
|
2014-02-15 00:09:57 +04:00
|
|
|
|
2013-10-18 16:31:08 +04:00
|
|
|
def test_ted(self):
|
|
|
|
test_urls([
|
|
|
|
"http://www.ted.com/talks/jennifer_lin_improvs_piano_magic.html",
|
|
|
|
"http://www.ted.com/talks/derek_paravicini_and_adam_ockelford_in_the_key_of_genius.html",
|
|
|
|
])
|
2014-02-15 00:09:57 +04:00
|
|
|
|
2013-03-01 01:02:12 +04:00
|
|
|
def test_vimeo(self):
|
|
|
|
test_urls([
|
|
|
|
"http://vimeo.com/56810854",
|
|
|
|
])
|
2014-02-15 00:09:57 +04:00
|
|
|
|
2013-03-01 01:02:12 +04:00
|
|
|
def test_youtube(self):
|
|
|
|
test_urls([
|
|
|
|
"http://www.youtube.com/watch?v=pzKerr0JIPA",
|
|
|
|
"http://youtu.be/pzKerr0JIPA",
|
2013-10-18 16:49:29 +04:00
|
|
|
"http://www.youtube.com/attribution_link?u=/watch?v%3DldAKIzq7bvs%26feature%3Dshare"
|
2013-03-01 01:02:12 +04:00
|
|
|
])
|