URLDecode

Converts https:%2F%2Fexample.com into https://example.com

python · Filters And Transformers

Source

from urllib.parse import unquote

import demistomock as demisto  # noqa: F401
from CommonServerPython import *  # noqa: F401


def main():
    value = demisto.args()["value"]
    processed_value = unquote(value)

    eContext = {"DecodedURL": processed_value}

    entry = {
        "Type": entryTypes["note"],
        "Contents": eContext,
        "ContentsFormat": formats["json"],
        "HumanReadable": processed_value,
        "ReadableContentsFormat": formats["markdown"],
        "EntryContext": eContext,
    }

    demisto.results(entry)


# python2 uses __builtin__ python3 uses builtins
if __name__ == "__builtin__" or __name__ == "builtins":
    main()

README

Converts “https:%2F%2Fexample.com” into “https://example.com”.

Script Data


Name Description
Script Type python
Tags transformer

Inputs


Argument Name Description
value The URL to input.

Outputs


Path Description Type
DecodedURL The parsed URL as a key/value. string