Can I get in trouble for sharing a professors lecture online without permission?

Unfortunately, yes, you can get into trouble for sharing a professor's lecture online without permission for sharing it online, or for sharing with a friend, for example. Aside from say, any intellectual property considerations, we'll leave them aside, a school can consider that as providing unauthorized assistance, or providing information that should not be provided to other students, to help them gain an unfair academic advantage, even if you had no intent in doing so. Even if your purpose in doing so was completely above board. Unfortunately, a student can find him or herself charged for, again, sharing information of that nature. You can't depend on the school to do the right thing, even if you're, say 100% within your rights to have shared that information. You have to calculate the necessary response. Before you engage with the school in any capacity, you have to take the necessary precautions. Having an experienced attorney advisor will be your best ally to help you understand and navigate the process, and to take the best steps forward.