AlphaSlayer1964 / kemono-dl

A simple kemono.party downloader using python.
503 stars 81 forks source link

Bypassing DDoS Guard #131

Open symmetryaktion opened 1 year ago

symmetryaktion commented 1 year ago

Version

Version: 2022.04.27

Your Command


python kemono-dl.py --inline --content --comments --extract-links --dms --icon --banner --cookies "cookies.txt" --links https://coomer.party/onlyfans/user/onlyfansusername

Description of bug

The program is assumed as a DDoS Attack when there's no update in the page. I'm running it so that the folder in my local computer is synced with the one on the site.

How To Reproduce

Just run the program again when it's all fully downloaded.

Error messages and tracebacks


Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Roaming\Python\Python310\site-packages\requests\models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Program Files\Python310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Python310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Administrator\Downloads\Compressed\kemono-dl-2022.04.27\src\main.py", line 641, in start_download
    self.get_post(url)
  File "C:\Users\Administrator\Downloads\Compressed\kemono-dl-2022.04.27\src\main.py", line 153, in get_post
    json = self.session.get(url=f"{api}?o={chunk}", cookies=self.cookies, headers=self.headers, timeout=self.timeout).json()
  File "C:\Users\Administrator\AppData\Roaming\Python\Python310\site-packages\requests\models.py", line 917, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: [Errno Expecting value] 
<!DOCTYPE html>
<html>
  <head>
    <title>DDOS-GUARD</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <script>
      var DOMReady = function (t) {
          var e = document,
            d = "addEventListener";
          e[d] ? e[d]("DOMContentLoaded", t) : window.attachEvent("onload", t);
        },
        loadScript = function (t, e) {
          var d = document.createElement("script");
          (d.type = "text/javascript"),
            (d.src = t),
            "string" == typeof e && "" !== e && (d.id = e),
            (
              document.getElementsByTagName("head")[0] || document.body
            ).appendChild(d);
        };
      DOMReady(function () {
        loadScript(
          "/.well-known/ddos-guard/check?context=free_splash",
          "ddg_script_f"
        ),
          loadScript("https://check.ddos-guard.net/check.js");
      });
    </script>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      body,
      html {
        font-family: Open Sans, Arial, Helvetica, sans-serif;
        height: 100%;
        background: linear-gradient(to top, #e5f3fb, #fff);
      }
      .logo {
        width: 120px;
        margin-bottom: 35px;
      }
      #title {
        font-size: 32px;
        font-weight: 900;
        margin-bottom: 40px;
      }
      #description {
        color: #8f9390;
        margin-bottom: 30px;
      }
      #link-ddg {
        white-space: nowrap;
        margin-bottom: 30px;
        font-size: 18px;
      }
      #link-ddg a:focus:active:hover:visited {
        color: #00adee;
      }
      #link-ddg a:active {
        color: #00adee;
      }
      #link-ddg a:hover {
        color: #00adee;
      }
      #link-ddg a:visited {
        color: #00adee;
      }
      .container {
        display: flex;
        display: -webkit-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100%;
        text-align: center;
        background: url(data:image/svg+xml;base64,PHN2ZyBpZD0i0KHQu9C+0LlfMSIgZGF0YS1uYW1lPSLQodC70L7QuSAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNjYuNzUgNDcuOTciPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojZmZmO308L3N0eWxlPjwvZGVmcz48dGl0bGU+0JzQvtC90YLQsNC20L3QsNGPINC+0LHQu9Cw0YHRgtGMIDE8L3RpdGxlPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTEzNS41NSwzOS44MmMtLjM4LDAtLjc1LDAtMS4xMywwYTE4LjkxLDE4LjkxLDAsMCwwLTM1LjMzLTQuNTNBMjUuMjYsMjUuMjYsMCwwLDAsNzcuMjEsMjIuN2MtLjgyLDAtMS42MywwLTIuNDMuMTJBMjkuMjYsMjkuMjYsMCwwLDAsMTcsMjkuMjZhMjkuNTksMjkuNTksMCwwLDAsLjE2LDNBMTguNTIsMTguNTIsMCwwLDAsMCw0OEgxNTAuNDNBMTcuNjQsMTcuNjQsMCwwLDAsMTM1LjU1LDM5LjgyWiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE1OS40OSw0NS40NUE5LjU4LDkuNTgsMCwwLDAsMTUzLDQ4aDEzQTkuNTgsOS41OCwwLDAsMCwxNTkuNDksNDUuNDVaIi8+PC9zdmc+)
          center bottom no-repeat;
      }
      .lds-spin {
        width: 80px;
        height: 80px;
      }
      @media screen and (max-width: 1200px) {
        .logo {
          width: 100px;
        }
        #title {
          font-size: 29px;
        }
        #link-ddg {
          font-size: 15px;
        }
        #link-ddg {
          font-size: 20px;
        }
      }
      @media screen and (max-width: 770px) {
        .logo {
          width: 70px;
          margin-bottom: 10px;
        }
        #title {
          font-size: 15px;
          margin-bottom: 10px;
        }
        #description {
          margin-bottom: 10px;
          font-size: 13px;
        }
        #link-ddg {
          margin-bottom: 10px;
          font-size: 13px;
        }
        .lds-spin {
          width: 40px;
          height: 40px;
        }
        #link-ddg {
          font-size: 18px;
        }
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="logo">
        <svg id="dl" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 6.62 7.69">
          <defs>
            <style>
              .cls-1 {
                isolation: isolate;
              }
              .cls-2 {
                fill: #00adee;
              }
              .cls-3 {
                fill: #fff;
              }
            </style>
          </defs>
          <title>ddos_3</title>
          <g id="_2560" data-name="2560" class="cls-1">
            <g id="G2" data-name="Gr2">
              <path
                class="cls-2"
                d="M3.3,0A6,6,0,0,1,0,1.91C.13,4.46,1.6,7.49,3.3,7.65,5,7.49,6.47,4.46,6.6,1.91A6,6,0,0,1,3.3,0Z"
              />
              <polygon
                class="cls-3"
                points="4.55 4.73 4.55 2.74 3.29 1.79 2.03 2.71 2.03 2.91 3.25 2.2 3.25 2.59 2.03 3.16 2.03 3.4 3.25 2.95 3.25 3.26 2.03 3.66 2.03 3.91 3.25 3.66 3.25 4.01 2.03 4.18 2.03 4.43 3.25 4.36 3.25 4.73 1.89 4.73 1.89 5.09 4.71 5.09 4.71 4.73 4.55 4.73"
              />
            </g>
          </g>
        </svg>
      </div>
      <div id="title"></div>
      <div id="description"></div>
      <div id="link-ddg">
        <a href="https://ddos-guard.net" target="_blank" id="link"></a>
      </div>
      <div class="lds">
        <svg
          class="lds-spin"
          width="100px"
          height="100px"
          xmlns="http://www.w3.org/2000/svg"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          viewbox="0 0 100 100"
          preserveaspectratio="xMidYMid"
          style="background: none"
        >
          <g transform="translate(80,50)">
            <g transform="rotate(0)">
              <circle
                cx="0"
                cy="0"
                r="10"
                fill="#00adee"
                fill-opacity="1"
                transform="scale(0.7525 0.7525)"
              >
                <animatetransform
                  attributename="transform"
                  type="scale"
                  begin="-0.875s"
                  values="0.7 0.7;1 1"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                />
                <animate
                  attributename="fill-opacity"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                  values="1;0"
                  begin="-0.875s"
                />
              </circle>
            </g>
          </g>
          <g transform="translate(71.21320343559643,71.21320343559643)">
            <g transform="rotate(45)">
              <circle
                cx="0"
                cy="0"
                r="10"
                fill="#00adee"
                fill-opacity="0.875"
                transform="scale(0.715 0.715)"
              >
                <animatetransform
                  attributename="transform"
                  type="scale"
                  begin="-0.75s"
                  values="0.7 0.7;1 1"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                />
                <animate
                  attributename="fill-opacity"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                  values="1;0"
                  begin="-0.75s"
                />
              </circle>
            </g>
          </g>
          <g transform="translate(50,80)">
            <g transform="rotate(90)">
              <circle
                cx="0"
                cy="0"
                r="10"
                fill="#00adee"
                fill-opacity="0.75"
                transform="scale(0.9775 0.9775)"
              >
                <animatetransform
                  attributename="transform"
                  type="scale"
                  begin="-0.625s"
                  values="0.7 0.7;1 1"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                />
                <animate
                  attributename="fill-opacity"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                  values="1;0"
                  begin="-0.625s"
                />
              </circle>
            </g>
          </g>
          <g transform="translate(28.786796564403577,71.21320343559643)">
            <g transform="rotate(135)">
              <circle
                cx="0"
                cy="0"
                r="10"
                fill="#00adee"
                fill-opacity="0.625"
                transform="scale(0.94 0.94)"
              >
                <animatetransform
                  attributename="transform"
                  type="scale"
                  begin="-0.5s"
                  values="0.7 0.7;1 1"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                />
                <animate
                  attributename="fill-opacity"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                  values="1;0"
                  begin="-0.5s"
                />
              </circle>
            </g>
          </g>
          <g transform="translate(20,50.00000000000001)">
            <g transform="rotate(180)">
              <circle
                cx="0"
                cy="0"
                r="10"
                fill="#00adee"
                fill-opacity="0.5"
                transform="scale(0.9025 0.9025)"
              >
                <animatetransform
                  attributename="transform"
                  type="scale"
                  begin="-0.375s"
                  values="0.7 0.7;1 1"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                />
                <animate
                  attributename="fill-opacity"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                  values="1;0"
                  begin="-0.375s"
                />
              </circle>
            </g>
          </g>
          <g transform="translate(28.78679656440357,28.786796564403577)">
            <g transform="rotate(225)">
              <circle
                cx="0"
                cy="0"
                r="10"
                fill="#00adee"
                fill-opacity="0.375"
                transform="scale(0.865 0.865)"
              >
                <animatetransform
                  attributename="transform"
                  type="scale"
                  begin="-0.25s"
                  values="0.7 0.7;1 1"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                />
                <animate
                  attributename="fill-opacity"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                  values="1;0"
                  begin="-0.25s"
                />
              </circle>
            </g>
          </g>
          <g transform="translate(49.99999999999999,20)">
            <g transform="rotate(270)">
              <circle
                cx="0"
                cy="0"
                r="10"
                fill="#00adee"
                fill-opacity="0.25"
                transform="scale(0.8275 0.8275)"
              >
                <animatetransform
                  attributename="transform"
                  type="scale"
                  begin="-0.125s"
                  values="0.7 0.7;1 1"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                />
                <animate
                  attributename="fill-opacity"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                  values="1;0"
                  begin="-0.125s"
                />
              </circle>
            </g>
          </g>
          <g transform="translate(71.21320343559643,28.78679656440357)">
            <g transform="rotate(315)">
              <circle
                cx="0"
                cy="0"
                r="10"
                fill="#00adee"
                fill-opacity="0.125"
                transform="scale(0.79 0.79)"
              >
                <animatetransform
                  attributename="transform"
                  type="scale"
                  begin="0s"
                  values="0.7 0.7;1 1"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                />
                <animate
                  attributename="fill-opacity"
                  keytimes="0;1"
                  dur="1s"
                  repeatcount="indefinite"
                  values="1;0"
                  begin="0s"
                />
              </circle>
            </g>
          </g>
        </svg>
      </div>
    </div>
    <script type="text/javascript">
      var lang = navigator.language,
        host = window.location.hostname;
      "ru" == lang || "ru-RU" == lang
        ? ((document.getElementById("title").innerHTML =
            "Проверка браузера перед переходом на сайт " + host),
          (document.getElementById("description").innerHTML =
            "Это автоматический процесс. Вы будете перенаправлены на запрашиваемый ресурс в ближайшее время.<br>Пожалуйста ожидайте..."),
          (document.getElementById("link").innerHTML =
            "Защита от DDoS-атак DDoS-GUARD"))
        : ((document.getElementById("title").innerHTML =
            "Checking your browser accessing " + host),
          (document.getElementById("description").innerHTML =
            "This process is automatic. Your browser will redirect to your requested content shortly.<br>Please allow up to 5 seconds..."),
          (document.getElementById("link").innerHTML =
            "DDoS protection by DDoS-GUARD"));
    </script>
  </body>
</html>

Additional comments

Is there any feature that gives a delay before each time the program downloading the post? Like a delay of 5s between each post(s) so that it won't be detected as an DDoS attack.

afterdelight commented 1 year ago

yes, there is

symmetryaktion commented 1 year ago

yes, there is

AFAIK, the delay is for ratelimited downloads, not when the file is already exists, and go to the next one. Sorry if I wasn't make myself clear enough