Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeError: encoding with 'idna' codec failed #285

Open
ItzDerock opened this issue Aug 19, 2023 · 7 comments
Open

UnicodeError: encoding with 'idna' codec failed #285

ItzDerock opened this issue Aug 19, 2023 · 7 comments

Comments

@ItzDerock
Copy link

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
Copy link
Author

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
Copy link

ahkdigital commented Aug 21, 2023

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
Copy link

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 -> python/cpython#77139

@MinamiHasaki
Copy link

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
Copy link

naodwalk commented Sep 3, 2023

@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
Copy link

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
Copy link

I am also no longer having this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants