git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@49618 ebf7c1c2-ba36-0410-9fe8-c592906822b4

Former-commit-id: 3a892030b4dca35717104b27d65e406ed4c6c4c1
This commit is contained in:
jiaz 2024-08-21 08:46:18 +00:00
parent 1908911b40
commit d3624aef8c

View File

@ -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. </br>
* 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. </br> Based
* on this we can set estimated filesizes while at the same time providing a super fast crawling experience.
*/
final List<M3U8Playlist> playlist = hls.getM3U8(br);
estimatedDurationMillis = M3U8Playlist.getEstimatedDuration(playlist);