aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgcmalloc <gcmalloc@gmail.com>2012-10-24 00:13:16 +0200
committergcmalloc <gcmalloc@gmail.com>2012-10-24 00:13:16 +0200
commit9c6e9a4532f7856d3bff0e14e17cc2084bc5b022 (patch)
tree0f2714600340bd7d392ca1251f5c659f5c1baa0a
parent67af74992ec4f1d17d530c636fa53ffda1c3a99c (diff)
adding xnxx test
-rw-r--r--test/test_download.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/test_download.py b/test/test_download.py
index d90d1583a..612280e6c 100644
--- a/test/test_download.py
+++ b/test/test_download.py
@@ -9,7 +9,7 @@ from youtube_dl.InfoExtractors import YoutubeIE, DailymotionIE
from youtube_dl.InfoExtractors import MetacafeIE, BlipTVIE
from youtube_dl.InfoExtractors import XVideosIE, VimeoIE
from youtube_dl.InfoExtractors import SoundcloudIE, StanfordOpenClassroomIE
-from youtube_dl.InfoExtractors import CollegeHumorIE
+from youtube_dl.InfoExtractors import CollegeHumorIE, XNXXIE
class DownloadTest(unittest.TestCase):
@@ -54,6 +54,10 @@ class DownloadTest(unittest.TestCase):
COLLEGEHUMOR_URL = "http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody"
COLLEGEHUMOR_FILE = ""
+ XNXX_MD5 = "5f0469c8d1dfd1bc38c8e6deb5e0a21d"
+ XNXX_URL = "http://video.xnxx.com/video1135332/lida_naked_funny_actress_5_"
+ XNXX_FILE = "1135332.flv"
+
def test_youtube(self):
#let's download a file from youtube
with open(DownloadTest.PARAMETERS_FILE) as f:
@@ -136,6 +140,15 @@ class DownloadTest(unittest.TestCase):
md5_down_file = md5_for_file(DownloadTest.COLLEGEHUMOR_FILE)
self.assertEqual(md5_down_file, DownloadTest.COLLEGEHUMOR_MD5)
+ def test_xnxx(self):
+ with open(DownloadTest.PARAMETERS_FILE) as f:
+ fd = FileDownloader(json.load(f))
+ fd.add_info_extractor(XNXXIE())
+ fd.download([DownloadTest.XNXX_URL])
+ self.assertTrue(os.path.exists(DownloadTest.XNXX_FILE))
+ md5_down_file = md5_for_file(DownloadTest.XNXX_FILE)
+ self.assertEqual(md5_down_file, DownloadTest.XNXX_MD5)
+
def tearDown(self):
if os.path.exists(DownloadTest.YOUTUBE_FILE):
os.remove(DownloadTest.YOUTUBE_FILE)
@@ -155,6 +168,8 @@ class DownloadTest(unittest.TestCase):
os.remove(DownloadTest.STANDFORD_FILE)
if os.path.exists(DownloadTest.COLLEGEHUMOR_FILE):
os.remove(DownloadTest.COLLEGEHUMOR_FILE)
+ if os.path.exists(DownloadTest.XNXX_FILE):
+ os.remove(DownloadTest.XNXX_FILE)
def md5_for_file(filename, block_size=2**20):
with open(filename) as f: