aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@users.noreply.github.com>2021-01-27 20:32:51 +0530
committerGitHub <noreply@github.com>2021-01-27 20:32:51 +0530
commit06167fbbd3c407ab77e2c7f5031d1ec93886946f (patch)
tree092fbe4daafa56205bfe1f5cefd423f84bac3504 /youtube_dlc/utils.py
parent4ff5e98991cc9c78c0233a8e0c2f8b0200fb3e04 (diff)
downloadhypervideo-pre-06167fbbd3c407ab77e2c7f5031d1ec93886946f.tar.lz
hypervideo-pre-06167fbbd3c407ab77e2c7f5031d1ec93886946f.tar.xz
hypervideo-pre-06167fbbd3c407ab77e2c7f5031d1ec93886946f.zip
#31 Features from animelover1984/youtube-dl
* Add `--get-comments` * [youtube] Extract comments * [billibilli] Added BiliBiliSearchIE, BilibiliChannelIE * [billibilli] Extract comments * [billibilli] Better video extraction * Write playlist data to infojson * [FFmpegMetadata] Embed infojson inside the video * [EmbedThumbnail] Try embedding in mp4 using ffprobe and `-disposition` * [EmbedThumbnail] Treat mka like mkv and mov like mp4 * [EmbedThumbnail] Embed in ogg/opus * [VideoRemuxer] Conditionally remux video * [VideoRemuxer] Add `-movflags +faststart` when remuxing from mp4 * [ffmpeg] Print entire stderr in verbose when there is error * [EmbedSubtitle] Warn when embedding ass in mp4 * [avanto] Use NFLTokenGenerator if possible
Diffstat (limited to 'youtube_dlc/utils.py')
-rw-r--r--youtube_dlc/utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dlc/utils.py b/youtube_dlc/utils.py
index 34a14424a..4aaee0b5f 100644
--- a/youtube_dlc/utils.py
+++ b/youtube_dlc/utils.py
@@ -5934,3 +5934,14 @@ def load_plugins(name, type, namespace):
if plugin_info[0] is not None:
plugin_info[0].close()
return classes
+
+
+def traverse_dict(dictn, keys, casesense=True):
+ if not isinstance(dictn, dict):
+ return None
+ first_key = keys[0]
+ if not casesense:
+ dictn = {key.lower(): val for key, val in dictn.items()}
+ first_key = first_key.lower()
+ value = dictn.get(first_key, None)
+ return value if len(keys) < 2 else traverse_dict(value, keys[1:], casesense)