The invention discloses a compound for treating respiratory syncytial virus infection, a preparation method and application thereof. The compound is a chemical analogue of cyclopamine, which has the property of inhibiting the replication of respiratory syncytial virus, but does not have the property of inhibiting Hedgehog signaling pathway. The preparation method synthesizes the chemical analogs of the cyclopamine through pharmaceutical chemistry, and screens the analogs through two parallel in vitro tests. The compound can be used to treat respiratory virus infection, paramyxovirus infection, respiratory syncytial virus infection, bronchiolitis caused by respiratory syncytial virus, pneumonia caused by respiratory syncytial virus, otitis media caused by respiratory syncytial virus, It does not have the toxic and side effects of causing fetal malformation, overcomes the teratogenic properties of cyclopamine, and fills in the blank of drugs for treating respiratory syncytial virus infection, especially pediatric drugs.