If the enemy of your enemy is your friend, as the old saying goes, then vaunted rivals Netflix (NFLX -0.62%) and HBO parent Time Warner (TWX) may be well on their way to becoming BFF's.

Both companies seem poised to prosper from the "cord-cutting revolution," but online video piracy increasingly seems to be the one potential threat standing in their way. Netflix CEO Reed Hastings has deflected concerns about competition from HBO and other premium services, saying instead that piracy is the company's biggest long-term threat. After years of ignoring piracy, HBO now seems to be confronting illegal streaming head-on, too.

In the music industry, piracy and other changes have caused recorded music sales to drop by half over the last 15 years in the U.S, showing the seriousness of this threat. Hollywood execs as well as those at HBO and Netflix are well aware that illegal websites can undermine, if not destroy, their business models. Let's take a look at what each one is doing about it. 

Game of Thrones
The Season 5 premier of HBO's hit fantasy show Game of Thrones set a new record as the most pirated show of all-time. The episode, "The Wars To Come," was illegally downloaded 13 million times, despite efforts by HBO to prevent such piracy.

In order to discourage piracy, HBO chose to air the premier on the same day around the world, deviating from the historical pattern where some countries would air the show months after the U.S. HBO also launched its stand-alone HBO Now streaming service -- which allows consumers to subscribe to HBO without a larger cable package -- in response to the complaints of pirates who justified illegally downloading because such a service was not available.

Source: Game of Thrones Twitter Page

Those tactics did not yield the desired results, though. According to one estimate, 32 million people downloaded Game of Thrones episodes illegally during the show's premier week, and the show's first four episodes were even illegally uploaded to BitTorrent by someone with exclusive access to the DVD screener meant for critics and insiders.

Meanwhile, HBO has taken the unorthodox move of sending cease-and-desist letters to bars that screen the show publicly, and the company has even tracked the IP addresses of those who downloaded the leaked episodes of the new season and sent similarly threatening letters. 

The moves seem to indicate that HBO is getting serious about fighting back against piracy, a reversal for a company that had said last year that rampant piracy had not affected DVD sales, and called the illegal downloads a "compliment."

If you can't beat 'em, discount 'em
Netflix has taken a different tack from HBO's confrontational moves. The leading Internet TV provider says it sets prices in foreign countries according to piracy levels. CFO David Wells explained, "Piracy is a governor in terms of our price in high piracy markets outside the US. We wouldn't want to come out with a high price because there's a lot of piracy, so we have to compete with that."

That strategy seems to reflect acceptance that the piracy threat is here to stay, but it also may be the best tactic for a company that already charges low prices, starting at $8/month in the U.S. 

Netflix has also been creative with its approach to piracy by using it for data mining. The company will track pirating sites, and target popular shows for its own content library in an attempt to convert pirates into Netflix customers. The company has also seen dramatic declines in traffic on BitTorrent, a popular file-sharing platform, once it enters new markets. In Canada, for instance, the company said BitTorrent traffic had fallen by half in the three years after it launched there.

Netflix's growth rate is maybe the best indication that it's winning the war against piracy as its subscriber base is growing by more than 25% annually around the globe and continues to increase at a steady clip in the U.S.

Improved pirating sites like Popcorn Time may present a greater challenge to Netflix and HBO. However, the networks should be able to continue building viewership by offering content that people want to watch and a superior viewing experience -- which is not hard compared to piracy sites.

With the HBO Now service still in its infancy and only being offered through Apple products and in the U.S., HBO may have a way to go before satisfying that demand. Netflix, meanwhile, seems to have demonstrated that it's the preferred option when it's available. To ensure its continued leadership, Netflix just needs to complete its global rollout.