YT Scraper issue Fix

This commit is contained in:
Shabinder 2020-11-09 17:01:28 +05:30
parent e62abca957
commit 92e699075c
3 changed files with 6 additions and 5 deletions

View File

@ -130,6 +130,7 @@ object DownloadHelper {
}
}
override fun onFailure(call: Call<String>, t: Throwable) {
if(t.message.toString().contains("Failed to connect")) showMessage("Failed, Check Your Internet Connection!")
Log.i("YT API Req. Fail",t.message.toString())
}
}

View File

@ -128,12 +128,12 @@ fun getYTTracks(response: String):List<YoutubeTrack>{
)
}
}
//Log.i("Text Api",availableDetails.toString())
Log.i("Text Api",availableDetails.toString())
/*
! Filter Out non-Song/Video results and incomplete results here itself
! From what we know about detail order, note that [1] - indicate result type
*/
if ( availableDetails.size > 1 && availableDetails[1] in listOf("Song","Video") ){
if ( availableDetails.size == 5 && availableDetails[1] in listOf("Song","Video") ){
// skip if result is in hours instead of minutes (no song is that long)
if(availableDetails[4].split(':').size != 2) continue //Has Been Giving Issues