The website of China's biggest internet video company, Youku Tudou, was once a haven for illicit Hollywood blockbusters and hit South Korean soap operas - until it realised that piracy doesn't pay.
Now the company that controls almost a third of China's booming online video market forks over more than a billion yuan (HK$1.27 billion) a year on licences so it can legally distribute movies and shows such as The Walking Dead. It's a strategy that is now expected to buoy the company to its first-ever quarterly net profit.
To protect this market share, Youku Tudou employs a dozen sleuths who scour the web for pirated content, highlighting how China's online video industry is courting higher advertising revenues and better relations with foreign media firms by cracking down on illegal content.
"The biggest challenge is that there are more new ways to pirate video as the technology develops," says Lu Changjun, the head of Youku Tudou's internet police squad.
In the past, China's video websites were rife with pirated films and TV programmes, often added by users.
Youku Tudou and Baidu and rivals Sohu.com  and Tencent , all say they are fighting piracy. Better technology has now helped these firms police their sites more vigilantly.
A slew of lawsuits filed in November underscores how the industry has changed.
As faster mobile internet becomes the norm in China, viewers tastes are changing the market for piracy. Why hunt for poor-resolution versions when they can endure some online video advertising to see higher-quality, easy-to-find legal content?
"At the end of the day piracy is going away in China," says Michael Clendenin, managing director of technology consultancy RedTech Advisors.
China has long had a reputation for weak intellectual property protections and enforcement, leading to numerous disputes with the United States.
Both Youku Tudou and rival Baidu, China's search engine giant with the second largest market share for online video, say that they didn't deliberately ignore pirated material on their websites and never wilfully upload unlicensed content. Tencent Holdings, which runs China's fourth-largest online video site, says it never ignored or engaged in piracy.
All three companies, however, say they have lost copyright infringement lawsuits filed by other Chinese firms.
Advertisers willing to put money on lawful content and the popularity of online video have provided incentives. China's online video market is expected to grow by more than a third this year and see annual revenues of 12.3 billion yuan, according to data from the Beijing-based internet research firm iResearch.
Piracy leaves companies open to costly lawsuits and also eats into viewer numbers and advertising revenues. It also hurts the sales of foreign entertainment production firms.
"We pay so much money to buy content," says Charles Zhang, chief executive of Sohu.com  China's third largest online video provider. "If piracy continues we won't be able to survive. We bleed and lose money."
The lawsuits filed in November underscore how the industry has changed.
Last month, Youku Tudou, Tencent, Sohu.com  and Chinese conglomerate Dalian Wanda group joined forces with the Motion Picture Association of America to sue Baidu and smaller internet video software-maker QVOD in a lawsuit seeking 300 million yuan in damages for copyright violation.
Baidu, in a statement says, it "deeply regrets the sensationalistic litigiousness".
"At present, we've already agreed to work together with many copyright holders, and together provide better resources for legal high-definition video for our users," the statement says.
A QVOD spokeswoman has said previously that the company did not provide content. "We are just a video player," she said, while declining to elaborate on piracy allegations.
Clendenin, of RedTech Advisors, says the lawsuits would help Chinese online video firms gain more clout with foreign media providers as it showed how serious they are about piracy.
"In the future they need to be able to licence content and be able to say they take a strong stand against piracy," he says.
According to Youku Tudou, about a quarter of the 20,000 links it finds each week that lead to pirated content on Android systems are on Baidu's portals.
The company's internet police chief Lu says the number of illegal links has dropped to one-fifth since the lawsuits were announced, but analysts note that there are plenty of other portals in China that host links to pirated content.
Baidu and QVOD pose a different challenge to their rivals because of their dominance on mobile internet, which is fast becoming the preferred web portal for Chinese audiences.
More than three-quarters of China's internet users access the web through smartphones and tablets, according to the State Internet Information Office. Controlling the routes from a home page to content, like Baidu and QVOD do, is key to grabbing an audience.
Baidu says it's the default search provider on more than 80 per cent of Android handsets shipped to retailers in China, the world's biggest mobile phone market by sales.
QVOD's Kuaibo video app accounted for almost one-quarter of all video content app downloads in the past four months, nearly matching the total for the Youku Tudou and Baidu video apps combined, according to data from Wandoujia, China's second biggest Android app store by monthly active users.
The app lets users pull content from websites onto their phones and tablets, stripping away the ads in the process.
"Consumers spend more and more time watching videos on mobile devices, mobile phones and tablets," says Xiaofeng Wang, a Beijing-based analyst at Forrester Research.
Clearly faster mobile connections are helping to end piracy.
"There's no use going to the DVD store on the corner. You can get it online," says Clendenin. "The online video industry has just been happy it's moved to this point and user habits are changing very quickly."