def action_download(params):
    plugintools.log("dandb.action_download "+repr(params))

    icon = os.path.join( plugintools.get_runtime_path() , "icon.png" )
    filename = plugintools.get_filename_from_url(params.get("file_url"))
    full_path_filename = os.path.join( plugintools.get_data_path() , filename )
    plugintools.download(params.get("file_url"),full_path_filename)

    plugintools.show_notification("D&B TV","File "+filename+"downloaded",icon)
def action_download_and_execute(params):
    plugintools.log("dandb.action_download_and_execute "+repr(params))

    icon = os.path.join( plugintools.get_runtime_path() , "icon.png" )

    # Download file
    filename = plugintools.get_filename_from_url(params.get("file_url"))
    full_path_filename = os.path.join( plugintools.get_data_path() , filename )
    plugintools.download(params.get("file_url"),full_path_filename)
    plugintools.show_notification("D&B TV","File "+filename+"downloaded",icon)

    # Replace filename
    command = params.get("command")
    plugintools.log("dandb.action_download_and_execute command="+command)
    command = command.replace("$1",full_path_filename)
    plugintools.log("dandb.action_download_and_execute command="+command)

    # Execute command
    params["command"] = command
    action_execute(params)