Wow I didn't know there were other people going through this!! I wish I could give you really good advice but I don't really know where I stand on the issue myself. Although I am not failing, I'm just not into it anymore, just like you.
I think it's important that you find something that you look forward to outside of school, because I find it helps my motivation when I find it hard to go through the week... for me, it's tennis class on Wednesdays
Also, I don't know if you work out a lot but I think workouts give me more energy and help me stay focused, or at least it helps a bit.
Also, I really think you should go see a school guidance counselor or even a psychologist, because there might be bigger issues at end, hiding in your subconscious. There's always a reason when your motivation seems to be gone, and there's a way to restore the flame but you just need to find out what's happening
Also, try talking about it to your friends. Ask them if they know why you could possibly be feeling this way, as your friends probably know you very well
If all else fails, try to go through this semester and take a semester, or a year off. Many many friends from my year are taking the winter semester off to travel (and by many, I mean almost 10 of them out of under 40 of us!!!!) and figure out what they really want to do, so maybe that kind of introspection could be good for you