Browse Source

Create a function in InfoExtractors that returns the InfoExtractor class with the given name

rtmp_test
Jaime Marquínez Ferrándiz 12 years ago
parent
commit
9341212642
2 changed files with 5 additions and 1 deletions
  1. +1
    -1
      test/test_download.py
  2. +4
    -0
      youtube_dl/InfoExtractors.py

+ 1
- 1
test/test_download.py View File

@ -67,7 +67,7 @@ class TestDownload(unittest.TestCase):
def generator(test_case):
def test_template(self):
ie = getattr(youtube_dl.InfoExtractors, test_case['name'] + 'IE')
ie = youtube_dl.InfoExtractors.get_info_extractor(test_case['name'])#getattr(youtube_dl.InfoExtractors, test_case['name'] + 'IE')
if not ie._WORKING:
print('Skipping: IE marked as not _WORKING')
return


+ 4
- 0
youtube_dl/InfoExtractors.py View File

@ -4469,3 +4469,7 @@ def gen_extractors():
ARDIE(),
GenericIE()
]
def get_info_extractor(ie_name):
"""Returns the info extractor class with the given ie_name"""
return globals()[ie_name+'IE']

Loading…
Cancel
Save