aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-02-04 12:01:13 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-02-04 12:02:01 +0530
commit84bbc54599d7669cc8a08a9f4251bb60ec419b53 (patch)
tree9237a5f77c41bf9f50d9b1e7c4ae49debcb4b3fa
parent1e5d87beee7683cbb75d12f8e52bddce5c5b7717 (diff)
downloadhypervideo-pre-84bbc54599d7669cc8a08a9f4251bb60ec419b53.tar.lz
hypervideo-pre-84bbc54599d7669cc8a08a9f4251bb60ec419b53.tar.xz
hypervideo-pre-84bbc54599d7669cc8a08a9f4251bb60ec419b53.zip
[youtube:search] Add tests
-rw-r--r--yt_dlp/extractor/youtube.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index 3c2d3347f..61804e2af 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -5311,7 +5311,14 @@ class YoutubeSearchIE(YoutubeTabBaseInfoExtractor, SearchInfoExtractor):
IE_NAME = 'youtube:search'
_SEARCH_KEY = 'ytsearch'
_SEARCH_PARAMS = 'EgIQAQ%3D%3D' # Videos only
- _TESTS = []
+ _TESTS = [{
+ 'url': 'ytsearch5:youtube-dl test video',
+ 'playlist_count': 5,
+ 'info_dict': {
+ 'id': 'youtube-dl test video',
+ 'title': 'youtube-dl test video',
+ }
+ }]
class YoutubeSearchDateIE(YoutubeTabBaseInfoExtractor, SearchInfoExtractor):
@@ -5319,7 +5326,14 @@ class YoutubeSearchDateIE(YoutubeTabBaseInfoExtractor, SearchInfoExtractor):
_SEARCH_KEY = 'ytsearchdate'
IE_DESC = 'YouTube search, newest videos first'
_SEARCH_PARAMS = 'CAISAhAB' # Videos only, sorted by date
- _TESTS = []
+ _TESTS = [{
+ 'url': 'ytsearchdate5:youtube-dl test video',
+ 'playlist_count': 5,
+ 'info_dict': {
+ 'id': 'youtube-dl test video',
+ 'title': 'youtube-dl test video',
+ }
+ }]
class YoutubeSearchURLIE(YoutubeTabBaseInfoExtractor):