diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-09-08 17:20:02 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-09-08 17:20:02 -0700 |
commit | fb1a3531c59f5d9cee406295bbe006730695c249 (patch) | |
tree | 90423096184d7632b6271dfe3ca6375198bf8d8c /youtube/util.py | |
parent | 1b6fb4e100a2aed8c9c391e100fbbe60ac74d352 (diff) | |
download | yt-local-fb1a3531c59f5d9cee406295bbe006730695c249.tar.lz yt-local-fb1a3531c59f5d9cee406295bbe006730695c249.tar.xz yt-local-fb1a3531c59f5d9cee406295bbe006730695c249.zip |
Extraction: Fix url prefixing
Diffstat (limited to 'youtube/util.py')
-rw-r--r-- | youtube/util.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube/util.py b/youtube/util.py index 2205645..a81ae83 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -317,3 +317,7 @@ def uppercase_escape(s): return re.sub( r'\\U([0-9a-fA-F]{8})', lambda m: chr(int(m.group(1), base=16)), s) + +def prefix_url(url): + url = url.lstrip('/') # some urls have // before them, which has a special meaning + return '/' + url |