]> jfr.im git - yt-dlp.git/blame - test/test_youtube_misc.py
[ie/TubiTv] Fix extractor (#9975)
[yt-dlp.git] / test / test_youtube_misc.py
CommitLineData
cc52de43 1#!/usr/bin/env python3
54007a45 2
1bdae7d3 3# Allow direct execution
4import os
5import sys
6import unittest
f8271158 7
1bdae7d3 8sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
9
10
11from yt_dlp.extractor import YoutubeIE
12
13
14class TestYoutubeMisc(unittest.TestCase):
15 def test_youtube_extract(self):
16 assertExtractId = lambda url, id: self.assertEqual(YoutubeIE.extract_id(url), 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')
23
24
25if __name__ == '__main__':
26 unittest.main()