MCPcopy
hub / github.com/caronc/apprise / parse_url

Method parse_url

apprise/plugins/popcorn_notify.py:301–329  ·  view source on GitHub ↗

Parses the URL and returns enough arguments that can allow us to re- instantiate this object.

(url)

Source from the content-addressed store, hash-verified

299
300 @staticmethod
301 def parse_url(url):
302 """Parses the URL and returns enough arguments that can allow us to re-
303 instantiate this object."""
304
305 results = NotifyBase.parse_url(url, verify_host=False)
306 if not results:
307 # We're done early as we couldn't load the results
308 return results
309
310 # Get our entries; split_path() looks after unquoting content for us
311 # by default
312 results["targets"] = NotifyPopcornNotify.split_path(
313 results["fullpath"]
314 )
315
316 # The hostname is our authentication key
317 results["apikey"] = NotifyPopcornNotify.unquote(results["host"])
318
319 # Support the 'to' variable so that we can support targets this way too
320 # The 'to' makes it easier to use yaml configuration
321 if "to" in results["qsd"] and len(results["qsd"]["to"]):
322 results["targets"] += NotifyPopcornNotify.parse_list(
323 results["qsd"]["to"]
324 )
325
326 # Get Batch Mode Flag
327 results["batch"] = parse_bool(results["qsd"].get("batch", False))
328
329 return results

Callers

nothing calls this directly

Calls 5

parse_boolFunction · 0.85
split_pathMethod · 0.80
unquoteMethod · 0.80
parse_listMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected