mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-24 18:04:33 +01:00
YT Scraper issue Fix
This commit is contained in:
parent
e62abca957
commit
92e699075c
@ -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())
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -630,9 +630,9 @@ class ForegroundService : Service(){
|
||||
)
|
||||
}
|
||||
"gaana" -> {
|
||||
File(
|
||||
Environment.getExternalStorageDirectory(),
|
||||
Provider.defaultDir +".Images/" + (url.substringBeforeLast('/').substringAfterLast('/')) + ".jpeg")
|
||||
File(
|
||||
Environment.getExternalStorageDirectory(),
|
||||
Provider.defaultDir +".Images/" + (url.substringBeforeLast('/').substringAfterLast('/')) + ".jpeg")
|
||||
}
|
||||
else -> File(
|
||||
Environment.getExternalStorageDirectory(),
|
||||
|
Loading…
Reference in New Issue
Block a user