]> jfr.im git - yt-dlp.git/blame - devscripts/lazy_load_template.py
[cleanup] Point all shebang to `python3` (#372)
[yt-dlp.git] / devscripts / lazy_load_template.py
CommitLineData
cc52de43 1#!/usr/bin/env python3
dcdb292f 2# coding: utf-8
779822d9
JMF
3from __future__ import unicode_literals
4
5import re
6
7
8class LazyLoadExtractor(object):
9 _module = None
10
11 @classmethod
12 def ie_key(cls):
13 return cls.__name__[:-2]
14
8a5dc1c1 15 def __new__(cls, *args, **kwargs):
779822d9
JMF
16 mod = __import__(cls._module, fromlist=(cls.__name__,))
17 real_cls = getattr(mod, cls.__name__)
8a5dc1c1
JMF
18 instance = real_cls.__new__(real_cls)
19 instance.__init__(*args, **kwargs)
20 return instance