Try this easy tip:
-Pour some brandy or wine into a bottle.
-curve a piece of paper into a cone.
-put the small end of the cone into the bottle.
The flies enter through the cone, but when it comes to exiting the bottle, they have trouble navigating out of the small opening.
I am not sure why it works, but it does.