diff --git a/youtube_dl/InfoExtractors/__init__.py b/youtube_dl/InfoExtractors/__init__.py index d84e37e8a..1e0d49b10 100755 --- a/youtube_dl/InfoExtractors/__init__.py +++ b/youtube_dl/InfoExtractors/__init__.py @@ -3,19 +3,30 @@ from __future__ import absolute_import - +""" +List here the InfoExtractors. +The order matter! URLs will be handled by the first IE to match. +List either the name of the file, like 'Foo', containing 'FooIE' or +a tuple like (FILENAME, [IE_name, IE_name, ...]) +""" IEs = [ ('Youtube', ['YoutubePlaylistIE', 'YoutubeChannelIE', 'YoutubeUserIE', 'YoutubeSearchIE', 'YoutubeIE']), - ('Generic', ['GenericIE']), + 'Generic', ] IE_list = [] IE_dict = {} -for module, IE_names in IEs: +for entry in IEs: + if type(entry) == type(''): + module, IE_names = entry, [entry + 'IE'] + else: + module, IE_names = entry + _mod = __import__('youtube_dl.InfoExtractors.' + module, globals(), fromlist=IE_names) + for IE_name in IE_names: IE = getattr(_mod, IE_name) IE_list.append(IE)