The best way to learn Japanese through anime, if you're motivated enough, is to use an SRS system. I recommend Anki, as you can use it with Subs2SRS. What you do, is get download anime with soft-subbed English subtites as well as soft-subbed Japanese captions. Kitsunekko is a good site to get them, as it has sections dedicated both to English subs and Japanese closed captions.
You can use a software called Aegis to adjust the timing of the subtitles if they seem off, but you want the English and Japanese synced up as closely as possible.
Using Subs2SRS, you import all of this into the Anki flashcard program and you have yourself a flashcard deck of anime! You can even choose to play the audio clips of what's being said, too. Of course, you to make sure your subs are timed really well to the audio so you don't cut it off.
Just add whatever vocabulary or grammar notes to the cards that you want and get studying. It's fun and easy, though a bit time-consuming.