justfoolingaround / animdl

A highly efficient, fast, powerful and light-weight anime downloader and streamer for your favorite anime.
GNU General Public License v3.0
1.32k stars 108 forks source link

AnimePahe is broken #299

Open Suboms opened 9 months ago

Suboms commented 9 months ago

AnimePahe is not working. Below is the error message I receive every time I use the following.

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in _run_module_as_main:198                                                                       │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │   alter_argv = False                                                                         │ │
│ │         code = <code object <module> at 0x0000025CAA335730, file                             │ │
│ │                "C:\Users\Olasubomi\AppData\Roaming\Python\Python311\Scripts\animdl.exe\__ma… │ │
│ │                line 1>                                                                       │ │
│ │ main_globals = {                                                                             │ │
│ │                │   '__name__': '__main__',                                                   │ │
│ │                │   '__doc__': None,                                                          │ │
│ │                │   '__package__': '',                                                        │ │
│ │                │   '__loader__': <zipimporter object                                         │ │
│ │                "C:\Users\Olasubomi\AppData\Roaming\Python\Python311\Scripts\animdl.exe\">,   │ │
│ │                │   '__spec__': ModuleSpec(name='__main__', loader=<zipimporter object        │ │
│ │                "C:\Users\Olasubomi\AppData\Roaming\Python\Python311\Scripts\animdl.exe\">,   │ │
│ │                origin='C:\\Users\\Olasubomi\\AppData\\Roaming\\Python\\Python311\\Scripts\\… │ │
│ │                │   '__annotations__': {},                                                    │ │
│ │                │   '__builtins__': <module 'builtins' (built-in)>,                           │ │
│ │                │   '__file__':                                                               │ │
│ │                'C:\\Users\\Olasubomi\\AppData\\Roaming\\Python\\Python311\\Scripts\\animdl.… │ │
│ │                │   '__cached__':                                                             │ │
│ │                'C:\\Users\\Olasubomi\\AppData\\Roaming\\Python\\Python311\\Scripts\\animdl.… │ │
│ │                │   're': <module 're' from 'C:\\Python311\\Lib\\re\\__init__.py'>,           │ │
│ │                │   ... +2                                                                    │ │
│ │                }                                                                             │ │
│ │     mod_name = '__main__'                                                                    │ │
│ │     mod_spec = ModuleSpec(name='__main__', loader=<zipimporter object                        │ │
│ │                "C:\Users\Olasubomi\AppData\Roaming\Python\Python311\Scripts\animdl.exe\">,   │ │
│ │                origin='C:\\Users\\Olasubomi\\AppData\\Roaming\\Python\\Python311\\Scripts\\… │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ in _run_code:88                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │       cached = 'C:\\Users\\Olasubomi\\AppData\\Roaming\\Python\\Python311\\Scripts\\animdl.… │ │
│ │         code = <code object <module> at 0x0000025CAA335730, file                             │ │
│ │                "C:\Users\Olasubomi\AppData\Roaming\Python\Python311\Scripts\animdl.exe\__ma… │ │
│ │                line 1>                                                                       │ │
│ │        fname = 'C:\\Users\\Olasubomi\\AppData\\Roaming\\Python\\Python311\\Scripts\\animdl.… │ │
│ │ init_globals = None                                                                          │ │
│ │       loader = <zipimporter object                                                           │ │
│ │                "C:\Users\Olasubomi\AppData\Roaming\Python\Python311\Scripts\animdl.exe\">    │ │
│ │     mod_name = '__main__'                                                                    │ │
│ │     mod_spec = ModuleSpec(name='__main__', loader=<zipimporter object                        │ │
│ │                "C:\Users\Olasubomi\AppData\Roaming\Python\Python311\Scripts\animdl.exe\">,   │ │
│ │                origin='C:\\Users\\Olasubomi\\AppData\\Roaming\\Python\\Python311\\Scripts\\… │ │
│ │     pkg_name = ''                                                                            │ │
│ │  run_globals = {                                                                             │ │
│ │                │   '__name__': '__main__',                                                   │ │
│ │                │   '__doc__': None,                                                          │ │
│ │                │   '__package__': '',                                                        │ │
│ │                │   '__loader__': <zipimporter object                                         │ │
│ │                "C:\Users\Olasubomi\AppData\Roaming\Python\Python311\Scripts\animdl.exe\">,   │ │
│ │                │   '__spec__': ModuleSpec(name='__main__', loader=<zipimporter object        │ │
│ │                "C:\Users\Olasubomi\AppData\Roaming\Python\Python311\Scripts\animdl.exe\">,   │ │
│ │                origin='C:\\Users\\Olasubomi\\AppData\\Roaming\\Python\\Python311\\Scripts\\… │ │
│ │                │   '__annotations__': {},                                                    │ │
│ │                │   '__builtins__': <module 'builtins' (built-in)>,                           │ │
│ │                │   '__file__':                                                               │ │
│ │                'C:\\Users\\Olasubomi\\AppData\\Roaming\\Python\\Python311\\Scripts\\animdl.… │ │
│ │                │   '__cached__':                                                             │ │
│ │                'C:\\Users\\Olasubomi\\AppData\\Roaming\\Python\\Python311\\Scripts\\animdl.… │ │
│ │                │   're': <module 're' from 'C:\\Python311\\Lib\\re\\__init__.py'>,           │ │
│ │                │   ... +2                                                                    │ │
│ │                }                                                                             │ │
│ │  script_name = None                                                                          │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ in <module>:7                                                                                    │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\click\core.py:1157 in __call__ │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\click\core.py:1078 in main     │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\click\core.py:1688 in invoke   │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\click\core.py:1434 in invoke   │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\click\core.py:783 in invoke    │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\animdl\core\cli\helpers\logger │
│ .py:79 in __inner__                                                                              │
│                                                                                                  │
│   76 │   │   │                                                                                   │
│   77 │   │   │   logging.setLoggerClass(SmartColouredLogger)                                     │
│   78 │   │   │                                                                                   │
│ ❱ 79 │   │   │   return f(*args, **kwargs, log_file=log_file, log_level=log_level)               │
│   80 │   │                                                                                       │
│   81 │   │   return __inner__                                                                    │
│   82                                                                                             │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │                args = ()                                                                     │ │
│ │ basic_config_kwargs = {                                                                      │ │
│ │                       │   'format': '[\x1b[35m%(filename)s:%(lineno)d\x1b[0m - %(asctime)s - │ │
│ │                       %(name)s: %(levelname)s] %(mes'+6,                                     │ │
│ │                       │   'level': 20                                                        │ │
│ │                       }                                                                      │ │
│ │                   f = <function banner_gift_wrapper.<locals>.wrapper.<locals>.__inner__ at   │ │
│ │                       0x0000025CAE1F04A0>                                                    │ │
│ │ file_logging_format = '[%(filename)s:%(lineno)d - %(asctime)s - %(name)s: %(levelname)s]     │ │
│ │                       %(message)s'                                                           │ │
│ │              kwargs = {                                                                      │ │
│ │                       │   'quality': '==1080',                                               │ │
│ │                       │   'query': 'animepahe:goblin slayer',                                │ │
│ │                       │   'special': '',                                                     │ │
│ │                       │   'range': <function RangeParameter.convert.<locals>.<lambda> at     │ │
│ │                       0x0000025CAE235EE0>,                                                   │ │
│ │                       │   'idm': False,                                                      │ │
│ │                       │   'download_dir': '.',                                               │ │
│ │                       │   'index': None                                                      │ │
│ │                       }                                                                      │ │
│ │            log_file = None                                                                   │ │
│ │           log_level = 20                                                                     │ │
│ │      logging_format = '[\x1b[35m%(filename)s:%(lineno)d\x1b[0m - %(asctime)s - %(name)s:     │ │
│ │                       %(levelname)s] %(mes'+6                                                │ │
│ │ SmartColouredLogger = <class                                                                 │ │
│ │                       'animdl.core.cli.helpers.logger.setup_loggers.<locals>.wrapper.<local… │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\animdl\core\cli\helpers\banner │
│ .py:76 in __inner__                                                                              │
│                                                                                                  │
│   73 │   │   │   if log_level > 20:                                                              │
│   74 │   │   │   │   return f(*args, log_level=log_level, log_file=log_file, **kwargs)           │
│   75 │   │   │                                                                                   │
│ ❱ 76 │   │   │   return f(*args, log_level=log_level, log_file=log_file, **kwargs)               │
│   77 │   │                                                                                       │
│   78 │   │   return __inner__                                                                    │
│   79                                                                                             │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │      args = ()                                                                               │ │
│ │         f = <function animdl_download at 0x0000025CAE1F0400>                                 │ │
│ │    kwargs = {                                                                                │ │
│ │             │   'quality': '==1080',                                                         │ │
│ │             │   'query': 'animepahe:goblin slayer',                                          │ │
│ │             │   'special': '',                                                               │ │
│ │             │   'range': <function RangeParameter.convert.<locals>.<lambda> at               │ │
│ │             0x0000025CAE235EE0>,                                                             │ │
│ │             │   'idm': False,                                                                │ │
│ │             │   'download_dir': '.',                                                         │ │
│ │             │   'index': None                                                                │ │
│ │             }                                                                                │ │
│ │  log_file = None                                                                             │ │
│ │ log_level = 20                                                                               │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\animdl\core\cli\commands\downl │
│ oad.py:41 in animdl_download                                                                     │
│                                                                                                  │
│    38 │                                                                                          │
│    39 │   logger = logging.getLogger("downloader")                                               │
│    40 │                                                                                          │
│ ❱  41 │   anime, provider = helpers.process_query(                                               │
│    42 │   │   http_client.client, query, console, auto_index=index, provider=DEFAULT_PROVIDER    │
│    43 │   )                                                                                      │
│    44                                                                                            │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │      console = <console width=120 ColorSystem.TRUECOLOR>                                     │ │
│ │ download_dir = '.'                                                                           │ │
│ │          idm = False                                                                         │ │
│ │        index = None                                                                          │ │
│ │       kwargs = {                                                                             │ │
│ │                │   'log_file': None,                                                         │ │
│ │                │   'range': <function RangeParameter.convert.<locals>.<lambda> at            │ │
│ │                0x0000025CAE235EE0>                                                           │ │
│ │                }                                                                             │ │
│ │    log_level = 20                                                                            │ │
│ │       logger = <SmartColouredLogger downloader (INFO)>                                       │ │
│ │      quality = '==1080'                                                                      │ │
│ │        query = 'animepahe:goblin slayer'                                                     │ │
│ │            r = <function RangeParameter.convert.<locals>.<lambda> at 0x0000025CAE235EE0>     │ │
│ │      special = ''                                                                            │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\animdl\core\cli\helpers\proces │
│ sors.py:41 in process_query                                                                      │
│                                                                                                  │
│   38 │   genexp = provider_searcher_mapping[provider](session, query)                            │
│   39 │                                                                                           │
│   40 │   if auto_index is None:                                                                  │
│ ❱ 41 │   │   return prompt_user(console, genexp, provider)                                       │
│   42 │                                                                                           │
│   43 │   expanded = list(genexp)                                                                 │
│   44                                                                                             │
│                                                                                                  │
│ ╭───────────────────────────────── locals ──────────────────────────────────╮                    │
│ │    auto_index = None                                                      │                    │
│ │       console = <console width=120 ColorSystem.TRUECOLOR>                 │                    │
│ │  custom_query = ['goblin slayer']                                         │                    │
│ │        genexp = <generator object search_animepahe at 0x0000025CAE222740> │                    │
│ │         match = None                                                      │                    │
│ │        module = None                                                      │                    │
│ │      provider = 'animepahe'                                               │                    │
│ │ provider_name = 'animepahe'                                               │                    │
│ │         query = 'goblin slayer'                                           │                    │
│ │       session = <httpx.Client object at 0x0000025CADC58510>               │                    │
│ ╰───────────────────────────────────────────────────────────────────────────╯                    │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\animdl\core\cli\helpers\proces │
│ sors.py:10 in prompt_user                                                                        │
│                                                                                                  │
│    7 │                                                                                           │
│    8 │   manager = get_prompt_manager()                                                          │
│    9 │                                                                                           │
│ ❱ 10 │   return manager(                                                                         │
│   11 │   │   logger,                                                                             │
│   12 │   │   anime_list_genexp,                                                                  │
│   13 │   │   processor=lambda component: (component, provider),                                  │
│                                                                                                  │
│ ╭─────────────────────────────────── locals ────────────────────────────────────╮                │
│ │ anime_list_genexp = <generator object search_animepahe at 0x0000025CAE222740> │                │
│ │            logger = <console width=120 ColorSystem.TRUECOLOR>                 │                │
│ │           manager = <function default_prompt at 0x0000025CADD5C5E0>           │                │
│ │          provider = 'animepahe'                                               │                │
│ ╰───────────────────────────────────────────────────────────────────────────────╯                │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\animdl\core\cli\helpers\prompt │
│ s.py:33 in default_prompt                                                                        │
│                                                                                                  │
│    30 │   │   if processor is None:                                                              │
│    31 │   │   │   components = list(components)                                                  │
│    32 │   │   else:                                                                              │
│ ❱  33 │   │   │   components = list(processor(component) for component in components)            │
│    34 │   │                                                                                      │
│    35 │   │   if not components:                                                                 │
│    36 │   │   │   return fallback                                                                │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │   component_name = 'search result'                                                           │ │
│ │       components = <generator object search_animepahe at 0x0000025CAE222740>                 │ │
│ │          console = <console width=120 ColorSystem.TRUECOLOR>                                 │ │
│ │    error_message = "Failed to find anything of that query on 'animepahe'. Try searching on   │ │
│ │                    other pro"+7                                                              │ │
│ │    escape_output = False                                                                     │ │
│ │         fallback = ({}, None)                                                                │ │
│ │        processor = <function prompt_user.<locals>.<lambda> at 0x0000025CAE236A20>            │ │
│ │ stdout_processor = <function prompt_user.<locals>.<lambda> at 0x0000025CAE235E40>            │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\animdl\core\cli\helpers\prompt │
│ s.py:33 in <genexpr>                                                                             │
│                                                                                                  │
│    30 │   │   if processor is None:                                                              │
│    31 │   │   │   components = list(components)                                                  │
│    32 │   │   else:                                                                              │
│ ❱  33 │   │   │   components = list(processor(component) for component in components)            │
│    34 │   │                                                                                      │
│    35 │   │   if not components:                                                                 │
│    36 │   │   │   return fallback                                                                │
│                                                                                                  │
│ ╭────────────────────────────────── locals ──────────────────────────────────╮                   │
│ │        .0 = <generator object search_animepahe at 0x0000025CAE222740>      │                   │
│ │ processor = <function prompt_user.<locals>.<lambda> at 0x0000025CAE236A20> │                   │
│ ╰────────────────────────────────────────────────────────────────────────────╯                   │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\animdl\core\cli\helpers\search │
│ er.py:67 in search_animepahe                                                                     │
│                                                                                                  │
│    64 │   animepahe_results = session.get(                                                       │
│    65 │   │   ANIMEPAHE + "api", params={"q": query, "m": "search"}                              │
│    66 │   )                                                                                      │
│ ❱  67 │   content = animepahe_results.json()                                                     │
│    68 │                                                                                          │
│    69 │   for results in content.get("data", []):                                                │
│    70 │   │   yield {                                                                            │
│                                                                                                  │
│ ╭──────────────────────────── locals ─────────────────────────────╮                              │
│ │ animepahe_results = <Response [403 Forbidden]>                  │                              │
│ │             query = 'goblin slayer'                             │                              │
│ │           session = <httpx.Client object at 0x0000025CADC58510> │                              │
│ ╰─────────────────────────────────────────────────────────────────╯                              │
│                                                                                                  │
│ C:\Users\Olasubomi\AppData\Roaming\Python\Python311\site-packages\httpx\_models.py:756 in json   │
│                                                                                                  │
│    753 │   │   │   encoding = guess_json_utf(self.content)                                       │
│    754 │   │   │   if encoding is not None:                                                      │
│    755 │   │   │   │   return jsonlib.loads(self.content.decode(encoding), **kwargs)             │
│ ❱  756 │   │   return jsonlib.loads(self.text, **kwargs)                                         │
│    757 │                                                                                         │
│    758 │   @property                                                                             │
│    759 │   def cookies(self) -> "Cookies":                                                       │
│                                                                                                  │
│ ╭────────────── locals ───────────────╮                                                          │
│ │ kwargs = {}                         │                                                          │
│ │   self = <Response [403 Forbidden]> │                                                          │
│ ╰─────────────────────────────────────╯                                                          │
│                                                                                                  │
│ C:\Python311\Lib\json\__init__.py:346 in loads                                                   │
│                                                                                                  │
│   343 │   if (cls is None and object_hook is None and                                            │
│   344 │   │   │   parse_int is None and parse_float is None and                                  │
│   345 │   │   │   parse_constant is None and object_pairs_hook is None and not kw):              │
│ ❱ 346 │   │   return _default_decoder.decode(s)                                                  │
│   347 │   if cls is None:                                                                        │
│   348 │   │   cls = JSONDecoder                                                                  │
│   349 │   if object_hook is not None:                                                            │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │               cls = None                                                                     │ │
│ │                kw = {}                                                                       │ │
│ │       object_hook = None                                                                     │ │
│ │ object_pairs_hook = None                                                                     │ │
│ │    parse_constant = None                                                                     │ │
│ │       parse_float = None                                                                     │ │
│ │         parse_int = None                                                                     │ │
│ │                 s = '<!doctype html><html><head><title>DDoS-Guard</title><meta               │ │
│ │                     charset="utf-8"/><meta'+667                                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Python311\Lib\json\decoder.py:337 in decode                                                   │
│                                                                                                  │
│   334 │   │   containing a JSON document).                                                       │
│   335 │   │                                                                                      │
│   336 │   │   """                                                                                │
│ ❱ 337 │   │   obj, end = self.raw_decode(s, idx=_w(s, 0).end())                                  │
│   338 │   │   end = _w(s, end).end()                                                             │
│   339 │   │   if end != len(s):                                                                  │
│   340 │   │   │   raise JSONDecodeError("Extra data", s, end)                                    │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │   _w = <built-in method match of re.Pattern object at 0x0000025CAC4D79F0>                    │ │
│ │    s = '<!doctype html><html><head><title>DDoS-Guard</title><meta                            │ │
│ │        charset="utf-8"/><meta'+667                                                           │ │
│ │ self = <json.decoder.JSONDecoder object at 0x0000025CAC53D310>                               │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Python311\Lib\json\decoder.py:355 in raw_decode                                               │
│                                                                                                  │
│   352 │   │   try:                                                                               │
│   353 │   │   │   obj, end = self.scan_once(s, idx)                                              │
│   354 │   │   except StopIteration as err:                                                       │
│ ❱ 355 │   │   │   raise JSONDecodeError("Expecting value", s, err.value) from None               │
│   356 │   │   return obj, end                                                                    │
│   357                                                                                            │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │  idx = 0                                                                                     │ │
│ │    s = '<!doctype html><html><head><title>DDoS-Guard</title><meta                            │ │
│ │        charset="utf-8"/><meta'+667                                                           │ │
│ │ self = <json.decoder.JSONDecoder object at 0x0000025CAC53D310>                               │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Type-Delta commented 9 months ago

this error happened because for some weird reasons AnimePahe decided it's a good idea to put a DDoS Guard on EVERY PAGES including API respond. (this is the same all for other Domains too: animepahe.ru animepahe.org animepahe.com)

Here is how this error happened

when Animdl search for anime titles on the site it will made an API request with url similar to this https://animepahe.ru/api?q=Oroka%20na%20Tenshi%20wa%20Akuma%20to%20Odoru&m=search

which should get a JSON respond like this

{
   "total": 3,
   "per_page": 8,
   "current_page": 1,
   "last_page": 1,
   "from": 1,
   "to": 3,
   "data": [
      {
         "id": 5442,
         "title": "Oroka na Tenshi wa Akuma to Odoru",
         "type": "TV",
         "episodes": 12,
         "status": "Currently Airing",
         "season": "Winter",
         "year": 2024,
         "score": 6.62,
         "poster": "https:\/\/i.animepahe.ru\/posters\/dedc73ea139e05bddd50651cb35112806aaf984deaea672d25093def0d2a60aa.jpg",
         "session": "f115f686-4214-ee80-a402-6e801f2f6534"
      },
      ...
   ]
}

unfortunately this is what we got Screenshot (2181)

since httpx.get() return page content IMMEDIATELY once the page is loaded it got the content of the fake loading screen instead.

and when Animdl tries to parse the fake loading screen it failed with the error you've received.

so...

Is there any ways to fix/workaround this?

I'm not an expert but from what I know... not much actually. because DDoS Guards are made for this.

unless AnimePahe remove this protection this is what we can try:

Wait for the fake loading screen to go away

this simplest method is probably Wait for the fake loading screen to go away because it will disappear and display the real content after a few seconds anyways, if we can some how send an API request, wait and evaluate page content only when the real content is displayed it could work for a bit. but it does has some flaws the first is the fake loading screen may stay chilling for too long and bypass the delay, this can be easily fixed with Headless Browser. Instead of waiting for some delay we can wait for page elements to disappear.

Use cookies hack

cookies that saved on the browser can prevent the fake loading screen from appearing the second time. we can attach this cookies with the request to trick the server that it's from the browser that has pass DDoS protection. This method is a bit advanced but probably the most efficient way. BUT those cookies has an expiration date like a real cookies, we might have to keep generating them to prevent this.

Still, it's not flawless

no matter what we do DDoS Guard is still active on the server, soon on later it could suspect our API request for an attack and throw everyone's favorites puzzle: captcha to us. the only problem is that Animdl can't automatically solve them and we're kinda stuck. sucks right?

PS: I'm still working this even though I'm not a contributor, because I still needs Animdl for my animes need ;) for the real reliable fix would have to leave it for someone else with much more Neuron power and time than me.

TaleWatcher commented 9 months ago

https://github.com/justfoolingaround/animdl/blob/c7c3b79198e66695e0bbbc576f9d9b788616957f/animdl/core/cli/http_client.py#L17-L20 Adding ".animepahe.ru" to this function should fix it

utils.http_client.integrate_ddg_bypassing(
    client,
    ".marin.moe",
    ".animepahe.ru",
)
justfoolingaround commented 9 months ago

I'm extremely busy rn due to university. I'll say that please refrain from posting (or even mentioning) that part of the codebase. It is an extremely unrecognized method that if fixed could sabotage a lot of scrapers.