youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit 93412126422b1324e920dc5097ee57c3ad11371b
parent f7a9721e16139ba3e7bce76d04c3b43ff932f698
Author: Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Date:   Sat, 20 Apr 2013 12:42:57 +0200

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

Diffstat:
Mtest/test_download.py | 2+-
Myoutube_dl/InfoExtractors.py | 4++++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/test_download.py b/test/test_download.py @@ -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 diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py @@ -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']