[ie/dplay] Fix extractors (#10471)
[yt-dlp3.git] / test / test_youtube_misc.py
blob81b116217a31224626f9d0bb156a8fb705a2ed1f
1 #!/usr/bin/env python3
3 # Allow direct execution
4 import os
5 import sys
6 import unittest
8 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
11 from yt_dlp.extractor import YoutubeIE
14 class TestYoutubeMisc(unittest.TestCase):
15 def test_youtube_extract(self):
16 assertExtractId = lambda url, video_id: self.assertEqual(YoutubeIE.extract_id(url), video_id)
17 assertExtractId('http://www.youtube.com/watch?&v=BaW_jenozKc', 'BaW_jenozKc')
18 assertExtractId('https://www.youtube.com/watch?&v=BaW_jenozKc', 'BaW_jenozKc')
19 assertExtractId('https://www.youtube.com/watch?feature=player_embedded&v=BaW_jenozKc', 'BaW_jenozKc')
20 assertExtractId('https://www.youtube.com/watch_popup?v=BaW_jenozKc', 'BaW_jenozKc')
21 assertExtractId('http://www.youtube.com/watch?v=BaW_jenozKcsharePLED17F32AD9753930', 'BaW_jenozKc')
22 assertExtractId('BaW_jenozKc', 'BaW_jenozKc')
25 if __name__ == '__main__':
26 unittest.main()