示例#1
0
 def run(self, params={}):
     url = params.get(Input.URL)
     try:
         results = decode_url(url)
         return {Output.RESULT: results}
     except Exception as e:
         self.logger.debug(e)
         raise Exception(
             f"Error: Unable to decode the Microsoft Safe Link. "
             f"Check that the input was a valid Safe Link URL. "
             f"If the problem persists, please contact support.")
示例#2
0
 def run(self, params={}):
     url = params.get(Input.URL)
     try:
         results = decode_url(url)
         if results:
             return {Output.RESULT: results,  Output.DECODED: results!=url}
         return {Output.RESULT: results!=url}
     except Exception as e:
         return {Output.RESULT: url, Output.DECODED: False}
         self.logger.debug(e)
         raise PluginException(cause=f"Error: Unable to decode the Microsoft Safe Link.",
                               assistance="Check that the input was a valid Safe Link URL. \
                               If the problem persists, please contact support.")