AT LEAST two music shops were looted during the riots that swept Britain earlier this month. In north London, a warehouse containing CDs and DVDs was set on fire. This was devastating for shopkeepers and local residents. But the British media industry may note, cheerily, that its products are still seen as valuable enough to risk a prison sentence. In many countries it is hard to conceive of looters stealing music or films from a store. In a few, it is difficult to imagine that a warehouse filled with recorded music would even exist.

Since 2000, when the file-sharing service Napster first became popular, digital piracy has dogged the media industry. Over time piracy has become more diverse and sophisticated. In some countries, rather than swapping files on peer-to-peer networks, people now stash their loot in private “cyber-lockers”. As broadband speeds have increased, pirates have gone from downloading single songs to grabbing artists' entire catalogues. Watching pirated television shows and films online has become more popular, too.

Yet piracy has not exactly swept the world. It is endemic in some countries but a niche activity in others. In some places the tide is flowing; in others it appears to be ebbing. In response, media firms are moving their resources from country to country, with potentially large consequences for the global flow of popular culture.

Media piracy is more common in the developing world than in the rich world (see chart). The most piratical countries are places like China, Nigeria and Russia, where virtually all media that is not downloaded illegally is sold in the form of knock-off CDs and DVDs. But there is also great variation among rich countries. Piracy is far more widespread in the Mediterranean than it is in northern Europe, including Britain. America may be the least piratical country of all—oddly, since Napster was born there.

One reason is cost. A recent study for America's Social Science Research Council found that DVDs of “The Dark Knight”, a Warner Bros blockbuster, were selling in Russia for the equivalent of $75 (if adjusted to take account of differences in GDP per head). In India the DVD was on sale for the equivalent of $663. Legal differences are another reason. In Germany it is easy to fine somebody for downloading music illegally; in Spain it is almost impossible. A final cause, the most intangible but probably the most powerful, is culture. In some countries copying is broadly regarded as theft; in others it is not. Media companies care less about the causes than about the consequences. Consider Spain, which is western Europe's leader in piracy. Last year IDC, a research firm, found that 92% of 16- to 24-year-old internet users (and fully 70% of 45- to 55-year-olds) in Spain admitted to using peer-to-peer networks. Music sales have collapsed. In 2010 barely 10m CDs were sold in the country—down from 71m in 2001. Digital sales are puny, too. “You can have a number-one album in Spain with 3,000 sales,” notes David Kassler, who manages EMI's operations in Europe. The result is that big labels have pruned their Spanish operations. Universal Music has shed a third of its Spanish staff. Max Hole, who runs Universal's businesses outside America, says the firm is “holding out” in Spain, but largely in the hope that it will discover an artist who appeals to Hispanics in the United States. Mr Kassler says EMI is spending five or six times as much in Germany, a low-piracy market where music sales are declining more gently—by 11% between 2006 and 2010. DVD sales have collapsed in Spain, too. Xavier Marchand of Alliance Films, an independent movie outfit, says that Spain has become a “1950s market” where almost all the money is made from cinema showings and broadcast-TV rights. Jeff Blake, vice-chairman of Sony Pictures, says it still makes sense to release big-budget family films like “The Smurfs” in Spain. Such films are reliable box-office magnets and sell relatively well on DVD because parents use them as electronic babysitters. But dramas aimed at young men are dicier. As a result, says Mr Blake, the Spanish “get fewer films on fewer screens, with less marketing support behind them”.

As media companies pull out of Spain, they are beefing up in South Korea. That country is the world's 12th-biggest music market, a notch behind Spain. It will almost certainly overtake the Mediterranean country this year. Korean recorded-music sales, which collapsed in the first half of the last decade, have risen for each of the past three years. Sales were worth 207 billion won (then $179m) in 2010—up from 134 billion won in 2007.

South Korea has the world's toughest anti-piracy laws. Almost every measure under discussion elsewhere—threatening to cut pirates' broadband connections; blocking pirate websites; forcing youthful downloaders into education programmes; clamping down on cyber-lockers—has been done in Korea. Legal music-streaming and downloading websites have sprouted, providing many more honest ways of getting hold of music. The Korean experience may be unique: anti-piracy laws have not had such a clear effect elsewhere.

A few years ago international music firms had almost no presence in the country. Now they are coming back, according to Mayseey Leong, regional director of the IFPI, a music industry umbrella group. Universal Music began investing in Korean music in 2009. Sony Music has launched “The Secret Garden”, a music-heavy TV show, and used it to tout new singles. Warner Music Group has signed JYJ, a Korean boy band, and is exporting its schmaltzy pop to the rest of Asia.

As music firms move resources from one country to another, domestic markets are being reshaped. In 2010 Korean groups accounted for 76% of CD sales in that country, the highest share for at least eight years. In Germany, too, domestic acts' share of the recorded-music market has risen steadily, from 29.5% in 2001 to 49% in 2010. In Spain the balance has not changed much. But the number of albums by new Spanish artists to reach the annual top 50 has collapsed, from ten in 2003 to none in 2009 and 2010, according to the IFPI.

The same is not, however, true of film. In many countries, including Spain, the domestic film business is subsidised by the government, limiting the impact of declining DVD sales. In Russia, a high-piracy market, home-grown films have lost a lot of ground to Hollywood imports. But that is at least partly because Hollywood is marketing more heavily in the country: DVD sales may be virtually non-existent, but so many screens have been built that it is now worth their while.

Hollywood's global influence has, of course, long been resented. The worry for governments is that cultural industries like music will eventually go the way of film, with impoverished local outfits failing to compete with mighty international media giants. It is probably not a coincidence that the first country to enact a “three-strikes” law against media piracy was South Korea, a country with considerable pride in its exports, cultural and otherwise. Nor is it surprising that the first European country to follow suit was France, where worries about cultural purity and independence flow like wine.

Downloading music and films illegally from the internet appears an innocuous act—hardly as egregious as looting. But the legions of pirates are quietly reshaping world culture even so.