在没有API的情况下从Vimeo获取img缩略图

时间:2019-01-15 10:52:39

标签: get thumbnails vimeo

尝试从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

1 个答案:

答案 0 :(得分:-1)

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

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