diff --git a/README.md b/README.md index 772395d24d..5808924316 100644 --- a/README.md +++ b/README.md @@ -302,6 +302,7 @@ If you fork the project on GitHub, you can run your fork's [build workflow](.git error occurs (Alias: --no-ignore-errors) --dump-user-agent Display the current user-agent and exit --list-extractors List all supported extractors and exit + --list-extractors-json List all supported extractors in json and exit --extractor-descriptions Output descriptions of all supported extractors and exit --use-extractors NAMES Extractor names to use separated by commas. @@ -1875,7 +1876,21 @@ The following extractors use this feature: +# EXTRACTOR INFO JSON +parameter `--list-extractors-json` output information from extractor(s) formated as JSON. If some URL(s) are specified, only the extractors matching at list one URL are listed. If none is specified, all extractors are listed. The generic extractor is always the last in the list. +### List of values returned +key | type | description +:------------|:----------------|:---------------------------- +index | int | index in list, starting from 0 +name | string | name of the extractor +desc | string | description of the extractor +working | bool | true if the extractor is working +enabled | bool | true if the extractor is enabled +return_type | string | type of data returned by the extractor ("video", "playlist", "any", or None) +regex_urls | array of string | list of regex used by the extractor to match a given url +matched_urls | array of string | list of url(s) passed in the command line that matched the given extractor. Present only if URL(s) are specified. + # PLUGINS Note that **all** plugins are imported even if not invoked, and that **there are no checks** performed on plugin code. **Use plugins at your own risk and only if you trust the code!** diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index 31fa1d7b54..87f6faea39 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -140,7 +140,7 @@ def print_extractor_information(opts, urls): 'working': ie.working(), 'enabled': ie.is_enabled(), 'return_type': ie.return_type(), - 'regex_url': ie.list_regex_url(), + 'regex_urls': ie.list_regex_url(), 'matched_urls': matched_urls, } e_index += 1 @@ -154,7 +154,7 @@ def print_extractor_information(opts, urls): 'working': ie.working(), 'enabled': ie.is_enabled(), 'return_type': ie.return_type(), - 'regex_url': ie.list_regex_url(), + 'regex_urls': ie.list_regex_url(), } dicts.append(data) e_index += 1