is there any hooks or action to fire function of insert into post in media library?

The hook is media_send_to_editor.

From the source of core.

apply_filters (
    'media_send_to_editor',      
    string $html,
    int $send_id, 
    array $attachment

 )

Filter the HTML markup for a media item sent to the editor.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)