Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
result = SplitResult(
scheme,
netloc.lower(),
path,
query,
fragment
)
if not unsplit:
return result
# TODO: check if works with `unsplit=False`
if strip_protocol or not has_protocol:
result = urlunsplit(result)[2:]
else:
result = urlunsplit(result)
return result
# Result
result = SplitResult(
scheme,
netloc.lower(),
path,
query,
fragment
)
if not unsplit:
return result
# TODO: check if works with `unsplit=False`
if strip_protocol or not has_protocol:
result = urlunsplit(result)[2:]
else:
result = urlunsplit(result)
return result
scheme, netloc, path, query, fragment = urlsplit(safe_url)
if 'facebook' not in netloc:
raise Exception('ural.facebook.convert_facebook_url_to_mobile: %s is not a facebook url' % url)
netloc = re.sub(MOBILE_REPLACE_RE, 'm.facebook.', netloc)
result = (
scheme,
netloc,
path,
query,
fragment
)
result = urlunsplit(result)
if not has_protocol:
result = result.split('://', 1)[-1]
return result
t = stems_index.get('t')
if t is not None:
netloc += ':' + t
p = stems_index.get('p')
path = ''
if p is not None:
path = '/' + p
query = stems_index.get('q', '')
fragment = stems_index.get('f', '')
return urlunsplit((scheme, netloc, path, query, fragment))