Vilvoorde, Belgium — Lily Collins, dressed in a mud-colored linen shift, tried to hide the small piece of jewelry she had crafted, as a hatchet-faced factory supervisor approached.

The camera moved in for a close-up of her pale, anxious face. “Sorry, Lily, just one more time,” said Tom Shankland, the director of the new adaptation of “Les Misérables,” a coproduction with BBC and PBS’s Masterpiece. “Listen, my deathbed scene was on Day 2,” said Ms. Collins, who was playing the ill-fated Fantine. “It’s all uphill at this point.”

There is not much that’s looking up for any character in Victor Hugo’s epic 1862 novel “Les Misérables,” which has provided the subject matter for dozens of theater, television and film adaptations, most famously the blockbuster musical that zillions of fans affectionately call “Les Miz.”

But this six-part television adaptation, which first aired in Britain from December to February and arrives on Masterpiece on Sunday, might come as a surprise to those who only know the musical. This version hews much more closely to Hugo’s book, a five-volume, 365-chapter novel that over the course of its complex plot explores history, law, politics, religion and ideas about justice, guilt and redemption. Set in a grimly realist France, its abundant starving poor and oppressed are entirely disconnected from the wealthy classes. (The aptly dreary set here, in a dilapidated, gloomy former prison, might as well have sported a sign saying “Likely to Perish Within.”)