aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/YoutubeDL.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-06-08 00:20:06 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-06-08 00:20:06 +0530
commitbd99f6e64834ac8e1304619d469183ef65c20d39 (patch)
tree52fee39a30839d756cb611eb2f96386ff5b94425 /yt_dlp/YoutubeDL.py
parentecb5419149d8f730c6707a356a3d1f45ce210aa5 (diff)
downloadhypervideo-pre-bd99f6e64834ac8e1304619d469183ef65c20d39.tar.lz
hypervideo-pre-bd99f6e64834ac8e1304619d469183ef65c20d39.tar.xz
hypervideo-pre-bd99f6e64834ac8e1304619d469183ef65c20d39.zip
Add field `original_url` with the user-inputted URL
So that they can be processed by `--parse-metadata` for example `webpage_url` is the same, but may be modified by the extractor
Diffstat (limited to 'yt_dlp/YoutubeDL.py')
-rw-r--r--yt_dlp/YoutubeDL.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 1298134b6..2997b19ca 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -1144,6 +1144,7 @@ class YoutubeDL(object):
self.add_extra_info(ie_result, {
'extractor': ie.IE_NAME,
'webpage_url': url,
+ 'original_url': url,
'webpage_url_basename': url_basename(url),
'extractor_key': ie.ie_key(),
})
@@ -2763,7 +2764,7 @@ class YoutubeDL(object):
remove_keys = ['__original_infodict'] # Always remove this since this may contain a copy of the entire dict
keep_keys = ['_type'], # Always keep this to facilitate load-info-json
if actually_filter:
- remove_keys += ('requested_formats', 'requested_subtitles', 'requested_entries', 'filepath', 'entries')
+ remove_keys += ('requested_formats', 'requested_subtitles', 'requested_entries', 'filepath', 'entries', 'original_url')
empty_values = (None, {}, [], set(), tuple())
reject = lambda k, v: k not in keep_keys and (
k.startswith('_') or k in remove_keys or v in empty_values)