gpt4 book ai didi

at.huber.youtubeExtractor.YouTubeExtractor类的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 08:47:31 30 4
gpt4 key购买 nike

本文整理了Java中at.huber.youtubeExtractor.YouTubeExtractor类的一些代码示例,展示了YouTubeExtractor类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YouTubeExtractor类的具体详情如下:
包路径:at.huber.youtubeExtractor.YouTubeExtractor
类名称:YouTubeExtractor

YouTubeExtractor介绍

暂无

代码示例

代码示例来源:origin: Ashish-Bansal/OneTapVideoDownload

public static void startParsing(final Context context, String param, final Invokable<Video, Integer> invokable) {
    YouTubeExtractor mYoutubeExtractor = new YouTubeExtractor(context) {
      @Override
      public void onExtractionComplete(SparseArray<YtFile> ytFiles, VideoMeta vMeta) {
        if (ytFiles != null) {
          YoutubeVideo video = new YoutubeVideo(vMeta.getTitle(), vMeta.getVideoId());
          for(Pair p : YoutubeVideo.itagQualityMapping) {
            YtFile videoFormat = ytFiles.get(Integer.parseInt(p.first.toString()));
            if (videoFormat == null) {
              continue;
            }
            video.addFormat(videoFormat.getUrl(), Integer.parseInt(p.first.toString()));
          }

          try {
            invokable.invoke(video);
          } catch (java.lang.Exception e) {
            FirebaseCrash.report(e);
            e.printStackTrace();
          }
        } else {
          Log.e(TAG, "URLs are empty");
        }
      }
    };

    Log.v(TAG, YOUTUBE_URL_PREFIX + param);
    mYoutubeExtractor.extract(YOUTUBE_URL_PREFIX + param, false, true);
  }
}

代码示例来源:origin: HaarigerHarald/android-youtubeExtractor

/**
 * Start the extraction.
 *
 * @param youtubeLink       the youtube page link or video id
 * @param parseDashManifest true if the dash manifest should be downloaded and parsed
 * @param includeWebM       true if WebM streams should be extracted
 */
public void extract(String youtubeLink, boolean parseDashManifest, boolean includeWebM) {
  this.parseDashManifest = parseDashManifest;
  this.includeWebM = includeWebM;
  this.execute(youtubeLink);
}

代码示例来源:origin: HaarigerHarald/android-youtubeExtractor

@Override
protected void onPostExecute(SparseArray<YtFile> ytFiles) {
  onExtractionComplete(ytFiles, videoMeta);
}

代码示例来源:origin: HaarigerHarald/android-youtubeExtractor

SparseArray<String> encSignatures = null;
parseVideoMeta(streamMap);
    readDecipherFunctFromCache();
  String signature;
  decipheredSignature = null;
  if (decipherSignature(encSignatures)) {
    lock.lock();
    try {
    try {
      parseDashManifest(dashMpdUrl, ytFiles);
      break;
    } catch (IOException io) {

代码示例来源:origin: HaarigerHarald/android-youtubeExtractor

decipherViaWebView(encSignatures);
  if (CACHING) {
    writeDeciperFunctToChache();
decipherViaWebView(encSignatures);

代码示例来源:origin: HaarigerHarald/android-youtubeExtractor

@Override
protected SparseArray<YtFile> doInBackground(String... params) {
  videoID = null;
  String ytUrl = params[0];
  if (ytUrl == null) {
    return null;
  }
  Matcher mat = patYouTubePageLink.matcher(ytUrl);
  if (mat.find()) {
    videoID = mat.group(3);
  } else {
    mat = patYouTubeShortLink.matcher(ytUrl);
    if (mat.find()) {
      videoID = mat.group(3);
    } else if (ytUrl.matches("\\p{Graph}+?")) {
      videoID = ytUrl;
    }
  }
  if (videoID != null) {
    try {
      return getStreamUrls();
    } catch (Exception e) {
      e.printStackTrace();
    }
  } else {
    Log.e(LOG_TAG, "Wrong YouTube link format");
  }
  return null;
}

代码示例来源:origin: HaarigerHarald/android-youtubeExtractor

@Override
  public void run() {
    final YouTubeExtractor ytEx = new YouTubeExtractor(getInstrumentation()
        .getTargetContext()) {
      @Override
      public void  onExtractionComplete(SparseArray<YtFile> ytFiles, VideoMeta videoMeta) {
        assertEquals(expMeta.getVideoId(), videoMeta.getVideoId());
        assertEquals(expMeta.getTitle(),videoMeta.getTitle());
        assertEquals(expMeta.getAuthor(), videoMeta.getAuthor());
        assertEquals(expMeta.getChannelId(), videoMeta.getChannelId());
        assertEquals(expMeta.getVideoLength(), videoMeta.getVideoLength());
        assertNotSame(0, videoMeta.getViewCount());
        assertNotNull(ytFiles);
        int itag = ytFiles.keyAt(new Random().nextInt(ytFiles.size()));
        testUrl = ytFiles.get(itag).getUrl();
        Log.d(EXTRACTOR_TEST_TAG, "Testing itag: " + itag +", url:" + testUrl);
        signal.countDown();
      }
    };
    ytEx.extract(youtubeLink, false, true);
  }
});

代码示例来源:origin: HaarigerHarald/android-youtubeExtractor

@Override
  public void run() {
    final YouTubeExtractor ytEx = new YouTubeExtractor(getInstrumentation()
        .getTargetContext()) {
      @Override
      public void onExtractionComplete(SparseArray<YtFile> ytFiles, VideoMeta videoMeta) {
        assertNotNull(ytFiles);
        int numNotDash = 0;
        int itag;
        for (int i = 0; i < ytFiles.size(); i++) {
          itag = ytFiles.keyAt(i);
          if (ytFiles.get(itag).getFormat().isDashContainer()) {
            numNotDash = i;
            break;
          }
        }
        itag = ytFiles.keyAt(new Random().nextInt(ytFiles.size() - numNotDash) + numNotDash);
        testUrl = ytFiles.get(itag).getUrl();
        Log.d(EXTRACTOR_TEST_TAG, "Testing itag: " + itag +", url:" + testUrl);
        signal.countDown();
      }
    };
    ytEx.extract(youtubeLink, true, true);
  }
});

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com