首页 > 解决方案 > 无需 API 从 Vimeo 获取 img 缩略图

问题描述

试图从 vimeo 视频播放器 ID 中抓取缩略图,但没有得到任何响应或错误代码。我知道有 API,但这真的像 3 个月前一样有效,现在我的小应用程序坏了,我做错了什么?

Private Function RequestToVimeo(ByVal VimeoVideoID As String, ByVal views As Boolean, rndAgent As Boolean, referer As String, Proxy As WebProxy) As Boolean



ReDownloadJson:

        Dim ResponseString As String = GetJson(VimeoVideoID, Proxy)


       Try
                Thistoken = Newtonsoft.Json.JsonConvert.DeserializeObject(Of VimeoJson)(ResponseString)
            Catch ex1 As Exception
                Try
                    Thistoken = Newtonsoft.Json.JsonConvert.DeserializeObject(Of OtherJson.VimeoJson)(ResponseString)
                Catch ex As Exception
                    Proxy = Nothing
                    GoTo ReDownloadJson
                End Try
        End Try

        If PreviewBox.ImageLocation Is Nothing OrElse PreviewBox.ImageLocation = String.Empty Then
            PreviewBox.ImageLocation = Thistoken.video.thumbs.base + "_640.jpg"
        End If




            If response IsNot Nothing Then
                response.Close()
            End If
            Return False
        End Try


    End Function

标签: getthumbnailsvimeo

解决方案


好的,我修复了一些问题,这是正确的,我希望 :)

Private Sub getBtn_Click(sender As Object, e As EventArgs) Handles getBtn.Click
    Try
        Dim vimeoUrl As String = "https://i.vimeocdn.com/video/"
        Dim vimeoID As String = videoID.Text 'this comes here your vimeo video ID

        If PreviewBox.ImageLocation Is Nothing OrElse PreviewBox.ImageLocation = String.Empty Then
            PreviewBox.ImageLocation = "https://i.vimeocdn.com/video/" + vimeoID + "_640.jpg"
        End If

    Catch ex As Exception

    End Try

End Sub

推荐阅读