From 9204a8931929d721261b6369b124b9b3e91461e5 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 28 Jan 2016 23:27:16 +0100 Subject: [PATCH] fiexed some licence headers --- .../org/schabi/newpipe/ActionBarHandler.java | 2 +- .../java/org/schabi/newpipe/Downloader.java | 2 +- .../newpipe/crawler/AbstractVideoInfo.java | 19 ++++++++++++++++++- .../schabi/newpipe/crawler/Downloader.java | 2 +- .../schabi/newpipe/crawler/MediaFormat.java | 2 +- .../youtube/YoutubeVideoExtractor.java | 19 +++++++++---------- 6 files changed, 31 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java b/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java index 0cd4f0b1a..6e70e07ba 100644 --- a/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java +++ b/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java @@ -22,7 +22,7 @@ import org.schabi.newpipe.crawler.VideoInfo; /** * Created by Christian Schabesberger on 18.08.15. * - * Copyright (C) Christian Schabesberger 2015 + * Copyright (C) Christian Schabesberger 2016 * DetailsMenuHandler.java is part of NewPipe. * * NewPipe is free software: you can redistribute it and/or modify diff --git a/app/src/main/java/org/schabi/newpipe/Downloader.java b/app/src/main/java/org/schabi/newpipe/Downloader.java index 372857462..0827f1f99 100644 --- a/app/src/main/java/org/schabi/newpipe/Downloader.java +++ b/app/src/main/java/org/schabi/newpipe/Downloader.java @@ -13,7 +13,7 @@ import info.guardianproject.netcipher.NetCipher; /** * Created by Christian Schabesberger on 28.01.16. * - * Copyright (C) Christian Schabesberger 2015 + * Copyright (C) Christian Schabesberger 2016 * Downloader.java is part of NewPipe. * * NewPipe is free software: you can redistribute it and/or modify diff --git a/app/src/main/java/org/schabi/newpipe/crawler/AbstractVideoInfo.java b/app/src/main/java/org/schabi/newpipe/crawler/AbstractVideoInfo.java index a338242bb..7a15a8af2 100644 --- a/app/src/main/java/org/schabi/newpipe/crawler/AbstractVideoInfo.java +++ b/app/src/main/java/org/schabi/newpipe/crawler/AbstractVideoInfo.java @@ -2,12 +2,29 @@ package org.schabi.newpipe.crawler; import android.graphics.Bitmap; +/** + * Copyright (C) Christian Schabesberger 2015 + * AbstractVideoInfo.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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * NewPipe is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with NewPipe. If not, see . + */ + /**Common properties between VideoInfo and VideoPreviewInfo.*/ public abstract class AbstractVideoInfo { public String id = ""; public String title = ""; public String uploader = ""; - //public int duration = -1; public String thumbnail_url = ""; public Bitmap thumbnail = null; public String webpage_url = ""; diff --git a/app/src/main/java/org/schabi/newpipe/crawler/Downloader.java b/app/src/main/java/org/schabi/newpipe/crawler/Downloader.java index 5fda48f3e..4c6511468 100644 --- a/app/src/main/java/org/schabi/newpipe/crawler/Downloader.java +++ b/app/src/main/java/org/schabi/newpipe/crawler/Downloader.java @@ -3,7 +3,7 @@ package org.schabi.newpipe.crawler; /** * Created by Christian Schabesberger on 28.01.16. * - * Copyright (C) Christian Schabesberger 2015 + * Copyright (C) Christian Schabesberger 2016 * Downloader.java is part of NewPipe. * * NewPipe is free software: you can redistribute it and/or modify diff --git a/app/src/main/java/org/schabi/newpipe/crawler/MediaFormat.java b/app/src/main/java/org/schabi/newpipe/crawler/MediaFormat.java index efebf17f3..63b94fd47 100644 --- a/app/src/main/java/org/schabi/newpipe/crawler/MediaFormat.java +++ b/app/src/main/java/org/schabi/newpipe/crawler/MediaFormat.java @@ -6,7 +6,7 @@ package org.schabi.newpipe.crawler; * Copyright (c) Christian Schabesberger * and Adam Howard 2015 * - * VideoListAdapter.java is part of NewPipe. + * MediaFormat.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 diff --git a/app/src/main/java/org/schabi/newpipe/crawler/services/youtube/YoutubeVideoExtractor.java b/app/src/main/java/org/schabi/newpipe/crawler/services/youtube/YoutubeVideoExtractor.java index 4292a4e9f..b0ecd1e4f 100644 --- a/app/src/main/java/org/schabi/newpipe/crawler/services/youtube/YoutubeVideoExtractor.java +++ b/app/src/main/java/org/schabi/newpipe/crawler/services/youtube/YoutubeVideoExtractor.java @@ -240,8 +240,13 @@ public class YoutubeVideoExtractor extends VideoExtractor { //------------------------------------ // extract video stream url //------------------------------------ - String encoded_url_map = playerArgs.getString("url_encoded_fmt_stream_map"); Vector videoStreams = new Vector<>(); + + // The following line belongs to dash audio stuff. + // We can't use dash audio, unless we have exoplayer as our main player. + //String adaptive_fmts = playerArgs.getString("adaptive_fmts"); + + String encoded_url_map = playerArgs.getString("url_encoded_fmt_stream_map"); for(String url_data_str : encoded_url_map.split(",")) { Map tags = new HashMap<>(); for(String raw_tag : Parser.unescapeEntities(url_data_str, true).split("&")) { @@ -264,6 +269,7 @@ public class YoutubeVideoExtractor extends VideoExtractor { resolveResolutionString(itag))); } } + return videoStreams.toArray(new VideoInfo.VideoStream[videoStreams.size()]); } catch (Exception e) { @@ -280,6 +286,7 @@ public class YoutubeVideoExtractor extends VideoExtractor { @SuppressWarnings("WeakerAccess") public static int resolveFormat(int itag) { switch(itag) { + // !!! lists only supported formats !!! // video case 17: return MediaFormat.v3GPP.id; case 18: return MediaFormat.MPEG_4.id; @@ -408,15 +415,6 @@ public class YoutubeVideoExtractor extends VideoExtractor { // extracting information from html page //--------------------------------------- - /* Code does not work here anymore. - // Determine what went wrong when the Video is not available - if(videoInfo.errorCode == VideoInfo.ERROR_NO_SPECIFIED_ERROR) { - if(doc.select("h1[id=\"unavailable-message\"]").first().text().contains("GEMA")) { - videoInfo.videoAvailableStatus = VideoInfo.VIDEO_UNAVAILABLE_GEMA; - } - } - */ - String likesString = ""; String dislikesString = ""; try { @@ -530,6 +528,7 @@ public class YoutubeVideoExtractor extends VideoExtractor { } return audioStreams.toArray(new VideoInfo.AudioStream[audioStreams.size()]); } + /**Provides information about links to other videos on the video page, such as related videos. * This is encapsulated in a VideoPreviewInfo object, * which is a subset of the fields in a full VideoInfo.*/