]> jfr.im git - yt-dlp.git/blob - devscripts/lazy_load_template.py
c4e5fc1f40e72f987ddedd5c91d3367a8692150c
[yt-dlp.git] / devscripts / lazy_load_template.py
1 # coding: utf-8
2 from __future__ import unicode_literals
3
4 import re
5
6
7 class LazyLoadExtractor(object):
8 _module = None
9
10 @classmethod
11 def ie_key(cls):
12 return cls.__name__[:-2]
13
14 def __new__(cls, *args, **kwargs):
15 mod = __import__(cls._module, fromlist=(cls.__name__,))
16 real_cls = getattr(mod, cls.__name__)
17 instance = real_cls.__new__(real_cls)
18 instance.__init__(*args, **kwargs)
19 return instance