If I download illegal material for my education and if the material is not in my reach in my country, is it still bad karma? I downloaded a lot of things for 16 years I guess.I now understood this is a form of stealing.And i decided to delete my downloaded content.But some material is not found in my country,or if i order them it takes too much hassle to get here or the material is for educational or self improvement purposes.And i never intended to steal.But still it was not respecting other people's work.With those intentions is it still bad karma?Is it still wrong if it is really really essential?

It's actually about the NEED to the material.Like i want to learn speaking english and i need a book or a listening material which is not found in my country.And i really need it.And if I learn english or other things it will be beneficial to me and my environment
 EDIT : Look what I found. Totally coincidence. Synchronisity ☺. https://youtu.be/xMj_P_6H69g
Legally, unlawful downloads would probably be more akin to trespassing than stealing, as nothing was taken, but the legal rights to control property was infringed upon. 

Considering the precepts, however, the issue isn't really about theft but about "undertaking the training to avoid taking things not given". Thus, it's a little more broad than theft. Instead, one should avoid even the perception of theft. Think of it like in a store where the "free samples" box is behind the counter and not easy to reach. To follow the precept, one should ask first and take if allowed.