Skip to content

Commit

Permalink
fixed: crash if YouTube server not response to GetVideoDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
DanCooper committed Mar 15, 2016
1 parent 5a4ef37 commit dd0971e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions EmberAPI/clsAPIYouTube.vb
Expand Up @@ -103,9 +103,13 @@ Namespace YouTube
Public Shared Function IsAvailable(ByVal strURL As String) As Boolean
If UrlUtils.IsYouTubeURL(strURL) Then
Dim raw_video_info As String = GetVideoDetails(UrlUtils.GetVideoID(strURL))
Dim rawAllData As Dictionary(Of String, String) = ToStringTable(raw_video_info).ToDictionary(Function(entry) entry(0), Function(entry) entry(1))
If Not rawAllData.ContainsKey("errorcode") Then
Return True
If Not String.IsNullOrEmpty(raw_video_info) Then
Dim rawAllData As Dictionary(Of String, String) = ToStringTable(raw_video_info).ToDictionary(Function(entry) entry(0), Function(entry) entry(1))
If Not rawAllData.ContainsKey("errorcode") Then
Return True
End If
Else
Return False
End If
End If
Return False
Expand Down

0 comments on commit dd0971e

Please sign in to comment.