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 109 forks source link

UnicodeError: encoding with 'idna' codec failed #285

Open ItzDerock opened 1 year ago

ItzDerock commented 1 year ago

Command

animdl download "Mushoku Tensei II"

Output

See this paste for full logs

[... last few lines...]
│                                                                                                  │
│ /usr/lib/python3.11/socket.py:962 in getaddrinfo                                                 │
│                                                                                                  │
│   959 │   # We override this function since we want to translate the numeric family              │
│   960 │   # and socket type values to enum constants.                                            │
│   961 │   addrlist = []                                                                          │
│ ❱ 962 │   for res in _socket.getaddrinfo(host, port, family, type, proto, flags):                │
│   963 │   │   af, socktype, proto, canonname, sa = res                                           │
│   964 │   │   addrlist.append((_intenum_converter(af, AddressFamily),                            │
│   965 │   │   │   │   │   │    _intenum_converter(socktype, SocketKind),                         │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ addrlist = []                                                                                │ │
│ │   family = 0                                                                                 │ │
│ │    flags = 0                                                                                 │ │
│ │     host = 'embed.ssbcontent.site--175948514e4c4f57175b54575b5307515c050f5c0a0c0f0b0f0c0e59… │ │
│ │     port = 443                                                                               │ │
│ │    proto = 0                                                                                 │ │
│ │     type = <SocketKind.SOCK_STREAM: 1>                                                       │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label too long)

Version

The project is operational. Use --help flag for help & be sure read the documentation!
                                  justfoolingaround/animdl v1.7.22                                  
Hello, buddy.
   It is 09:33 PM on a beautiful Friday!

Python 3.11.3

ItzDerock commented 1 year ago

Would also like to add that animdl doesn't show results from 9anime, even when prefixing with 9anime: https://9animetv.to/watch/mushoku-tensei-jobless-reincarnation-season-2-18418?ep=103010

ahkdigital commented 1 year ago

I get the same unicode error as well - additional information: the very top entry of the stack trace shows the idna.py code which performs a greater than or equal to check for 64 characters in length.

Python 3.11.4 here.

image

MinamiHasaki commented 1 year ago

I get the same unicode error as well - additional information: the very top entry of the stack trace shows the idna.py code which performs a greater than or equal to check for 64 characters in length.

This is already a known issue with the library, see here -> https://github.com/python/cpython/issues/77139

MinamiHasaki commented 1 year ago

Would also like to add that animdl doesn't show results from 9anime, even when prefixing with 9anime: https://9animetv.to/watch/mushoku-tensei-jobless-reincarnation-season-2-18418?ep=103010

@ItzDerock This should definitely be a separate issue. Also, just so you know, 9anime rebranded and is no longer 9anime. That link is to a fake site. I would advise caution.

naodwalk commented 1 year ago

@MinamiHasaki Any plans to create a workaround or use a different library?

This appears to have been a known issue for several years, and devs are reluctant to "fix" it because it is caused by the base URI exceeding 63 characters, which is against RFC-1035 standards. As someone in the referenced issue pointed out, there's a possibility DNS servers wouldn't even route such URLs because of that. Maybe it's worth investing some dev time in fixing the root-cause on an application level rather than waiting to see if they ever decide to stop enforcing the max length at the codec level?

ahkdigital commented 1 year ago

As a note, after upgrading to version 1.7.24, I am not getting this issue any longer. Not sure if changes were made regarding this in the newest release.

Astroneural commented 1 year ago

I am also no longer having this issue