Reply - Raw
This is a reply to WHtn7xK9
Replies:
#!/usr/bin/env python
#
# Usage: ./export.py > out.json
#

import json
import sys

import youtube_dl.extractor.extractors as es


def getRE():
    res = {}
    for en in [x for x in dir(es) if x.endswith("IE")]:
        cl = getattr(es, en)
        try:
            res[en[:-2]] = cl._VALID_URL
        except:
            sys.stderr.write("[WARNING] No _VALID_URL for {}.\n".format(en))
    return res


if __name__ == "__main__":
    json.dump(getRE(), sys.stdout, indent=4)