fiexed some licence headers
This commit is contained in:
parent
f8ed96bb25
commit
9204a89319
|
@ -22,7 +22,7 @@ import org.schabi.newpipe.crawler.VideoInfo;
|
|||
/**
|
||||
* Created by Christian Schabesberger on 18.08.15.
|
||||
*
|
||||
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
|
||||
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
|
||||
* DetailsMenuHandler.java is part of NewPipe.
|
||||
*
|
||||
* NewPipe is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -13,7 +13,7 @@ import info.guardianproject.netcipher.NetCipher;
|
|||
/**
|
||||
* Created by Christian Schabesberger on 28.01.16.
|
||||
*
|
||||
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
|
||||
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
|
||||
* Downloader.java is part of NewPipe.
|
||||
*
|
||||
* NewPipe is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -2,12 +2,29 @@ package org.schabi.newpipe.crawler;
|
|||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
/**
|
||||
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**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 = "";
|
||||
|
|
|
@ -3,7 +3,7 @@ package org.schabi.newpipe.crawler;
|
|||
/**
|
||||
* Created by Christian Schabesberger on 28.01.16.
|
||||
*
|
||||
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
|
||||
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
|
||||
* Downloader.java is part of NewPipe.
|
||||
*
|
||||
* NewPipe is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -6,7 +6,7 @@ package org.schabi.newpipe.crawler;
|
|||
* Copyright (c) Christian Schabesberger <chris.schabesberger@mailbox.org>
|
||||
* and Adam Howard <achdisposable1@gmail.com> 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
|
||||
|
|
|
@ -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<VideoInfo.VideoStream> 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<String, String> 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.*/
|
||||
|
|
Loading…
Reference in New Issue