With the development of online education, there is an urgent need to solve the problem of the low completion rate of online learning courses. Although learning peer recommendation can effectively address this problem, prior studies of learning peer-recommendation methods extract only a portion of the interaction information and fail to take into account the heterogeneity of the various types of objects (e.g., students, teachers, videos, exercises, and knowledge points). To better motivate students to complete online learning courses, we propose a novel method to recommend learning peers based on a weighted heterogeneous information network. First, we integrate the above different objects, various relationships between objects, and the attribute values to links in a weighted heterogeneous information network. Second, we propose a method for automatically generating all meaningful weighted meta-paths to extract and identify meaningful meta-paths. Finally, we use the Bayesian Personalized Ranking (BPR) optimization framework to discover the personalized weights of target students on different meaningful weighted meta-paths. We conducted experiments using three real datasets, and the experimental results demonstrate the effectiveness and interpretability of the proposed method.