Catalysis of the endonucleolytic cleavage immediately 5' to pyrimidine dimers to products with 5'-phosphate.