# Event for skipped Import task

**URL:** <https://discourse.beets.io/t/event-for-skipped-import-task/2211>\
**Category:** Help\
**Created:** [December 7, 2022, 6:51pm UTC](https://discourse.beets.io/t/event-for-skipped-import-task/2211 "2022-12-07T18:51:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jee](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/jee/32/696_2.png) [@Jee](https://discourse.beets.io/u/Jee)\
**Post date:** [December 7, 2022, 6:51pm UTC](https://discourse.beets.io/t/event-for-skipped-import-task/2211/1 "2022-12-07T18:51:33Z")

</div>

Hello,

I’m thinking to use the [Hook Plugin](https://beets.readthedocs.io/en/stable/plugins/hook.html) to send a GET request via a bash script to a web hook endpoint for skipped albums especialy skipped by [none-rec-action](https://beets.readthedocs.io/en/stable/reference/config.html#none-rec-action) .

I don’t find any reference for skipped event in the source code. I’d mainly looked in `importer.py`, i’m really (really) in python so it might be not the right file where to look or it is not even possible…

If you can put in the right direction It would be great.

Thank you  
J.

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [December 7, 2022, 11:55pm UTC](https://discourse.beets.io/t/event-for-skipped-import-task/2211/2 "2022-12-07T23:55:26Z")

</div>

Hi! Give the `import_task_choice` event:  
[https://beets.readthedocs.io/en/stable/dev/plugins.html#listen-for-events](https://beets.readthedocs.io/en/stable/dev/plugins.html#listen-for-events)

It happens right after the importer makes a decision about what to do with an album/item (including to skip it).

---

<div class="post-metadata">

**Author:** ![Jee](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/jee/32/696_2.png) [@Jee](https://discourse.beets.io/u/Jee)\
**Post date:** [December 10, 2022, 9:54am UTC](https://discourse.beets.io/t/event-for-skipped-import-task/2211/3 "2022-12-10T09:54:24Z")

</div>

Hi @adrian Thank you for your answer

It’s not perfect but it’ss work for those who are interested

`config.yml` :

```auto
hook:
  hooks: 
    - event: import_task_choice
      command: /bin/bash -c "/myscripts/skipped.sh \"{task.choice_flag}\" \"{task.paths}\" \"{task.rec}\""

```

`skipped.sh` :

```auto
#!/bin/bash

# arg 1 = task.choice_flag
# arg 2 = task.paths
# arg 3 = task.rec

choice_flag="$1"

# remove "[b'" at the beginning and "']" at the end
path=$(echo "$2" | sed -e "s/^\[b'//" -e "s/'\]$//")

#assign the path and the directory name
base_path=$(basename "$path")
dir_name=$(dirname "$path")

# test the output
echo $path
echo $base_path
echo $dir_name

# send a POST request with curl
if ["$choice_flag" == 'action.SKIP']; then
  curl \
    --request POST \
    --data-urlencode "name=$base_path" \
    --data-urlencode "path=$dir_name" \
    --header "X-API-Key: $api_key" \
    "https://example.com"
fi

exit 0

```

i haven’t find how to get imported album’s path properly or a way to print all `task.*` possibilities
