Skip to content

Commit 2af68a2

Browse files
author
updating-bot
committed
mirroring bot - 2025/07/08
1 parent 2fc39b0 commit 2af68a2

File tree

12 files changed

+601
-92
lines changed

12 files changed

+601
-92
lines changed

svn_trunk/src/jd/controlling/faviconcontroller/FavIcons.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,15 @@ public static Icon getFavIcon(String host, FavIconRequestor requestor, boolean u
170170
}
171171
if (image != null) {
172172
try {
173-
if (REFRESHED_ICONS.add(host)) {
173+
refreshIcon: if (REFRESHED_ICONS.add(host)) {
174174
if ("file".equalsIgnoreCase(url.getProtocol())) {
175175
final File file = new File(url.toURI());
176+
if (file.isFile() && !file.canWrite()) {
177+
// do not refresh write protected files
178+
break refreshIcon;
179+
}
176180
final long lastModified = file.lastModified();
177-
if ((lastModified > 0 && System.currentTimeMillis() - lastModified > REFRESH_TIMEOUT) && file.exists()) {
181+
if ((lastModified > 0 && System.currentTimeMillis() - lastModified > REFRESH_TIMEOUT) && file.isFile()) {
178182
file.setLastModified(System.currentTimeMillis());// avoid retry before expired
179183
if (updatePermission) {
180184
add(host, requestor);

svn_trunk/src/jd/plugins/decrypter/EightChanMoe.java

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import jd.controlling.ProgressController;
2828
import jd.http.Browser;
2929
import jd.http.Cookie;
30+
import jd.http.Request;
3031
import jd.parser.Regex;
3132
import jd.plugins.CryptedLink;
3233
import jd.plugins.DecrypterPlugin;
@@ -42,9 +43,10 @@
4243
import org.appwork.storage.TypeRef;
4344
import org.appwork.utils.StringUtils;
4445
import org.jdownloader.plugins.components.config.EightChanMoeConfig;
46+
import org.jdownloader.plugins.components.config.EightChanMoeConfig.POSTANCHORMODE;
4547
import org.jdownloader.plugins.config.PluginJsonConfig;
4648

47-
@DecrypterPlugin(revision = "$Revision: 51151 $", interfaceVersion = 2, names = {}, urls = {})
49+
@DecrypterPlugin(revision = "$Revision: 51187 $", interfaceVersion = 2, names = {}, urls = {})
4850
public class EightChanMoe extends PluginForDecrypt {
4951
/**
5052
* https://gitgud.io/LynxChan/LynxChan/-/blob/master/doc/Json.txt
@@ -91,14 +93,22 @@ public int getMaxConcurrentProcessingInstances() {
9193
}
9294

9395
private static final String TYPE_THREAD = "https?://([^/]+)/([^/]+)/res/(\\d+)\\.html(#q?(\\d+))?";
96+
private EightChanMoeConfig config = null;
9497

9598
public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress) throws Exception {
99+
config = PluginJsonConfig.get(this.getConfigInterface());
96100
if (param.getCryptedUrl().matches(TYPE_THREAD)) {
97101
return crawlSingleThreadAPI(param);
98102
}
99103
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
100104
}
101105

106+
@Override
107+
public void clean() {
108+
super.clean();
109+
config = null;
110+
}
111+
102112
private Browser prepBrAPI(final Browser br) {
103113
br.setFollowRedirects(true);
104114
br.getHeaders().put("User-Agent", "JDownloader");
@@ -135,7 +145,7 @@ private void getPage(Browser br, String url) throws PluginException, IOException
135145
}
136146

137147
private List<DownloadLink> parseFiles(final Browser br, List<Map<String, Object>> files) throws PluginException, IOException {
138-
final boolean preferServerFilenames = PluginJsonConfig.get(this.getConfigInterface()).isPreferServerFilenamesOverPluginDefaultFilenames();
148+
final boolean preferServerFilenames = config.isPreferServerFilenamesOverPluginDefaultFilenames();
139149
final ArrayList<DownloadLink> ret = new ArrayList<DownloadLink>();
140150
if (files == null || files.size() == 0) {
141151
return ret;
@@ -162,17 +172,17 @@ private List<DownloadLink> parseFiles(final Browser br, List<Map<String, Object>
162172
return ret;
163173
}
164174

165-
private ArrayList<DownloadLink> crawlSingleThreadAPI(final CryptedLink param) throws IOException, PluginException, DecrypterRetryException {
175+
private ArrayList<DownloadLink> parseResponse(final CryptedLink param, final Request request, POSTANCHORMODE postMode) throws IOException, PluginException, DecrypterRetryException {
166176
final String boardDomain = new Regex(param.getCryptedUrl(), TYPE_THREAD).getMatch(0);
167177
final String boardShort = new Regex(param.getCryptedUrl(), TYPE_THREAD).getMatch(1);
168178
final String threadID = new Regex(param.getCryptedUrl(), TYPE_THREAD).getMatch(2);
169-
final String requestedPostId = new Regex(param.getCryptedUrl(), TYPE_THREAD).getMatch(4);
179+
String requestedPostId = new Regex(param.getCryptedUrl(), TYPE_THREAD).getMatch(4);
180+
if (POSTANCHORMODE.THREAD.equals(postMode)) {
181+
requestedPostId = null;
182+
}
170183
if (boardDomain == null || boardShort == null || threadID == null) {
171184
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
172-
}
173-
prepBrAPI(this.br);
174-
getPage(br, "https://" + boardDomain + "/" + boardShort + "/res/" + threadID + ".json");
175-
if (br.getHttpConnection().getResponseCode() == 404) {
185+
} else if (br.getHttpConnection().getResponseCode() == 404) {
176186
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
177187
}
178188
final ArrayList<DownloadLink> ret = new ArrayList<DownloadLink>();
@@ -195,13 +205,7 @@ private ArrayList<DownloadLink> crawlSingleThreadAPI(final CryptedLink param) th
195205
ret.addAll(postItems);
196206
}
197207
}
198-
if (ret.size() == 0) {
199-
if (requestedPostId != null) {
200-
throw new DecrypterRetryException(RetryReason.EMPTY_FOLDER, "EMPTY_THREAD_POST" + threadID + "_" + requestedPostId, "Thread " + threadID + " doesn't contain any media for post " + requestedPostId);
201-
} else {
202-
throw new DecrypterRetryException(RetryReason.EMPTY_FOLDER, "EMPTY_THREAD" + threadID, "Thread " + threadID + " doesn't contain any media");
203-
}
204-
} else {
208+
if (ret.size() > 0) {
205209
final FilePackage fp = FilePackage.getInstance();
206210
if (requestedPostId != null) {
207211
fp.setName(getHost() + " - " + boardName + " - " + threadID + " - " + requestedPostId);
@@ -213,6 +217,31 @@ private ArrayList<DownloadLink> crawlSingleThreadAPI(final CryptedLink param) th
213217
return ret;
214218
}
215219

220+
private ArrayList<DownloadLink> crawlSingleThreadAPI(final CryptedLink param) throws IOException, PluginException, DecrypterRetryException {
221+
final String boardDomain = new Regex(param.getCryptedUrl(), TYPE_THREAD).getMatch(0);
222+
final String boardShort = new Regex(param.getCryptedUrl(), TYPE_THREAD).getMatch(1);
223+
final String threadID = new Regex(param.getCryptedUrl(), TYPE_THREAD).getMatch(2);
224+
final String requestedPostId = new Regex(param.getCryptedUrl(), TYPE_THREAD).getMatch(4);
225+
if (boardDomain == null || boardShort == null || threadID == null) {
226+
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
227+
}
228+
prepBrAPI(this.br);
229+
getPage(br, "https://" + boardDomain + "/" + boardShort + "/res/" + threadID + ".json");
230+
final POSTANCHORMODE postMode = config.getPostAnchorMode();
231+
ArrayList<DownloadLink> ret = parseResponse(param, br.getRequest(), postMode);
232+
if (ret.size() == 0 && POSTANCHORMODE.POST_OR_THREAD.equals(postMode)) {
233+
ret = parseResponse(param, br.getRequest(), POSTANCHORMODE.THREAD);
234+
}
235+
if (ret.size() == 0) {
236+
if (requestedPostId != null) {
237+
throw new DecrypterRetryException(RetryReason.EMPTY_FOLDER, "EMPTY_THREAD_POST" + threadID + "_" + requestedPostId, "Thread " + threadID + " doesn't contain any media for post " + requestedPostId);
238+
} else {
239+
throw new DecrypterRetryException(RetryReason.EMPTY_FOLDER, "EMPTY_THREAD" + threadID, "Thread " + threadID + " doesn't contain any media");
240+
}
241+
}
242+
return ret;
243+
}
244+
216245
public boolean hasCaptcha(CryptedLink link, jd.plugins.Account acc) {
217246
return false;
218247
}

svn_trunk/src/jd/plugins/decrypter/PornflipComCrawler.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
import jd.plugins.hoster.PornflipCom;
4949
import jd.utils.JDUtilities;
5050

51-
@DecrypterPlugin(revision = "$Revision: 47708 $", interfaceVersion = 3, names = { "playvids.com", "pornflip.com" }, urls = { "https?://(?:www\\.)?playvids\\.com/(?:[a-z]{2}/)?v/[A-Za-z0-9\\-_]+|https?://(?:www\\.)?playvids\\.com/(?:[a-z]{2}/)?[A-Za-z0-9\\-_]+/[A-Za-z0-9\\-_]+", "https?://(?:www\\.)?pornflip\\.com/(?:[a-z]{2}/)?v/[A-Za-z0-9\\-_]+|https?://(?:www\\.)?pornflip\\.com/(?:[a-z]{2}/)?[A-Za-z0-9\\-_]+/[A-Za-z0-9\\-_]+" })
51+
@DecrypterPlugin(revision = "$Revision: 51184 $", interfaceVersion = 3, names = { "playvids.com", "pornflip.com" }, urls = { "https?://(?:www\\.)?playvids\\.com/(?:[a-z]{2}/)?v/[A-Za-z0-9\\-_]+|https?://(?:www\\.)?playvids\\.com/(?:[a-z]{2}/)?[A-Za-z0-9\\-_]+/[A-Za-z0-9\\-_]+", "https?://(?:www\\.)?pornflip\\.com/(?:[a-z]{2}/)?v/[A-Za-z0-9\\-_]+|https?://(?:www\\.)?pornflip\\.com/(?:[a-z]{2}/)?[A-Za-z0-9\\-_]+/[A-Za-z0-9\\-_]+" })
5252
public class PornflipComCrawler extends PluginForDecrypt {
5353
public PornflipComCrawler(PluginWrapper wrapper) {
5454
super(wrapper);
@@ -76,7 +76,7 @@ public int getMaxConcurrentProcessingInstances() {
7676

7777
@SuppressWarnings({ "static-access", "deprecation" })
7878
public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressController progress) throws Exception {
79-
final ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
79+
final ArrayList<DownloadLink> crawledlinks = new ArrayList<DownloadLink>();
8080
videoID = new Regex(param.getCryptedUrl(), "(?:watch(?:\\?v=|/)|embed/|v/)([A-Za-z0-9\\-_]+)").getMatch(0);
8181
if (videoID == null) {
8282
videoID = new Regex(param.getCryptedUrl(), "https?://[^/]+/(?:[a-z]{2})?([A-Za-z0-9\\-_]+)").getMatch(0);
@@ -196,7 +196,7 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
196196
for (List<DownloadLink> list : results.values()) {
197197
for (DownloadLink link : list) {
198198
fp.add(link);
199-
decryptedLinks.add(link);
199+
crawledlinks.add(link);
200200
final String qualityStr = new Regex(link.getFinalFileName(), "(\\d+)\\.mp4").getMatch(0);
201201
if (qualityStr != null) {
202202
final int qualityTmp = Integer.parseInt(qualityStr);
@@ -208,10 +208,10 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
208208
}
209209
}
210210
if (best && bestDownloadurl != null) {
211-
decryptedLinks.clear();
212-
decryptedLinks.add(bestDownloadurl);
211+
crawledlinks.clear();
212+
crawledlinks.add(bestDownloadurl);
213213
}
214-
return decryptedLinks;
214+
return crawledlinks;
215215
}
216216

217217
@SuppressWarnings("deprecation")
@@ -301,9 +301,7 @@ private void getPage(final String url) throws Exception {
301301
}
302302
}
303303

304-
/**
305-
* JD2 CODE: DO NOIT USE OVERRIDE FÒR COMPATIBILITY REASONS!!!!!
306-
*/
304+
@Override
307305
public boolean isProxyRotationEnabledForLinkCrawler() {
308306
return false;
309307
}
@@ -324,7 +322,7 @@ private boolean getUserLogin(final boolean force) throws Exception {
324322
return true;
325323
}
326324

327-
/* NO OVERRIDE!! */
325+
@Override
328326
public boolean hasCaptcha(CryptedLink link, jd.plugins.Account acc) {
329327
return false;
330328
}

svn_trunk/src/jd/plugins/hoster/LulustreamCom.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
import java.util.ArrayList;
2121
import java.util.List;
2222

23+
import org.appwork.utils.Regex;
24+
import org.appwork.utils.StringUtils;
25+
import org.jdownloader.plugins.components.XFileSharingProBasic;
26+
2327
import jd.PluginWrapper;
2428
import jd.http.Browser;
2529
import jd.plugins.Account;
2630
import jd.plugins.Account.AccountType;
2731
import jd.plugins.DownloadLink;
2832
import jd.plugins.HostPlugin;
2933

30-
import org.appwork.utils.Regex;
31-
import org.appwork.utils.StringUtils;
32-
import org.jdownloader.plugins.components.XFileSharingProBasic;
33-
34-
@HostPlugin(revision = "$Revision: 51061 $", interfaceVersion = 3, names = {}, urls = {})
34+
@HostPlugin(revision = "$Revision: 51188 $", interfaceVersion = 3, names = {}, urls = {})
3535
public class LulustreamCom extends XFileSharingProBasic {
3636
public LulustreamCom(final PluginWrapper wrapper) {
3737
super(wrapper);
@@ -56,6 +56,7 @@ public static List<String[]> getPluginDomains() {
5656
protected List<String> getDeadDomains() {
5757
final ArrayList<String> deadDomains = new ArrayList<String>();
5858
deadDomains.add("tnmr.org");
59+
deadDomains.add("luluvdo.com");
5960
return deadDomains;
6061
}
6162

0 commit comments

Comments
 (0)