mirror of
https://github.com/l1ving/youtube-dl
synced 2020-11-18 19:53:54 -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
|
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 = [
|
IEs = [
|
||||||
('Youtube', ['YoutubePlaylistIE', 'YoutubeChannelIE',
|
('Youtube', ['YoutubePlaylistIE', 'YoutubeChannelIE',
|
||||||
'YoutubeUserIE', 'YoutubeSearchIE', 'YoutubeIE']),
|
'YoutubeUserIE', 'YoutubeSearchIE', 'YoutubeIE']),
|
||||||
('Generic', ['GenericIE']),
|
'Generic',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
IE_list = []
|
IE_list = []
|
||||||
IE_dict = {}
|
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,
|
_mod = __import__('youtube_dl.InfoExtractors.' + module,
|
||||||
globals(), fromlist=IE_names)
|
globals(), fromlist=IE_names)
|
||||||
|
|
||||||
for IE_name in IE_names:
|
for IE_name in IE_names:
|
||||||
IE = getattr(_mod, IE_name)
|
IE = getattr(_mod, IE_name)
|
||||||
IE_list.append(IE)
|
IE_list.append(IE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user