]> jfr.im git - yt-dlp.git/blame - test/test_youtube_misc.py
[compat] Remove more functions
[yt-dlp.git] / test / test_youtube_misc.py
CommitLineData
cc52de43 1#!/usr/bin/env python3
1bdae7d3 2# Allow direct execution
3import os
4import sys
5import unittest
f8271158 6
1bdae7d3 7sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
8
9
10from yt_dlp.extractor import YoutubeIE
11
12
13class TestYoutubeMisc(unittest.TestCase):
14 def test_youtube_extract(self):
15 assertExtractId = lambda url, id: self.assertEqual(YoutubeIE.extract_id(url), id)
16 assertExtractId('http://www.youtube.com/watch?&v=BaW_jenozKc', 'BaW_jenozKc')
17 assertExtractId('https://www.youtube.com/watch?&v=BaW_jenozKc', 'BaW_jenozKc')
18 assertExtractId('https://www.youtube.com/watch?feature=player_embedded&v=BaW_jenozKc', 'BaW_jenozKc')
19 assertExtractId('https://www.youtube.com/watch_popup?v=BaW_jenozKc', 'BaW_jenozKc')
20 assertExtractId('http://www.youtube.com/watch?v=BaW_jenozKcsharePLED17F32AD9753930', 'BaW_jenozKc')
21 assertExtractId('BaW_jenozKc', 'BaW_jenozKc')
22
23
24if __name__ == '__main__':
25 unittest.main()