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

[Errno -2] Name or service not known #153

Closed
ZanDev32 opened this issue Apr 18, 2024 · 11 comments
Closed

[Errno -2] Name or service not known #153

ZanDev32 opened this issue Apr 18, 2024 · 11 comments

Comments

@ZanDev32
Copy link

Describe the bug
i just clean install this tool and i got an error message

To Reproduce
Steps to reproduce the behavior:

  1. ani-cli 'any random anime'
  2. the error show up
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 203, in _new_conn
    sock = connection.create_connection(
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 791, in urlopen
    response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 492, in _make_request
    raise new_e
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 468, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1097, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 611, in connect
    self.sock = sock = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 210, in _new_conn
    raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x7429d87a6680>: Failed to resolve 'gogoanime.vet' ([Errno -2] Name or service not known)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 845, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='gogoanime.vet', port=443): Max retries exceeded with url: ///search.html?keyword=tate%20no%20 (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7429d87a6680>: Failed to resolve 'gogoanime.vet' ([Errno -2] Name or service not known)"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/{user}/.local/bin/anipy-cli", line 8, in <module>
    sys.exit(main())
  File "/home/{user}/.local/lib/python3.10/site-packages/anipy_cli/run_anipy_cli.py", line 8, in main
    cli.run_cli()
  File "/home/{user}/.local/lib/python3.10/site-packages/anipy_cli/cli/cli.py", line 37, in run_cli
    cli_class(options=args, rpc_client=rpc_client).run()
  File "/home/{user}/.local/lib/python3.10/site-packages/anipy_cli/cli/clis/base_cli.py", line 35, in run
    self.take_input()
  File "/home/{user}/.local/lib/python3.10/site-packages/anipy_cli/cli/clis/default_cli.py", line 24, in take_input
    user_query = query(inp, self.entry)
  File "/home/{user}/.local/lib/python3.10/site-packages/anipy_cli/query.py", line 30, in __init__
    r = requests.get(self.search_url)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='gogoanime.vet', port=443): Max retries exceeded with url: ///search.html?keyword=tate%20no%20 (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7429d87a6680>: Failed to resolve 'gogoanime.vet' ([Errno -2] Name or service not known)"))

Expected behavior
start playing the anime

Info
Name: anipy_cli
Version: 2.7.31
Summary: Little tool in python to watch anime from the terminal (the better way to watch anime)
Home-page: https://github.com/sdaqo/anipy-cli
Author: sdaqo
Author-email: sdaqo.dev@protonmail.com
License: GPL-3.0
Location: /home/asus/.local/lib/python3.10/site-packages
Requires: beautifulsoup4, better-ffmpeg-progress, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, python-mpv, pyyaml, requests, setuptools, tqdm, yaspin
Required-by:

Platform

  • OS: GNU/POP OS 22.04

Additional context
just reply if you need more information

@sdaqo
Copy link
Owner

sdaqo commented Apr 18, 2024

can you edit your config and set gogoanime_url: https://gogoanime3.co/ and try again?

Edit: to get the config location use --config-path

@ZanDev32
Copy link
Author

can you edit your config and set gogoanime_url: https://gogoanime3.co/ and try again?

Edit: to get the config location use --config-path

Well... the error messages are gone but now the program stuck when searching anime

@sdaqo
Copy link
Owner

sdaqo commented Apr 21, 2024

Can not really tell you how to fix that as I do not really now whats going on on your side, but you if you wait for v3 release your problem might be fixed...

@ZanDev32
Copy link
Author

I think, i already found the problem. The problem is caused by Cloudflare WARP Service. After further testing, the problem also happen both on my windows and android machine which also using Cloudflare WARP Service. By disabling it, everything going work as intended.

since i already solve this problem, should i close this issue?

@sdaqo
Copy link
Owner

sdaqo commented Apr 24, 2024

Alright, thanks for investing!

@sdaqo sdaqo closed this as completed Apr 24, 2024
@ZanDev32
Copy link
Author

Hey, it seem the issue only partialy solved. I still got the same error by using anipy-cli on MAL mode or by typing anipy-cli -M and select [w] Binge watch newest episodes

Here is the error i got:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 203, in _new_conn
    sock = connection.create_connection(
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
TimeoutError: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 791, in urlopen
    response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 492, in _make_request
    raise new_e
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 468, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1097, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 611, in connect
    self.sock = sock = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 212, in _new_conn
    raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7985e55a4220>, 'Connection to gogoanime.vet timed out. (connect timeout=2)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 845, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='gogoanime.vet', port=443): Max retries exceeded with url: ///category/genjitsu-shugi-yuusha-no-oukoku-saikenki (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7985e55a4220>, 'Connection to gogoanime.vet timed out. (connect timeout=2)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/asus/.local/bin/anipy-cli", line 8, in <module>
    sys.exit(main())
  File "/home/asus/.local/lib/python3.10/site-packages/anipy_cli/run_anipy_cli.py", line 8, in main
    cli.run_cli()
  File "/home/asus/.local/lib/python3.10/site-packages/anipy_cli/cli/cli.py", line 37, in run_cli
    cli_class(options=args, rpc_client=rpc_client).run()
  File "/home/asus/.local/lib/python3.10/site-packages/anipy_cli/cli/clis/base_cli.py", line 38, in run
    self.post()
  File "/home/asus/.local/lib/python3.10/site-packages/anipy_cli/cli/clis/mal_cli.py", line 27, in post
    menu.run()
  File "/home/asus/.local/lib/python3.10/site-packages/anipy_cli/cli/menus/base_menu.py", line 32, in run
    self.take_input()
  File "/home/asus/.local/lib/python3.10/site-packages/anipy_cli/cli/menus/base_menu.py", line 43, in take_input
    op.callback()
  File "/home/asus/.local/lib/python3.10/site-packages/anipy_cli/cli/menus/mal_menu.py", line 236, in binge_latest
    latest_eps = self.m_class.latest_eps()
  File "/home/asus/.local/lib/python3.10/site-packages/anipy_cli/mal.py", line 483, in latest_eps
    latest = ep_class.get_latest()
  File "/home/asus/.local/lib/python3.10/site-packages/anipy_cli/url_handler.py", line 107, in get_latest
    ep_list = self._load_eps_list()
  File "/home/asus/.local/lib/python3.10/site-packages/anipy_cli/url_handler.py", line 45, in _load_eps_list
    r = requests.get(self.entry.category_url, timeout=2)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 507, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='gogoanime.vet', port=443): Max retries exceeded with url: ///category/genjitsu-shugi-yuusha-no-oukoku-saikenki (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7985e55a4220>, 'Connection to gogoanime.vet timed out. (connect timeout=2)'))

note: i already change gogoanime_url inside config.yml into gogoanime3.co

@sdaqo
Copy link
Owner

sdaqo commented Apr 24, 2024

This may be some kind of network configuration error can you send me your ouput of these commands (I posted my output for comparison):

$ nslookup gogoanime3.co
Server:		127.0.0.53
Address:	127.0.0.53#53

Non-authoritative answer:
Name:	gogoanime3.co
Address: 172.67.69.148
Name:	gogoanime3.co
Address: 104.26.14.170
Name:	gogoanime3.co
Address: 104.26.15.170
Name:	gogoanime3.co
Address: 2606:4700:20::681a:eaa
Name:	gogoanime3.co
Address: 2606:4700:20::ac43:4594
Name:	gogoanime3.co
Address: 2606:4700:20::681a:faa
$ nslookup gogoanime.vet
Server:		127.0.0.53
Address:	127.0.0.53#53

** server can't find gogoanime.vet: NXDOMAIN

$ curl -I https://gogoanime3.co/
HTTP/2 200 
date: Wed, 24 Apr 2024 14:30:36 GMT
content-type: text/html; charset=utf-8
vary: Accept-Encoding
x-powered-by: PHP/5.6.13
set-cookie: gogoanime=kv9rh0scquf8t04pdq47ca59v6; path=/
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
pragma: no-cache
cf-cache-status: DYNAMIC

For this one please cut out your mal login data and other personal stuff:

$ cat $(anipy-cli --config)
anime_types:
- sub
- dub
auto_map_mal_to_gogo: false
auto_open_dl_defaultcli: false
auto_sync_mal_to_seasonals: false
dc_presence: false
download_folder_path: ~/anime
download_name_format: '{show_name}_{episode_number}.mp4'
download_remove_dub_from_folder_name: false
ffmpeg_hls: false
ffmpeg_log_path: ~/.local/share/anipy-cli/ffmpeg_log
gogoanime_url: https://gogoanime3.co/
history_file_path: ~/.local/share/anipy-cli/history.json
mal_local_user_list_path: ~/.local/share/anipy-cli/mal_list.json
mal_password: ''
mal_status_categories:
- watching
mal_user: ''
mpv_commandline_options:
- --keep-open=no
player_path: mpv
reuse_mpv_window: false
seasonal_file_path:  ~/.local/share/anipy-cli/seasonals.json
seasonals_dl_path:  ~/.local/share/anipy-cli/seasonals
user_files_path: ~/.local/share/anipy-cli/user_files
vlc_commandline_options: []

@sdaqo sdaqo reopened this Apr 24, 2024
@ZanDev32
Copy link
Author

Here's the output you as for

$ nslookup gogoanime3.co
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   gogoanime3.co
Address: 104.26.15.170
Name:   gogoanime3.co
Address: 104.26.14.170
Name:   gogoanime3.co
Address: 172.67.69.148
Name:   gogoanime3.co
Address: 2606:4700:20::681a:eaa
Name:   gogoanime3.co
Address: 2606:4700:20::ac43:4594
Name:   gogoanime3.co
Address: 2606:4700:20::681a:faa

$ nslookup gogoanime.vet
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   gogoanime.vet
Address: 36.86.63.182
$ curl -I https://gogoanime3.co/
HTTP/2 200 
date: Thu, 25 Apr 2024 03:38:18 GMT
content-type: text/html; charset=utf-8
vary: Accept-Encoding
x-powered-by: PHP/5.6.13
set-cookie: gogoanime=qqgf42kuahkdgv36vodl3982r2; path=/
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
pragma: no-cache
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=NaX5YU8Vfs%2F9cDbx5gtao5jHw1r%2FISRfGY3lmQLrT5F8D1IxaH2M8ZLm3uiScc%2FRvAeMQkGxVSCPrPw3dssNdKzHRtPpB%2BCVg7kWMepXelhPP9kwIaM%2BACV%2FhbW11TYKwP8G6JL5bAZiwIU%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 879b4ca78882836b-SIN
$ cat $(anipy-cli --config)
download_folder_path: "/home/asus/Videos/Stuff/"

gogoanime_url: "https://gogoanime3.co//"

mal_status_categories:
  # Possible categories:
  - watching
  - plan_to_watch

anime_types:
  - "sub"

mal_user: {username}
mal_password: {password}

@sdaqo
Copy link
Owner

sdaqo commented Apr 28, 2024

maybe remove the second slash in the gogoanime url at the end? Other then that everything looks fine? I honestly do not know why you get a result for gogoanime.vat, but oh well...

@sdaqo
Copy link
Owner

sdaqo commented May 11, 2024

please check with the new version: https://sdaqo.dev/anipy-cli/getting-started-cli/

@sdaqo
Copy link
Owner

sdaqo commented May 31, 2024

Stale, closing

@sdaqo sdaqo closed this as completed May 31, 2024
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

2 participants