From edb1ec29858255f29da9aad12e143e59dc68193c Mon Sep 17 00:00:00 2001 From: Breno Lipi Date: Thu, 11 Mar 2021 01:53:55 -0300 Subject: [PATCH] Added more tests --- youtube_dl/extractor/captiongenerator.py | 34 ++++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/captiongenerator.py b/youtube_dl/extractor/captiongenerator.py index ee9de335f..5e5f3f107 100644 --- a/youtube_dl/extractor/captiongenerator.py +++ b/youtube_dl/extractor/captiongenerator.py @@ -6,15 +6,39 @@ from .common import InfoExtractor class CaptionGeneratorIE(InfoExtractor): _VALID_URL = r'(?:https?://(?:www\.)?captiongenerator\.com/(?P[0-9]+))' - _TEST = { - 'url': 'https://d34ov3vwfhhb30.cloudfront.net/Hitler+Reacts+-+No+Subtitles.mp4', + _TESTS = [{ + 'url': 'https://www.captiongenerator.com/128/Team-building', 'info_dict': { 'id': '128', 'ext': 'mp4', 'title': 'Team building...', - 'http_headers': 'Referer: https://www.captiongenerator.com/' - } - } + 'http_headers': {'Referer': 'https://www.captiongenerator.com/'} + }, + }, { + 'url': 'https://www.captiongenerator.com/2153287/Man-finds-phone', + 'info_dict': { + 'id': '2153287', + 'ext': 'mp4', + 'title': 'Man finds phone', + 'http_headers': {'Referer': 'https://www.captiongenerator.com/'} + }, + }, { + 'url': 'https://www.captiongenerator.com/2140517/Haavisto-Pietarissa', + 'info_dict': { + 'id': '2140517', + 'ext': 'mp4', + 'title': 'Haavisto Pietarissa', + 'http_headers': {'Referer': 'https://www.captiongenerator.com/'} + }, + }, { + 'url': 'https://www.captiongenerator.com/2153147/81-Pay', + 'info_dict': { + 'id': '2153147', + 'ext': 'mp4', + 'title': '81 Pay', + 'http_headers': {'Referer': 'https://www.captiongenerator.com/'} + }, + }] def _real_extract(self, url): video_id = self._match_id(url)