diff --git a/app/src/androidTest/java/org/schabi/newpipe/extractor/youtube/YoutubeStreamExtractorDefaultTest.java b/app/src/androidTest/java/org/schabi/newpipe/extractor/youtube/YoutubeStreamExtractorDefaultTest.java index 3c7b3e720..058fc6e24 100644 --- a/app/src/androidTest/java/org/schabi/newpipe/extractor/youtube/YoutubeStreamExtractorDefaultTest.java +++ b/app/src/androidTest/java/org/schabi/newpipe/extractor/youtube/YoutubeStreamExtractorDefaultTest.java @@ -3,7 +3,7 @@ package org.schabi.newpipe.services.youtube; import android.test.AndroidTestCase; import org.schabi.newpipe.Downloader; -import org.schabi.newpipe.extractor.CrawlingException; +import org.schabi.newpipe.extractor.ExctractionException; import org.schabi.newpipe.extractor.ParsingException; import org.schabi.newpipe.extractor.services.youtube.YoutubeStreamExtractor; import org.schabi.newpipe.extractor.VideoInfo; @@ -33,7 +33,7 @@ import java.io.IOException; public class YoutubeStreamExtractorDefaultTest extends AndroidTestCase { private YoutubeStreamExtractor extractor; - public void setUp() throws IOException, CrawlingException { + public void setUp() throws IOException, ExctractionException { /* some anonymus video test extractor = new YoutubeStreamExtractor("https://www.youtube.com/watch?v=FmG385_uUys", new Downloader()); */ @@ -47,7 +47,7 @@ public class YoutubeStreamExtractorDefaultTest extends AndroidTestCase { extractor.getTimeStamp() <= 0); } - public void testGetValidTimeStamp() throws CrawlingException, IOException { + public void testGetValidTimeStamp() throws ExctractionException, IOException { YoutubeStreamExtractor extractor = new YoutubeStreamExtractor("https://youtu.be/FmG385_uUys?t=174", new Downloader()); assertTrue(Integer.toString(extractor.getTimeStamp()), diff --git a/app/src/androidTest/java/org/schabi/newpipe/extractor/youtube/YoutubeStreamExtractorGemaTest.java b/app/src/androidTest/java/org/schabi/newpipe/extractor/youtube/YoutubeStreamExtractorGemaTest.java index cf8dd3104..740e07a8a 100644 --- a/app/src/androidTest/java/org/schabi/newpipe/extractor/youtube/YoutubeStreamExtractorGemaTest.java +++ b/app/src/androidTest/java/org/schabi/newpipe/extractor/youtube/YoutubeStreamExtractorGemaTest.java @@ -3,7 +3,7 @@ package org.schabi.newpipe.services.youtube; import android.test.AndroidTestCase; import org.schabi.newpipe.Downloader; -import org.schabi.newpipe.extractor.CrawlingException; +import org.schabi.newpipe.extractor.ExctractionException; import org.schabi.newpipe.extractor.services.youtube.YoutubeStreamExtractor; import java.io.IOException; @@ -35,7 +35,7 @@ public class YoutubeStreamExtractorGemaTest extends AndroidTestCase { // Deaktivate this Test Case bevore uploading it githup, otherwise CI will fail. private static final boolean testActive = false; - public void testGemaError() throws IOException, CrawlingException { + public void testGemaError() throws IOException, ExctractionException { if(testActive) { try { new YoutubeStreamExtractor("https://www.youtube.com/watch?v=3O1_3zBUKM8", diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java index 44ef65e5d..8c11df041 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java @@ -98,7 +98,7 @@ public class VideoItemDetailFragment extends Fragment { private Bitmap videoThumbnail; private View thumbnailWindowLayout; - //this only remains dueto downwards compartiblity + //this only remains due to downwards compatibility private FloatingActionButton playVideoButton; private final Point initialThumbnailPos = new Point(0, 0); @@ -224,11 +224,20 @@ public class VideoItemDetailFragment extends Fragment { Button backgroundButton = (Button) activity.findViewById(R.id.detailVideoThumbnailWindowBackgroundButton); View topView = activity.findViewById(R.id.detailTopView); - View nextVideoView = videoItemViewCreator - .getViewFromVideoInfoItem(null, nextVideoFrame, info.next_video, getContext()); + View nextVideoView = null; + if(info.next_video != null) { + nextVideoView = videoItemViewCreator + .getViewFromVideoInfoItem(null, nextVideoFrame, info.next_video, getContext()); + } else { + activity.findViewById(R.id.detailNextVidButtonAndContentLayout).setVisibility(View.GONE); + activity.findViewById(R.id.detailNextVideoTitle).setVisibility(View.GONE); + activity.findViewById(R.id.detailNextVideoButton).setVisibility(View.GONE); + } progressBar.setVisibility(View.GONE); - nextVideoFrame.addView(nextVideoView); + if(nextVideoView != null) { + nextVideoFrame.addView(nextVideoView); + } initThumbnailViews(info, nextVideoFrame); @@ -265,14 +274,43 @@ public class VideoItemDetailFragment extends Fragment { } }); - uploaderView.setText(info.uploader); + // Since newpipe is designed to work even if certain information is not available, + // the UI has to react on missing information. videoTitleView.setText(info.title); - uploaderView.setText(info.uploader); - viewCountView.setText(Localization.localizeViewCount(info.view_count, c)); - thumbsUpView.setText(Localization.localizeNumber(info.like_count, c)); - thumbsDownView.setText(Localization.localizeNumber(info.dislike_count, c)); - uploadDateView.setText(Localization.localizeDate(info.upload_date, c)); - descriptionView.setText(Html.fromHtml(info.description)); + if(!info.uploader.isEmpty()) { + uploaderView.setText(info.uploader); + } else { + activity.findViewById(R.id.detailUploaderWrapView).setVisibility(View.GONE); + } + if(info.view_count >= 0) { + viewCountView.setText(Localization.localizeViewCount(info.view_count, c)); + } else { + viewCountView.setVisibility(View.GONE); + } + if(info.dislike_count >= 0) { + thumbsDownView.setText(Localization.localizeNumber(info.dislike_count, c)); + } else { + thumbsDownView.setVisibility(View.INVISIBLE); + activity.findViewById(R.id.detailThumbsDownImgView).setVisibility(View.GONE); + } + if(info.like_count >= 0) { + thumbsUpView.setText(Localization.localizeNumber(info.like_count, c)); + } else { + thumbsUpView.setVisibility(View.GONE); + activity.findViewById(R.id.detailThumbsUpImgView).setVisibility(View.GONE); + thumbsDownView.setVisibility(View.GONE); + activity.findViewById(R.id.detailThumbsDownImgView).setVisibility(View.GONE); + } + if(!info.upload_date.isEmpty()) { + uploadDateView.setText(Localization.localizeDate(info.upload_date, c)); + } else { + uploadDateView.setVisibility(View.GONE); + } + if(!info.description.isEmpty()) { + descriptionView.setText(Html.fromHtml(info.description)); + } else { + descriptionView.setVisibility(View.GONE); + } descriptionView.setMovementMethod(LinkMovementMethod.getInstance()); @@ -299,7 +337,12 @@ public class VideoItemDetailFragment extends Fragment { }); textContentLayout.setVisibility(View.VISIBLE); - initSimilarVideos(info, videoItemViewCreator); + if(info.related_videos != null && !info.related_videos.isEmpty()) { + initSimilarVideos(info, videoItemViewCreator); + } else { + activity.findViewById(R.id.detailSimilarTitle).setVisibility(View.GONE); + activity.findViewById(R.id.similarVideosView).setVisibility(View.GONE); + } if(autoPlayEnabled) { playVideo(info); @@ -335,32 +378,40 @@ public class VideoItemDetailFragment extends Fragment { ImageView nextVideoThumb = (ImageView) nextVideoFrame.findViewById(R.id.itemThumbnailView); - imageLoader.displayImage(info.thumbnail_url, videoThumbnailView, - displayImageOptions, new ImageLoadingListener() { - @Override - public void onLoadingStarted(String imageUri, View view) { - } + if(info.thumbnail_url != null && !info.thumbnail_url.isEmpty()) { + imageLoader.displayImage(info.thumbnail_url, videoThumbnailView, + displayImageOptions, new ImageLoadingListener() { + @Override + public void onLoadingStarted(String imageUri, View view) { + } - @Override - public void onLoadingFailed(String imageUri, View view, FailReason failReason) { - Toast.makeText(VideoItemDetailFragment.this.getActivity(), - R.string.could_not_load_thumbnails, Toast.LENGTH_LONG).show(); - failReason.getCause().printStackTrace(); - } + @Override + public void onLoadingFailed(String imageUri, View view, FailReason failReason) { + Toast.makeText(VideoItemDetailFragment.this.getActivity(), + R.string.could_not_load_thumbnails, Toast.LENGTH_LONG).show(); + failReason.getCause().printStackTrace(); + } - @Override - public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) { - videoThumbnail = loadedImage; - } + @Override + public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) { + videoThumbnail = loadedImage; + } - @Override - public void onLoadingCancelled(String imageUri, View view) { - } - }); - imageLoader.displayImage(info.uploader_thumbnail_url, - uploaderThumb, displayImageOptions, new ThumbnailLoadingListener()); - imageLoader.displayImage(info.next_video.thumbnail_url, - nextVideoThumb, displayImageOptions, new ThumbnailLoadingListener()); + @Override + public void onLoadingCancelled(String imageUri, View view) { + } + }); + } else { + videoThumbnailView.setImageResource(R.drawable.dummy_thumbnail_dark); + } + if(info.uploader_thumbnail_url != null && !info.uploader_thumbnail_url.isEmpty()) { + imageLoader.displayImage(info.uploader_thumbnail_url, + uploaderThumb, displayImageOptions, new ThumbnailLoadingListener()); + } + if(info.thumbnail_url != null && !info.thumbnail_url.isEmpty()) { + imageLoader.displayImage(info.next_video.thumbnail_url, + nextVideoThumb, displayImageOptions, new ThumbnailLoadingListener()); + } } private void setupActionBarHandler(final VideoInfo info) { diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java index 8384a738f..7a75fa38e 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java @@ -16,7 +16,7 @@ import android.widget.Toast; import java.io.IOException; import java.util.List; -import org.schabi.newpipe.extractor.CrawlingException; +import org.schabi.newpipe.extractor.ExctractionException; import org.schabi.newpipe.extractor.VideoPreviewInfo; import org.schabi.newpipe.extractor.SearchEngine; import org.schabi.newpipe.extractor.StreamingService; @@ -115,7 +115,7 @@ public class VideoItemListFragment extends ListFragment { } catch(IOException e) { postNewErrorToast(h, R.string.network_error); e.printStackTrace(); - } catch(CrawlingException ce) { + } catch(ExctractionException ce) { postNewErrorToast(h, R.string.parsing_error); ce.printStackTrace(); } catch(Exception e) { diff --git a/app/src/main/java/org/schabi/newpipe/extractor/CrawlingException.java b/app/src/main/java/org/schabi/newpipe/extractor/ExctractionException.java similarity index 74% rename from app/src/main/java/org/schabi/newpipe/extractor/CrawlingException.java rename to app/src/main/java/org/schabi/newpipe/extractor/ExctractionException.java index 02b0edbc9..f279730fc 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/CrawlingException.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/ExctractionException.java @@ -4,7 +4,7 @@ package org.schabi.newpipe.extractor; * Created by Christian Schabesberger on 30.01.16. * * Copyright (C) Christian Schabesberger 2016 - * CrawlingException.java is part of NewPipe. + * ExctractionException.java is part of NewPipe. * * NewPipe is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,18 +20,18 @@ package org.schabi.newpipe.extractor; * along with NewPipe. If not, see . */ -public class CrawlingException extends Exception { - public CrawlingException() {} +public class ExctractionException extends Exception { + public ExctractionException() {} - public CrawlingException(String message) { + public ExctractionException(String message) { super(message); } - public CrawlingException(Throwable cause) { + public ExctractionException(Throwable cause) { super(cause); } - public CrawlingException(String message, Throwable cause) { + public ExctractionException(String message, Throwable cause) { super(message, cause); } } \ No newline at end of file diff --git a/app/src/main/java/org/schabi/newpipe/extractor/ParsingException.java b/app/src/main/java/org/schabi/newpipe/extractor/ParsingException.java index 54d8cd615..dd916afd0 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/ParsingException.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/ParsingException.java @@ -21,7 +21,7 @@ package org.schabi.newpipe.extractor; */ -public class ParsingException extends CrawlingException { +public class ParsingException extends ExctractionException { public ParsingException() {} public ParsingException(String message) { super(message); diff --git a/app/src/main/java/org/schabi/newpipe/extractor/SearchEngine.java b/app/src/main/java/org/schabi/newpipe/extractor/SearchEngine.java index c292048d1..fe8aaa152 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/SearchEngine.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/SearchEngine.java @@ -34,9 +34,9 @@ public interface SearchEngine { } ArrayList suggestionList(String query, Downloader dl) - throws CrawlingException, IOException; + throws ExctractionException, IOException; //Result search(String query, int page); Result search(String query, int page, String contentCountry, Downloader dl) - throws CrawlingException, IOException; + throws ExctractionException, IOException; } diff --git a/app/src/main/java/org/schabi/newpipe/extractor/StreamExtractor.java b/app/src/main/java/org/schabi/newpipe/extractor/StreamExtractor.java index 89feed401..70129de61 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/StreamExtractor.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/StreamExtractor.java @@ -28,7 +28,7 @@ import java.util.List; @SuppressWarnings("ALL") public interface StreamExtractor { - public class ExctractorInitException extends CrawlingException { + public class ExctractorInitException extends ExctractionException { public ExctractorInitException() {} public ExctractorInitException(String message) { super(message); diff --git a/app/src/main/java/org/schabi/newpipe/extractor/StreamingService.java b/app/src/main/java/org/schabi/newpipe/extractor/StreamingService.java index d9ac2922c..f2144f581 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/StreamingService.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/StreamingService.java @@ -28,7 +28,7 @@ public interface StreamingService { } ServiceInfo getServiceInfo(); StreamExtractor getExtractorInstance(String url, Downloader downloader) - throws IOException, CrawlingException; + throws IOException, ExctractionException; SearchEngine getSearchEngineInstance(); VideoUrlIdHandler getUrlIdHandler(); diff --git a/app/src/main/java/org/schabi/newpipe/extractor/VideoInfo.java b/app/src/main/java/org/schabi/newpipe/extractor/VideoInfo.java index 9d79a48a0..9135c82a9 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/VideoInfo.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/VideoInfo.java @@ -31,33 +31,54 @@ public class VideoInfo extends AbstractVideoInfo { /**Fills out the video info fields which are common to all services. * Probably needs to be overridden by subclasses*/ public static VideoInfo getVideoInfo(StreamExtractor extractor, Downloader downloader) - throws CrawlingException, IOException { + throws ExctractionException, IOException { VideoInfo videoInfo = new VideoInfo(); + videoInfo = extractImportantData(videoInfo, extractor, downloader); + videoInfo = extractStreams(videoInfo, extractor, downloader); + videoInfo = extractOptionalData(videoInfo, extractor, downloader); + + return videoInfo; + } + + private static VideoInfo extractImportantData( + VideoInfo videoInfo, StreamExtractor extractor, Downloader downloader) + throws ExctractionException, IOException { + /* ---- importand data, withoug the video can't be displayed goes here: ---- */ + // if one of these is not available an exception is ment to be thrown directly into the frontend. + VideoUrlIdHandler uiconv = extractor.getUrlIdConverter(); - videoInfo.webpage_url = extractor.getPageUrl(); - videoInfo.title = extractor.getTitle(); - videoInfo.duration = extractor.getLength(); - videoInfo.uploader = extractor.getUploader(); - videoInfo.description = extractor.getDescription(); - videoInfo.view_count = extractor.getViews(); - videoInfo.upload_date = extractor.getUploadDate(); - videoInfo.thumbnail_url = extractor.getThumbnailUrl(); videoInfo.id = uiconv.getVideoId(extractor.getPageUrl()); - //todo: make this quick and dirty solution a real fallback - // The front end should be notified that the dash mpd could not be downloaded - // although not getting the dash mpd is not the end of the world, therfore - // we continue. + videoInfo.title = extractor.getTitle(); + + if((videoInfo.webpage_url == null || videoInfo.webpage_url.isEmpty()) + || (videoInfo.id == null || videoInfo.id.isEmpty()) + || (videoInfo.title == null /* videoInfo.title can be empty of course */)); + + return videoInfo; + } + + private static VideoInfo extractStreams( + VideoInfo videoInfo, StreamExtractor extractor, Downloader downloader) + throws ExctractionException, IOException { + /* ---- stream extraction goes here ---- */ + // At least one type of stream has to be available, + // otherwise an exception will be thrown directly into the frontend. + try { videoInfo.dashMpdUrl = extractor.getDashMpdUrl(); } catch(Exception e) { - e.printStackTrace(); + videoInfo.addException(new ExctractionException("Couldn't get Dash manifest", e)); } - /** Load and extract audio*/ - videoInfo.audio_streams = extractor.getAudioStreams(); + /* Load and extract audio */ + try { + videoInfo.audio_streams = extractor.getAudioStreams(); + } catch(Exception e) { + videoInfo.addException(new ExctractionException("Couldn't get audio streams", e)); + } // also try to get streams from the dashMpd if(videoInfo.dashMpdUrl != null && !videoInfo.dashMpdUrl.isEmpty()) { if(videoInfo.audio_streams == null) { @@ -69,28 +90,115 @@ public class VideoInfo extends AbstractVideoInfo { videoInfo.audio_streams.addAll( DashMpdParser.getAudioStreams(videoInfo.dashMpdUrl, downloader)); } catch(Exception e) { - e.printStackTrace(); + videoInfo.addException( + new ExctractionException("Couldn't get audio streams from dash mpd", e)); } } - /** Extract video stream url*/ - videoInfo.video_streams = extractor.getVideoStreams(); - /** Extract video only stream url*/ - videoInfo.video_only_streams = extractor.getVideoOnlyStreams(); - videoInfo.uploader_thumbnail_url = extractor.getUploaderThumbnailUrl(); - videoInfo.start_position = extractor.getTimeStamp(); - videoInfo.average_rating = extractor.getAverageRating(); - videoInfo.like_count = extractor.getLikeCount(); - videoInfo.dislike_count = extractor.getDislikeCount(); - videoInfo.next_video = extractor.getNextVideo(); - videoInfo.related_videos = extractor.getRelatedVideos(); + /* Extract video stream url*/ + try { + videoInfo.video_streams = extractor.getVideoStreams(); + } catch (Exception e) { + videoInfo.addException( + new ExctractionException("Couldn't get video streams", e)); + } + /* Extract video only stream url*/ + try { + videoInfo.video_only_streams = extractor.getVideoOnlyStreams(); + } catch(Exception e) { + videoInfo.addException( + new ExctractionException("Couldn't get video only streams", e)); + } + + // either dash_mpd audio_only or video has to be available, otherwise we didn't get a stream, + // and therefore failed. (Since video_only_streams are just optional they don't caunt). + if((videoInfo.video_streams == null || videoInfo.video_streams.isEmpty()) + && (videoInfo.audio_streams == null || videoInfo.audio_streams.isEmpty()) + && (videoInfo.dashMpdUrl == null || videoInfo.dashMpdUrl.isEmpty())) { + throw new ExctractionException("Could not get any stream. See error variable to get further details."); + } return videoInfo; } + private static VideoInfo extractOptionalData( + VideoInfo videoInfo, StreamExtractor extractor, Downloader downloader) { + /* ---- optional data goes here: ---- */ + // If one of these failes, the frontend neets to handle that they are not available. + // Exceptions are therfore not thrown into the frontend, but stored into the error List, + // so the frontend can afterwads check where errors happend. + + try { + videoInfo.thumbnail_url = extractor.getThumbnailUrl(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.duration = extractor.getLength(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.uploader = extractor.getUploader(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.description = extractor.getDescription(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.view_count = extractor.getViews(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.upload_date = extractor.getUploadDate(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.uploader_thumbnail_url = extractor.getUploaderThumbnailUrl(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.start_position = extractor.getTimeStamp(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.average_rating = extractor.getAverageRating(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.like_count = extractor.getLikeCount(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.dislike_count = extractor.getDislikeCount(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.next_video = extractor.getNextVideo(); + } catch(Exception e) { + videoInfo.addException(e); + } + try { + videoInfo.related_videos = extractor.getRelatedVideos(); + } catch(Exception e) { + videoInfo.addException(e); + } + + return videoInfo; + } public String uploader_thumbnail_url = ""; public String description = ""; - /*todo: make this lists over vectors*/ + public List video_streams = null; public List audio_streams = null; public List video_only_streams = null; @@ -101,8 +209,6 @@ public class VideoInfo extends AbstractVideoInfo { public String dashMpdUrl = ""; public int duration = -1; - /*YouTube-specific fields - todo: move these to a subclass*/ public int age_limit = 0; public int like_count = -1; public int dislike_count = -1; @@ -113,6 +219,8 @@ public class VideoInfo extends AbstractVideoInfo { public int start_position = 0; //todo: public int service_id = -1; + public List errors = new Vector<>(); + public VideoInfo() {} /**Creates a new VideoInfo object from an existing AbstractVideoInfo. @@ -187,4 +295,8 @@ public class VideoInfo extends AbstractVideoInfo { && url == cmp.url; } } + + public void addException(Exception e) { + errors.add(e); + } } \ No newline at end of file diff --git a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeService.java b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeService.java index fd7be7cf9..2f9e1319a 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeService.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeService.java @@ -1,6 +1,6 @@ package org.schabi.newpipe.extractor.services.youtube; -import org.schabi.newpipe.extractor.CrawlingException; +import org.schabi.newpipe.extractor.ExctractionException; import org.schabi.newpipe.extractor.Downloader; import org.schabi.newpipe.extractor.StreamExtractor; import org.schabi.newpipe.extractor.StreamingService; @@ -39,7 +39,7 @@ public class YoutubeService implements StreamingService { } @Override public StreamExtractor getExtractorInstance(String url, Downloader downloader) - throws CrawlingException, IOException { + throws ExctractionException, IOException { VideoUrlIdHandler urlIdHandler = new YoutubeVideoUrlIdHandler(); if(urlIdHandler.acceptUrl(url)) { return new YoutubeStreamExtractor(url, downloader) ; diff --git a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java index efb1ac329..0e17d1c9a 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java @@ -10,7 +10,7 @@ import org.jsoup.nodes.Element; import org.mozilla.javascript.Context; import org.mozilla.javascript.Function; import org.mozilla.javascript.ScriptableObject; -import org.schabi.newpipe.extractor.CrawlingException; +import org.schabi.newpipe.extractor.ExctractionException; import org.schabi.newpipe.extractor.Downloader; import org.schabi.newpipe.extractor.Parser; import org.schabi.newpipe.extractor.ParsingException; @@ -173,7 +173,7 @@ public class YoutubeStreamExtractor implements StreamExtractor { private Downloader downloader; - public YoutubeStreamExtractor(String pageUrl, Downloader dl) throws CrawlingException, IOException { + public YoutubeStreamExtractor(String pageUrl, Downloader dl) throws ExctractionException, IOException { //most common videoInfo fields are now set in our superclass, for all services downloader = dl; this.pageUrl = pageUrl; diff --git a/app/src/main/res/layout-v18/fragment_videoitem_detail.xml b/app/src/main/res/layout-v18/fragment_videoitem_detail.xml index 5698fcf21..8473c098c 100644 --- a/app/src/main/res/layout-v18/fragment_videoitem_detail.xml +++ b/app/src/main/res/layout-v18/fragment_videoitem_detail.xml @@ -266,10 +266,10 @@ android:layout_below="@id/detailNextVidButtonAndContentLayout" android:textAllCaps="true" />