From d3624aef8c73c4dd21735605597c7e7a7d5baf9d Mon Sep 17 00:00:00 2001 From: jiaz Date: Wed, 21 Aug 2024 08:46:18 +0000 Subject: [PATCH] git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@49618 ebf7c1c2-ba36-0410-9fe8-c592906822b4 Former-commit-id: 3a892030b4dca35717104b27d65e406ed4c6c4c1 --- .../decrypter/GenericM3u8Decrypter.java | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/jd/plugins/decrypter/GenericM3u8Decrypter.java b/src/jd/plugins/decrypter/GenericM3u8Decrypter.java index 96d382374a..49d964e45f 100644 --- a/src/jd/plugins/decrypter/GenericM3u8Decrypter.java +++ b/src/jd/plugins/decrypter/GenericM3u8Decrypter.java @@ -23,18 +23,6 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import org.appwork.utils.Regex; -import org.appwork.utils.StringUtils; -import org.appwork.utils.encoding.URLEncode; -import org.appwork.utils.formatter.HexFormatter; -import org.jdownloader.downloader.hls.M3U8Playlist; -import org.jdownloader.plugins.components.config.GenericM3u8DecrypterConfig; -import org.jdownloader.plugins.components.config.GenericM3u8DecrypterConfig.CrawlSpeedMode; -import org.jdownloader.plugins.components.hls.HlsContainer; -import org.jdownloader.plugins.components.hls.HlsContainer.StreamCodec; -import org.jdownloader.plugins.config.PluginJsonConfig; -import org.jdownloader.plugins.controller.LazyPlugin.FEATURE; - import jd.PluginWrapper; import jd.controlling.ProgressController; import jd.controlling.linkcrawler.CrawledLink; @@ -54,6 +42,18 @@ import jd.plugins.PluginException; import jd.plugins.PluginForDecrypt; import jd.plugins.hoster.GenericM3u8; +import org.appwork.utils.Regex; +import org.appwork.utils.StringUtils; +import org.appwork.utils.encoding.URLEncode; +import org.appwork.utils.formatter.HexFormatter; +import org.jdownloader.downloader.hls.M3U8Playlist; +import org.jdownloader.plugins.components.config.GenericM3u8DecrypterConfig; +import org.jdownloader.plugins.components.config.GenericM3u8DecrypterConfig.CrawlSpeedMode; +import org.jdownloader.plugins.components.hls.HlsContainer; +import org.jdownloader.plugins.components.hls.HlsContainer.StreamCodec; +import org.jdownloader.plugins.config.PluginJsonConfig; +import org.jdownloader.plugins.controller.LazyPlugin.FEATURE; + @DecrypterPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "m3u8" }, urls = { "(https?://.+\\.m3u8|m3u8://https?://.*)($|(?:\\?|%3F)[^\\s<>\"']*|#.*)" }) public class GenericM3u8Decrypter extends PluginForDecrypt { @Override @@ -89,7 +89,7 @@ public class GenericM3u8Decrypter extends PluginForDecrypt { if (!StringUtils.equals(source.getURL(), param.getCryptedUrl())) { if (source instanceof BrowserCrawledLink) { refererURL = source.getURL(); - br = ((BrowserCrawledLink) source).getBrowser().cloneBrowser(); + br = ((BrowserCrawledLink) source).cloneBrowser(); logger.info("Reuse BrowserCrawledLink browser: " + br.getURL()); } else if (source.getCryptedLink() != null) { try { @@ -222,9 +222,8 @@ public class GenericM3u8Decrypter extends PluginForDecrypt { if (hls.getAverageBandwidth() > 0 || hls.getBandwidth() > 0) { if (estimatedDurationMillis == null) { /** - * Load first item to get the estimated play-duration which we expect to be the same for all items.
- * Based on this we can set estimated filesizes while at the same time providing a super fast crawling - * experience. + * Load first item to get the estimated play-duration which we expect to be the same for all items.
Based + * on this we can set estimated filesizes while at the same time providing a super fast crawling experience. */ final List playlist = hls.getM3U8(br); estimatedDurationMillis = M3U8Playlist.getEstimatedDuration(playlist);