The Dirty can exclusively reveal Kanye West shut down a musician he claimed was harassing him in a legal battle over “New Slaves” … with a judge siding with the rapper and ordering he will not have to travel to New York to be deposed.

Last year, Gabor Presser sued the rapper and Sony Music for $2.5 million accusing them of illegally sampling his track, “Gyonhyhaju Lany” in Kanye’s hit “New Slaves” … without obtaining permission or paying him a dime. Kanye claimed he had an agreement with Presser to sample the music. He denied any wrongdoing and has been attempting to have the case moved from New York to California. Presser demanded his motion be shut down.

As The Dirty explained yesterday, Presser headed to court and filed a motion to compel Kanye to be deposed in New York … where the rapper will be grilled under oath about the case.

Kanye fired back saying his demand for the deposition to take place in New York is nothing but a dirty legal game … pointing out he offered 2 days next month to take his depo in LA. Kanye says the insistence on New York is pure harassment because he is a celebrity. He says it’s a tactic designed to extract settlement leverage and for no other purpose.

Then earlier today, the judge in the case sided with Kanye and granted his motion by ordering the depo to take place in LA next month. However, it notes if he doesn’t show up she could change her decision and force him to fly to New York to be grilled.