Yes, this definitely works. Been learning through listening to media for .... 13 years or so. Damn, I'm old now. Of course, if you don't study the language at all, this is unlikely to help much unless the language is pretty similar to ones you already know. I have tried to learn Mandarin a few times and listening to it hasn't done much for me. It's still just so alien when I turn on a Chinese radio, Chinese music, or a Chinese video... I haven't studied the language enough yet to benefit much from this, I think.
However, I used French radio (rfi.fr) for years to learn listening skills and pronunciation, and I learned new vocab this way as well. After a certain point, I moved to the next level, which was YouTube videos. Finally after a bit of that and a ton of French radio and French music, I was able to watch movies and understand a lot of them without subtitles. Took me a while to reach that level, but I'm so glad I had the patience to get there. Although, it would honestly be more efficient to just go to a country where it is spoken if you are able and listen more naturally. Unfortunately, I did not have that privilege. Also I do not like most languages as much as French, so I don't have this kind of patience. A lot of what I was listening to was repetitive international news on RFI.fr, and I feel I could've been more efficient and just watched more subtitled movies or something... something more useful. That being said, for a good while I couldn't understand most of what I was listening to. Just a few words and phrases at a time.
I don't like Spanish so much, so I cannot be bothered to listen to Spanish news much. Although I think that as my Spanish improves I'll have more patience for it because it will be more than just noise to me. I work with a lot of Latinos, so I've been able to improve by speaking with them instead of just listening to media. The one thing I have done much with Spanish media is listening to Spanish music, because there is a lot of good Spanish music. I am also a partner dancer, so I can listen to it when I go to Latin dance events. The higher your level gets, the easier it will be to bother to listen to something, because you know you're not just doing it to learn the language - you are actually able to appreciate the meaning of what is being said, and learn at the same time. In the beginning you may just have to be patient. Also, with each language, it should get easier to do this. Your brain gets better at differentiating between sounds. You learn how to learn.
Especially in the beginning, I recommend watching movies that you've already seen in a language you understand well - watch them again in your target language. With or without subtitles, depending on your level and preference. This way you already get the meaning and plot, you get the pleasure of watching a movie, and you get to learn by listening at the same time.
English (native); français (semi-fluent); español (basic conversational, 3 years in school + completed Duolingo tree); română (studied for a year + Duolingo Level 7); italiano (beginner; Duolingo tree completed); Deutsch (Duolingo Level 11, but I have a poor grasp of this language)
Official Dabbling History: 1.5 semesters in college nihongo; 2 semesters in college Kiswahili; 3 college linguistics classes
degree in Quenya from University of Rivendell (j.k.)