@@ -640,7 +640,7 @@ private static void waitForPageAccess(final Browser browser, final Request reque
640640 private String acceptLanguage = "de, en-gb;q=0.9, en;q=0.8" ;
641641 /*
642642 * -1 means use default Timeouts
643- *
643+ *
644644 * 0 means infinite (DO NOT USE if not needed)
645645 */
646646 private int connectTimeout = -1 ;
@@ -964,10 +964,10 @@ public PostFormDataRequest createPostFormDataRequest(String url) throws IOExcept
964964 /**
965965 * Creates a new postrequest based an an requestVariable ArrayList
966966 *
967- * @deprecated use {@link #createPostRequest(String, UrlQuery, String)
967+ * @deprecated use {@link #createPostRequest(String, UrlQuery, String)
968+ *
968969 *
969970 *
970- *
971971 */
972972 @ Deprecated
973973 public PostRequest createPostRequest (String url , final List <KeyValueStringEntry > post , final String encoding ) throws IOException {
@@ -1780,8 +1780,8 @@ protected void mergeHeaders(final Request request) {
17801780 }
17811781
17821782 /**
1783- * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Site </br>
1784- * auto completes Sec-Fetch-Site, some websites(eg facebook) check it
1783+ * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Site </br> auto completes Sec-Fetch-Site, some websites(eg
1784+ * facebook) check it
17851785 */
17861786 protected void autoCompleteHeaders (final Request request ) {
17871787 if (request != null ) {
@@ -2439,8 +2439,7 @@ public void setKeepResponseContentBytes(final boolean keepResponseContentBytes)
24392439 }
24402440
24412441 /**
2442- * Sets Browser upper page load limit Byte value. </br>
2443- * Use Integer.MAX_VALUE for "unlimited" (do not use "-1"!).
2442+ * Sets Browser upper page load limit Byte value. </br> Use Integer.MAX_VALUE for "unlimited" (do not use "-1"!).
24442443 *
24452444 * @since JD2
24462445 * @param i
@@ -2585,8 +2584,7 @@ protected void prepareBlockDetectionBeforeLoadConnection(final Request request)
25852584 }
25862585
25872586 /**
2588- * Checks for block by firewalls and similar. </br>
2589- * To be called after a sent request.
2587+ * Checks for block by firewalls and similar. </br> To be called after a sent request.
25902588 */
25912589 public void checkForBlockedByAfterLoadConnection (Request request ) throws IOException {
25922590 if (this .getThrowExceptionOnBlockedBy (request )) {
@@ -2615,11 +2613,9 @@ protected static CloudflareBlockedType getCloudflareBlock(Browser browser, Reque
26152613 final boolean isCloudflareServer = StringUtils .containsIgnoreCase (request .getResponseHeader (HTTPConstants .HEADER_RESPONSE_SERVER ), "cloudflare" );
26162614 final boolean isTypicalCloudflareResponseCode = con .getResponseCode () == 403 || con .getResponseCode () == 502 || con .getResponseCode () == 503 || con .getResponseCode () == 429 || con .getResponseCode () == 522 || con .getResponseCode () == 523 || con .getResponseCode () == 526 ;
26172615 /* 526: Invalid SSL certificate */
2618-
26192616 /**
26202617 * TODO: 2023-12-21: Maybe remove reliance on http status-code as it looks like literally any status code can be returned when a
2621- * Cloudflare block happens. </br>
2622- * I've just added code 502 to the list of "Cloudflare response-codes".
2618+ * Cloudflare block happens. </br> I've just added code 502 to the list of "Cloudflare response-codes".
26232619 */
26242620 /*
26252621 * It is really important to also check for Cloudflare html else stuff will fail/break e.g. icerbox.com wrong login -> Cloudflare
@@ -2930,6 +2926,41 @@ public Boolean prepareBlockDetection(Browser browser, Request request) {
29302926 return null ;
29312927 }
29322928 },
2929+ DNS_BLOCK_OPENDNS {
2930+ @ Override
2931+ public String getLabel () {
2932+ return "DNS block by opendns.com" ;
2933+ }
2934+
2935+ @ Override
2936+ public BlockedTypeInterface isBlocked (Browser browser , Request request ) {
2937+ final HTTPConnection con ;
2938+ if (request == null || !request .isLoaded () || (con = request .getHttpConnection ()) == null ) {
2939+ return null ;
2940+ } else if (con .getResponseCode () == 403 ) {
2941+ // <html><head><script type="text/javascript">location.replace("https://block.opendns.com/?url=
2942+ if (request .containsHTML ("(?i)block\\ .opendns\\ .com/\\ ?url=" )) {
2943+ return this ;
2944+ }
2945+ }
2946+ return null ;
2947+ }
2948+
2949+ @ Override
2950+ public BlockLevelType getBlockLevelType () {
2951+ return BlockLevelType .DNS ;
2952+ }
2953+
2954+ @ Override
2955+ public BlockSourceType getBlockSourceType () {
2956+ return BlockSourceType .SERVICE ;
2957+ }
2958+
2959+ @ Override
2960+ public Boolean prepareBlockDetection (Browser browser , Request request ) {
2961+ return null ;
2962+ }
2963+ },
29332964 SHIELD_SQUARE {
29342965 @ Override
29352966 public String getLabel () {
@@ -3141,8 +3172,8 @@ public BlockedTypeInterface isBlocked(Browser browser, Request request) {
31413172 return null ;
31423173 }
31433174 if (true ) { /*
3144- * TODO: Add header based detection too -> At least check "server" header so we do not only rely on html code.
3145- */
3175+ * TODO: Add header based detection too -> At least check "server" header so we do not only rely on html code.
3176+ */
31463177 /* See new ESET NOD32 html code 2023: https://board.jdownloader.org/showthread.php?t=91433 */
31473178 return null ;
31483179 } else if (request .containsHTML ("<div class\\ s*=\\ s*\" prodhead\" >\\ s*<div class\\ s*=\\ s*\" logoimg\" >\\ s*<span class\\ s*=\\ s*\" logotxt\" >\\ s*ESET NOD32 Antivirus\\ s*</span>\\ s*</div>\\ s*</div>" ) && request .containsHTML ("- ESET NOD32 Antivirus\\ s*</title>" )) {
@@ -3325,8 +3356,8 @@ public BlockedTypeInterface getBlockedType(final Request request) {
33253356 }
33263357
33273358 /**
3328- * Returns true if any antiddos provider/other sort of blocking is blocking at this moment. </br>
3329- * See also: https://svn.jdownloader.org/issues/89834
3359+ * Returns true if any antiddos provider/other sort of blocking is blocking at this moment. </br> See also:
3360+ * https://svn.jdownloader.org/issues/89834
33303361 */
33313362 public boolean isBlocked () {
33323363 final Request request = this .getRequest ();
0 commit comments