forked from recloudstream/cloudstream
		
	small fix to test and m3u8
This commit is contained in:
		
							parent
							
								
									88e1719085
								
							
						
					
					
						commit
						670c613f71
					
				
					 2 changed files with 7 additions and 6 deletions
				
			
		|  | @ -24,9 +24,7 @@ class ExampleInstrumentedTest { | |||
|     //} | ||||
| 
 | ||||
|     private fun getAllProviders(): List<MainAPI> { | ||||
|         val allApis = APIHolder.apis | ||||
|         allApis.addAll(APIHolder.restrictedApis) | ||||
|         return allApis //.filter { !it.usesWebView } | ||||
|         return APIHolder.allProviders //.filter { !it.usesWebView } | ||||
|     } | ||||
| 
 | ||||
|     private suspend fun loadLinks(api: MainAPI, url: String?): Boolean { | ||||
|  | @ -113,7 +111,7 @@ class ExampleInstrumentedTest { | |||
|                             continue | ||||
|                         } | ||||
| 
 | ||||
|                         val url = (load.episodes[load.episodes.keys.first()])?.first()?.url | ||||
|                         val url = (load.episodes[load.episodes.keys.first()])?.first()?.data | ||||
|                         validResults = loadLinks(api, url) | ||||
|                         if (!validResults) continue | ||||
|                     } | ||||
|  |  | |||
|  | @ -124,7 +124,10 @@ class M3u8Helper { | |||
|                 app.get(m3u8.streamUrl, headers = m3u8.headers).text | ||||
|             } | ||||
| 
 | ||||
|             var hasAnyContent = false | ||||
|             for (match in QUALITY_REGEX.findAll(response)) { | ||||
|                 hasAnyContent = true | ||||
| 
 | ||||
|                 var (quality, m3u8Link, m3u8Link2) = match.destructured | ||||
|                 if (m3u8Link.isEmpty()) m3u8Link = m3u8Link2 | ||||
|                 if (absoluteExtensionDetermination(m3u8Link) == "m3u8") { | ||||
|  | @ -152,11 +155,11 @@ class M3u8Helper { | |||
|                     ) | ||||
|                 ) | ||||
|             } | ||||
|             if (returnThis) { | ||||
|             if (returnThis || !hasAnyContent) { | ||||
|                 yield( | ||||
|                     M3u8Stream( | ||||
|                         m3u8.streamUrl, | ||||
|                         0, | ||||
|                         Qualities.Unknown.value, | ||||
|                         m3u8.headers | ||||
|                     ) | ||||
|                 ) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue