mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 07:13:00 +00:00 
			
		
		
		
	fixed another livestream related issue
This commit is contained in:
		| @@ -1,7 +1,5 @@ | ||||
| package org.schabi.newpipe; | ||||
|  | ||||
| import android.content.Context; | ||||
| import android.util.Log; | ||||
| import android.view.LayoutInflater; | ||||
| import android.view.View; | ||||
| import android.view.ViewGroup; | ||||
| @@ -33,7 +31,7 @@ import com.nostra13.universalimageloader.core.ImageLoader; | ||||
|  * along with NewPipe.  If not, see <http://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| class VideoInfoItemViewCreator { | ||||
| public class VideoInfoItemViewCreator { | ||||
|     private final LayoutInflater inflater; | ||||
|     private ImageLoader imageLoader = ImageLoader.getInstance(); | ||||
|     private DisplayImageOptions displayImageOptions = new DisplayImageOptions.Builder().cacheInMemory(true).build(); | ||||
|   | ||||
| @@ -220,7 +220,7 @@ public class YoutubeSearchEngine extends SearchEngine { | ||||
|                         // -1 for no duration | ||||
|                         return -1; | ||||
|                     } else { | ||||
|                         throw new ParsingException("Could not get Duration", e); | ||||
|                         throw new ParsingException("Could not get Duration: " + getTitle(), e); | ||||
|                     } | ||||
|  | ||||
|  | ||||
| @@ -263,7 +263,7 @@ public class YoutubeSearchEngine extends SearchEngine { | ||||
|                         return -1; | ||||
|                     } else { | ||||
|                         throw new ParsingException( | ||||
|                                 "Could not parse yt-lockup-meta although available", e); | ||||
|                                 "Could not parse yt-lockup-meta although available: " + getTitle(), e); | ||||
|                     } | ||||
|                 } | ||||
|  | ||||
| @@ -305,6 +305,14 @@ public class YoutubeSearchEngine extends SearchEngine { | ||||
|  | ||||
|             private boolean isLiveStream(Element item) { | ||||
|                 Element bla = item.select("span[class*=\"yt-badge-live\"]").first(); | ||||
|  | ||||
|                 if(bla == null) { | ||||
|                     // sometimes livestreams dont have badges but sill are live streams | ||||
|                     // if video time is not available we most likly have an offline livestream | ||||
|                     if(item.select("span[class*=\"video-time\"]").first() == null) { | ||||
|                         return true; | ||||
|                     } | ||||
|                 } | ||||
|                 return bla != null; | ||||
|             } | ||||
|         }; | ||||
|   | ||||
							
								
								
									
										12
									
								
								app/src/main/res/layout/against_drm_fragment.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								app/src/main/res/layout/against_drm_fragment.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:orientation="vertical" android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent"> | ||||
|  | ||||
|  | ||||
|  | ||||
|     <TextView | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="match_parent" /> | ||||
|  | ||||
| </LinearLayout> | ||||
		Reference in New Issue
	
	Block a user
	 Christian Schabesberger
					Christian Schabesberger