sdaqo/anipy-cli

Requests: Invalid URL: no host supplied

Closed this issue · 3 comments

Describe the bug
Whenever I try to play an episode, the program exits

To Reproduce
Steps to reproduce the behavior:

  1. Select any anime
  2. Select an episode
  3. The program raises an exception and exits

Expected behavior
The episode should play

Info

Name: anipy-cli
Version: 2.7.19
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/hache0099/.local/lib/python3.11/site-packages
Requires: beautifulsoup4, better-ffmpeg-progress, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, python-mpv, pyyaml, requests, setuptools, tqdm
Required-by: 

Platform

  • OS: Linux

Additional context
Error log:

Traceback (most recent call last):
  File "/home/hache0099/.local/bin/anipy-cli", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/hache0099/.local/lib/python3.11/site-packages/anipy_cli/run_anipy_cli.py", line 8, in main
    cli.run_cli()
  File "/home/hache0099/.local/lib/python3.11/site-packages/anipy_cli/cli/cli.py", line 37, in run_cli
    cli_class(options=args, rpc_client=rpc_client).run()
  File "/home/hache0099/.local/lib/python3.11/site-packages/anipy_cli/cli/clis/base_cli.py", line 36, in run
    self.process()
  File "/home/hache0099/.local/lib/python3.11/site-packages/anipy_cli/cli/clis/default_cli.py", line 34, in process
    url_parser.stream_url()
  File "/home/hache0099/.local/lib/python3.11/site-packages/anipy_cli/url_handler.py", line 347, in stream_url
    enc_keys = self.get_enc_keys()
               ^^^^^^^^^^^^^^^^^^^
  File "/home/hache0099/.local/lib/python3.11/site-packages/anipy_cli/url_handler.py", line 305, in get_enc_keys
    page = self.session.get(self.entry.embed_url).text
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 573, in request
    prep = self.prepare_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 484, in prepare_request
    p.prepare(
  File "/usr/lib/python3.11/site-packages/requests/models.py", line 368, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3.11/site-packages/requests/models.py", line 445, in prepare_url
    raise InvalidURL(f"Invalid URL {url!r}: No host supplied")
requests.exceptions.InvalidURL: Invalid URL 'https:https://playtaku.online/streaming.php?id=MTk0MzIy&title=Spy+x+Family+Part+2+Episode+5&typesub=SUB': No host supplied

Note the https:https:// in the URL

I am having the same issue on Linux Mint 21.1 with Python 3.10.6

had the same issue
im guessing the website changed is url?

sdaqo commented

Fixed with last pr, closing.