]> jfr.im git - yt-dlp.git/blame_incremental - devscripts/lazy_load_template.py
[cleanup] Point all shebang to `python3` (#372)
[yt-dlp.git] / devscripts / lazy_load_template.py
... / ...
CommitLineData
1#!/usr/bin/env python3
2# coding: utf-8
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
15 def __new__(cls, *args, **kwargs):
16 mod = __import__(cls._module, fromlist=(cls.__name__,))
17 real_cls = getattr(mod, cls.__name__)
18 instance = real_cls.__new__(real_cls)
19 instance.__init__(*args, **kwargs)
20 return instance