A federal judge on Thursday issued an injunction to block Redbox from selling digital download codes of Disney films.

The ruling was a win for Disney, which has been trying to block the kiosk rental company from selling the codes since December. Redbox began selling the codes last fall at a considerable discount compared to prices on Amazon or iTunes. The company obtained the codes by buying DVD combo packs, which include DVD and Blu-ray discs as well as download codes, and then splitting them up and selling them separately.

Disney argued that Redbox was engaging in copyright infringement by encouraging its customers to make an unauthorized copy of its films. Redbox countered that Disney lost control of the digital copy of the film once it sold the combo pack, and Redbox was free to re-sell it, just as it does with the physical discs.

Disney’s first attempt to shut down the service failed in February. Judge Dean Pregerson ruled that the warning on the combo packs, indicating that “codes are not for sale or transfer,” was not explicit enough to prohibit Redbox from reselling the codes. Disney then rewrote the language for the release of “Black Panther.” The new language is much more detailed, and asserts that Disney owns the digital copy and licenses it only to the buyer of the combo pack. Disney then filed a second request for an injunction.