]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/youtube.py
[utils] Add `get_first`
[yt-dlp.git] / yt_dlp / extractor / youtube.py
index da49df8cd72ae075019b1c97cb4ba1b2c18d1731..66bb8d9f07f99efe192ca9f193f6b22dd18fb364 100644 (file)
@@ -39,6 +39,7 @@
     ExtractorError,
     float_or_none,
     format_field,
+    get_first,
     int_or_none,
     is_html,
     join_nonempty,
 )
 
 
-def get_first(obj, keys, **kwargs):
-    return traverse_obj(obj, (..., *variadic(keys)), **kwargs, get_all=False)
-
-
 # any clients starting with _ cannot be explicity requested by the user
 INNERTUBE_CLIENTS = {
     'web': {