]> jfr.im git - yt-dlp.git/blame - devscripts/lazy_load_template.py
[thisoldhouse] Add new extractor(closes #10837)
[yt-dlp.git] / devscripts / lazy_load_template.py
CommitLineData
0d778b1d 1# encoding: utf-8
779822d9
JMF
2from __future__ import unicode_literals
3
4import re
5
6
7class LazyLoadExtractor(object):
8 _module = None
9
10 @classmethod
11 def ie_key(cls):
12 return cls.__name__[:-2]
13
8a5dc1c1 14 def __new__(cls, *args, **kwargs):
779822d9
JMF
15 mod = __import__(cls._module, fromlist=(cls.__name__,))
16 real_cls = getattr(mod, cls.__name__)
8a5dc1c1
JMF
17 instance = real_cls.__new__(real_cls)
18 instance.__init__(*args, **kwargs)
19 return instance