mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-07-01 03:22:50 -05:00
[udn] Add new extractor
This commit is contained in:
@ -1711,6 +1711,17 @@ def determine_protocol(info_dict):
|
||||
return compat_urllib_parse_urlparse(url).scheme
|
||||
|
||||
|
||||
def url_infer_protocol(ref_url, target_url):
|
||||
""" Infer protocol for protocol independent target urls """
|
||||
parsed_target_url = list(compat_urllib_parse_urlparse(target_url))
|
||||
if parsed_target_url[0]:
|
||||
return target_url
|
||||
|
||||
parsed_target_url[0] = compat_urllib_parse_urlparse(ref_url).scheme
|
||||
|
||||
return compat_urlparse.urlunparse(parsed_target_url)
|
||||
|
||||
|
||||
def render_table(header_row, data):
|
||||
""" Render a list of rows, each as a list of values """
|
||||
table = [header_row] + data
|
||||
|
Reference in New Issue
Block a user