mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-05 00:33:06 +08:00
Accept simple strings in IEs
This commit is contained in:
parent
238d0b87ba
commit
5a5f27e7a2
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user