Oh no, poor hamster! Try to get into a vet by tomorrow.
I think it could be one of the following, but I'm not a vet
Hamsters can suffer from bladder or kidney infections. The most common symptoms are excessive urinating, blood in the urine and excessive drinking. Other symptoms may include squealing when urinating and listlessness.
A hamster with a bladder or kidney infection will require antibiotic treatment by a vet to cure the infection and will need to be kept warm.
Hamsters that are fed a poor quality diet or a diet high in fat content are more susceptible to developing bladder infections as this causes the urine to become more alkaline.
Hamsters that are suffering a bladder/kidney infection could get the following. Aspergillis Fungus develops in the area of the cage where the hamster urinates. The fungus then grows on the urine patches in the cage and releases spores which then affect the hamster. The fungus can be seen as white and then black in colour in the area where the hamster urinates. Once affected by the fungus spores the hamster becomes lethargic, has difficulty breathing and may have itchy or inflamed skin and sometimes chronic diarrhoea.
I've also heard that they can get gallstones. Either way get your hamster to the vet as it will most likely need antibiotics. I wish you and the hamster the best of luck