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

[BUG] aiodns needs a SelectorEventLoop on Windows? #729

Open
Loham opened this issue Aug 4, 2024 · 5 comments
Open

[BUG] aiodns needs a SelectorEventLoop on Windows? #729

Loham opened this issue Aug 4, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Loham
Copy link

Loham commented Aug 4, 2024

Describe the bug

Not sure what I'm missing here, though I am fairly new to all this so I hope the following information is helpful.
Python version 3.12.4
PIP version 24.2
SteamRip version 2.0.5
The following was copied from the cmd window:

┌─────────────────────────────── Traceback (most recent call last) ────────────────────────────────┐
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiodns_init_.py:58 │
│ in init
│ │
│ 55 │ │ if sys.platform == 'win32': │
│ 56 │ │ │ if not isinstance(self.loop, asyncio.SelectorEventLoop): │
│ 57 │ │ │ │ try: │
│ > 58 │ │ │ │ │ import winloop │
│ 59 │ │ │ │ │ if not isinstance(self.loop , winloop.Loop): │
│ 60 │ │ │ │ │ │ raise RuntimeError( │
│ 61 │ │ │ │ │ │ │ 'aiodns needs a SelectorEventLoop on Windows. See more: http │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
ModuleNotFoundError: No module named 'winloop'

During handling of the above exception, another exception occurred:

┌─────────────────────────────── Traceback (most recent call last) ────────────────────────────────┐
│ in run_module_as_main:198 │
│ in run_code:88 │
│ │
│ ... 18 frames hidden ... │
│ │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiohttp\resolver.py:94 │
│ in init
│ │
│ 91 │ │ if aiodns is None: │
│ 92 │ │ │ raise RuntimeError("Resolver requires aiodns library") │
│ 93 │ │ │
│ > 94 │ │ self.resolver = aiodns.DNSResolver(*args, **kwargs) │
│ 95 │ │ │
│ 96 │ │ if not hasattr(self.resolver, "gethostbyname"): │
│ 97 │ │ │ # aiodns 1.1 is not available, fallback to DNSResolver.query │
│ │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiodns_init
.py:63 │
│ in init
│ │
│ 60 │ │ │ │ │ │ raise RuntimeError( │
│ 61 │ │ │ │ │ │ │ 'aiodns needs a SelectorEventLoop on Windows. See more: http │
│ 62 │ │ │ │ except ModuleNotFoundError: │
│ > 63 │ │ │ │ │ raise RuntimeError( │
│ 64 │ │ │ │ │ │ 'aiodns needs a SelectorEventLoop on Windows. See more: https:// │
│ 65 │ │ kwargs.pop('sock_state_cb', None) │
│ 66 │ │ timeout = kwargs.pop('timeout', None) │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
RuntimeError: aiodns needs a SelectorEventLoop on Windows. See more: aio-libs/aiodns#86
Exception ignored in: <bound method BaseEventLoop.call_exception_handler of >
Traceback (most recent call last):
File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 1854, in call_exception_handler
File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\logging_init
.py", line 1568, in error
File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\logging_init
.py", line 1684, in log
File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\logging_init
.py", line 1700, in handle
File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\logging_init
.py", line 1762, in callHandlers
File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\logging_init_.py", line 1028, in handle
File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich\logging.py", line 160, in emit
File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich\logging.py", line 221, in render
File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich_log_render.py", line 43, in call
ImportError: sys.meta_path is None, Python is likely shutting down

Command Used

rip url https://www.deezer.com/us/artist/98/top_track

Debug Traceback

[23:13:44] DEBUG    Showing all debug logs                                                                   cli.py:102
           DEBUG    Removing dirs set()                                                                   artwork.py:19
┌─────────────────────────────── Traceback (most recent call last) ────────────────────────────────┐
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiodns\__init__.py:58   │
│ in __init__                                                                                      │
│                                                                                                  │
│    55 │   │   if sys.platform == 'win32':                                                        │
│    56 │   │   │   if not isinstance(self.loop, asyncio.SelectorEventLoop):                       │
│    57 │   │   │   │   try:                                                                       │
│ >  58 │   │   │   │   │   import winloop                                                         │
│    59 │   │   │   │   │   if not isinstance(self.loop , winloop.Loop):                           │
│    60 │   │   │   │   │   │   raise RuntimeError(                                                │
│    61 │   │   │   │   │   │   │   'aiodns needs a SelectorEventLoop on Windows. See more: http   │
│                                                                                                  │
│ ┌──────────────────────────── locals ─────────────────────────────┐                              │
│ │      kwargs = {}                                                │                              │
│ │        loop = None                                              │                              │
│ │ nameservers = None                                              │                              │
│ │        self = <aiodns.DNSResolver object at 0x000002B440F006E0> │                              │
│ └─────────────────────────────────────────────────────────────────┘                              │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
ModuleNotFoundError: No module named 'winloop'

During handling of the above exception, another exception occurred:

┌─────────────────────────────── Traceback (most recent call last) ────────────────────────────────┐
│ in _run_module_as_main:198                                                                       │
│ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
│ │   alter_argv = False                                                                         │ │
│ │         code = <code object <module> at 0x000002B43CEC1830, file                             │ │
│ │                "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Scripts\rip.exe\__ma… │ │
│ │                line 1>                                                                       │ │
│ │ main_globals = {                                                                             │ │
│ │                │   '__name__': '__main__',                                                   │ │
│ │                │   '__doc__': None,                                                          │ │
│ │                │   '__package__': '',                                                        │ │
│ │                │   '__loader__': <zipimporter object                                         │ │
│ │                "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Scripts\rip.exe\">,   │ │
│ │                │   '__spec__': ModuleSpec(name='__main__', loader=<zipimporter object        │ │
│ │                "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Scripts\rip.exe\">,   │ │
│ │                origin='C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Scrip… │ │
│ │                │   '__annotations__': {},                                                    │ │
│ │                │   '__builtins__': <module 'builtins' (built-in)>,                           │ │
│ │                │   '__file__':                                                               │ │
│ │                'C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Scripts\\rip… │ │
│ │                │   '__cached__':                                                             │ │
│ │                'C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Scripts\\rip… │ │
│ │                │   're': <module 're' from                                                   │ │
│ │                'C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\re\\__i… │ │
│ │                │   ... +2                                                                    │ │
│ │                }                                                                             │ │
│ │     mod_name = '__main__'                                                                    │ │
│ │     mod_spec = ModuleSpec(name='__main__', loader=<zipimporter object                        │ │
│ │                "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Scripts\rip.exe\">,   │ │
│ │                origin='C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Scrip… │ │
│ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
│ in _run_code:88                                                                                  │
│ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
│ │       cached = 'C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Scripts\\rip… │ │
│ │         code = <code object <module> at 0x000002B43CEC1830, file                             │ │
│ │                "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Scripts\rip.exe\__ma… │ │
│ │                line 1>                                                                       │ │
│ │        fname = 'C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Scripts\\rip… │ │
│ │ init_globals = None                                                                          │ │
│ │       loader = <zipimporter object                                                           │ │
│ │                "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Scripts\rip.exe\">    │ │
│ │     mod_name = '__main__'                                                                    │ │
│ │     mod_spec = ModuleSpec(name='__main__', loader=<zipimporter object                        │ │
│ │                "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Scripts\rip.exe\">,   │ │
│ │                origin='C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Scrip… │ │
│ │     pkg_name = ''                                                                            │ │
│ │  run_globals = {                                                                             │ │
│ │                │   '__name__': '__main__',                                                   │ │
│ │                │   '__doc__': None,                                                          │ │
│ │                │   '__package__': '',                                                        │ │
│ │                │   '__loader__': <zipimporter object                                         │ │
│ │                "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Scripts\rip.exe\">,   │ │
│ │                │   '__spec__': ModuleSpec(name='__main__', loader=<zipimporter object        │ │
│ │                "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Scripts\rip.exe\">,   │ │
│ │                origin='C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Scrip… │ │
│ │                │   '__annotations__': {},                                                    │ │
│ │                │   '__builtins__': <module 'builtins' (built-in)>,                           │ │
│ │                │   '__file__':                                                               │ │
│ │                'C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Scripts\\rip… │ │
│ │                │   '__cached__':                                                             │ │
│ │                'C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Scripts\\rip… │ │
│ │                │   're': <module 're' from                                                   │ │
│ │                'C:\\Users\\Loham\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\re\\__i… │ │
│ │                │   ... +2                                                                    │ │
│ │                }                                                                             │ │
│ │  script_name = None                                                                          │ │
│ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
│                                                                                                  │
│ in <module>:7                                                                                    │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py:1157 in   │
│ __call__                                                                                         │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py:1078 in   │
│ main                                                                                             │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py:1688 in   │
│ invoke                                                                                           │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py:1434 in   │
│ invoke                                                                                           │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py:783 in    │
│ invoke                                                                                           │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\decorators.py:33  │
│ in new_func                                                                                      │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamrip\rip\cli.py:28 │
│ in wrapper                                                                                       │
│                                                                                                  │
│    25 def coro(f):                                                                               │
│    26 │   @wraps(f)                                                                              │
│    27 │   def wrapper(*args, **kwargs):                                                          │
│ >  28 │   │   return asyncio.run(f(*args, **kwargs))                                             │
│    29 │                                                                                          │
│    30 │   return wrapper                                                                         │
│    31                                                                                            │
│                                                                                                  │
│ ┌─────────────────────────────── locals ────────────────────────────────┐                        │
│ │   args = (<click.core.Context object at 0x000002B440C8DA00>,)         │                        │
│ │      f = <function url at 0x000002B440E5E340>                         │                        │
│ │ kwargs = {'urls': ('https://www.deezer.com/us/artist/98/top_track',)} │                        │
│ └───────────────────────────────────────────────────────────────────────┘                        │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py:194 in run         │
│                                                                                                  │
│   191 │   │   │   "asyncio.run() cannot be called from a running event loop")                    │
│   192 │                                                                                          │
│   193 │   with Runner(debug=debug, loop_factory=loop_factory) as runner:                         │
│ > 194 │   │   return runner.run(main)                                                            │
│   195                                                                                            │
│   196                                                                                            │
│   197 def _cancel_all_tasks(loop):                                                               │
│                                                                                                  │
│ ┌─────────────────────────────── locals ───────────────────────────────┐                         │
│ │        debug = None                                                  │                         │
│ │ loop_factory = None                                                  │                         │
│ │         main = <coroutine object url at 0x000002B440E54700>          │                         │
│ │       runner = <asyncio.runners.Runner object at 0x000002B440E62210> │                         │
│ └──────────────────────────────────────────────────────────────────────┘                         │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py:118 in run         │
│                                                                                                  │
│   115 │   │                                                                                      │
│   116 │   │   self._interrupt_count = 0                                                          │
│   117 │   │   try:                                                                               │
│ > 118 │   │   │   return self._loop.run_until_complete(task)                                     │
│   119 │   │   except exceptions.CancelledError:                                                  │
│   120 │   │   │   if self._interrupt_count > 0:                                                  │
│   121 │   │   │   │   uncancel = getattr(task, "uncancel", None)                                 │
│                                                                                                  │
│ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
│ │        context = <_contextvars.Context object at 0x000002B43FD1F800>                         │ │
│ │           coro = <coroutine object url at 0x000002B440E54700>                                │ │
│ │           self = <asyncio.runners.Runner object at 0x000002B440E62210>                       │ │
│ │ sigint_handler = functools.partial(<bound method Runner._on_sigint of                        │ │
│ │                  <asyncio.runners.Runner object at 0x000002B440E62210>>, main_task=<Task     │ │
│ │                  finished name='Task-1' coro=<url() done, defined at                         │ │
│ │                  C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\s… │ │
│ │                  exception=RuntimeError('aiodns needs a SelectorEventLoop on Windows. See    │ │
│ │                  more: https://github.com/saghul/aiodns/issues/86')>)                        │ │
│ │           task = <Task finished name='Task-1' coro=<url() done, defined at                   │ │
│ │                  C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\s… │ │
│ │                  exception=RuntimeError('aiodns needs a SelectorEventLoop on Windows. See    │ │
│ │                  more: https://github.com/saghul/aiodns/issues/86')>                         │ │
│ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py:687 in         │
│ run_until_complete                                                                               │
│                                                                                                  │
│    684 │   │   if not future.done():                                                             │
│    685 │   │   │   raise RuntimeError('Event loop stopped before Future completed.')             │
│    686 │   │                                                                                     │
│ >  687 │   │   return future.result()                                                            │
│    688 │                                                                                         │
│    689 │   def stop(self):                                                                       │
│    690 │   │   """Stop running the event loop.                                                   │
│                                                                                                  │
│ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
│ │   future = <Task finished name='Task-1' coro=<url() done, defined at                         │ │
│ │            C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamr… │ │
│ │            exception=RuntimeError('aiodns needs a SelectorEventLoop on Windows. See more:    │ │
│ │            https://github.com/saghul/aiodns/issues/86')>                                     │ │
│ │ new_task = False                                                                             │ │
│ │     self = <ProactorEventLoop running=False closed=True debug=False>                         │ │
│ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamrip\rip\cli.py:16 │
│ 6 in url                                                                                         │
│                                                                                                  │
│   163 │   │   │   version_coro = None                                                            │
│   164 │   │                                                                                      │
│   165 │   │   async with Main(cfg) as main:                                                      │
│ > 166 │   │   │   await main.add_all(urls)                                                       │
│   167 │   │   │   await main.resolve()                                                           │
│   168 │   │   │   await main.rip()                                                               │
│   169                                                                                            │
│                                                                                                  │
│ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
│ │          cfg = <streamrip.config.Config object at 0x000002B440C05F70>                        │ │
│ │          ctx = <click.core.Context object at 0x000002B440C8DA00>                             │ │
│ │         main = <streamrip.rip.main.Main object at 0x000002B440D96F30>                        │ │
│ │      updates = True                                                                          │ │
│ │         urls = ('https://www.deezer.com/us/artist/98/top_track',)                            │ │
│ │ version_coro = <Task finished name='Task-2' coro=<latest_streamrip_version() done, defined   │ │
│ │                at                                                                            │ │
│ │                C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\str… │ │
│ │                exception=RuntimeError('aiodns needs a SelectorEventLoop on Windows. See      │ │
│ │                more: https://github.com/saghul/aiodns/issues/86')>                           │ │
│ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamrip\rip\main.py:1 │
│ 21 in add_all                                                                                    │
│                                                                                                  │
│   118 │   │   │   │   │   f"[red]Found invalid url [cyan]{urls[i]}[/cyan], skipping.",           │
│   119 │   │   │   │   )                                                                          │
│   120 │   │   │   │   continue                                                                   │
│ > 121 │   │   │   url_client_pairs.append((p, await self.get_logged_in_client(p.source)))        │
│   122 │   │                                                                                      │
│   123 │   │   pendings = await asyncio.gather(                                                   │
│   124 │   │   │   *[                                                                             │
│                                                                                                  │
│ ┌──────────────────────────────────────── locals ────────────────────────────────────────┐       │
│ │                i = 0                                                                   │       │
│ │                p = <streamrip.rip.parse_url.GenericURL object at 0x000002B440EE3EC0>   │       │
│ │           parsed = [<streamrip.rip.parse_url.GenericURL object at 0x000002B440EE3EC0>] │       │
│ │             self = <streamrip.rip.main.Main object at 0x000002B440D96F30>              │       │
│ │ url_client_pairs = []                                                                  │       │
│ │             urls = ('https://www.deezer.com/us/artist/98/top_track',)                  │       │
│ └────────────────────────────────────────────────────────────────────────────────────────┘       │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamrip\rip\main.py:1 │
│ 47 in get_logged_in_client                                                                       │
│                                                                                                  │
│   144 │   │   │   else:                                                                          │
│   145 │   │   │   │   with console.status(f"[cyan]Logging into {source}", spinner="dots"):       │
│   146 │   │   │   │   │   # Log into client using credentials from config                        │
│ > 147 │   │   │   │   │   await client.login()                                                   │
│   148 │   │                                                                                      │
│   149 │   │   assert client.logged_in                                                            │
│   150 │   │   return client                                                                      │
│                                                                                                  │
│ ┌──────────────────────────────────── locals ─────────────────────────────────────┐              │
│ │   client = <streamrip.client.deezer.DeezerClient object at 0x000002B440EE3A70>  │              │
│ │ prompter = <streamrip.rip.prompter.DeezerPrompter object at 0x000002B440EE3E90> │              │
│ │     self = <streamrip.rip.main.Main object at 0x000002B440D96F30>               │              │
│ │   source = 'deezer'                                                             │              │
│ └─────────────────────────────────────────────────────────────────────────────────┘              │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamrip\client\deezer │
│ .py:45 in login                                                                                  │
│                                                                                                  │
│    42 │                                                                                          │
│    43 │   async def login(self):                                                                 │
│    44 │   │   # Used for track downloads                                                         │
│ >  45 │   │   self.session = await self.get_session()                                            │
│    46 │   │   arl = self.config.arl                                                              │
│    47 │   │   if not arl:                                                                        │
│    48 │   │   │   raise MissingCredentialsError                                                  │
│                                                                                                  │
│ ┌────────────────────────────────── locals ──────────────────────────────────┐                   │
│ │ self = <streamrip.client.deezer.DeezerClient object at 0x000002B440EE3A70> │                   │
│ └────────────────────────────────────────────────────────────────────────────┘                   │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamrip\client\client │
│ .py:55 in get_session                                                                            │
│                                                                                                  │
│   52 │   async def get_session(headers: dict | None = None) -> aiohttp.ClientSession:            │
│   53 │   │   if headers is None:                                                                 │
│   54 │   │   │   headers = {}                                                                    │
│ > 55 │   │   return aiohttp.ClientSession(                                                       │
│   56 │   │   │   headers={"User-Agent": DEFAULT_USER_AGENT},                                     │
│   57 │   │   │   **headers,                                                                      │
│   58 │   │   )                                                                                   │
│                                                                                                  │
│ ┌─── locals ───┐                                                                                 │
│ │ headers = {} │                                                                                 │
│ └──────────────┘                                                                                 │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiohttp\client.py:343   │
│ in __init__                                                                                      │
│                                                                                                  │
│    340 │   │   │   │   )                                                                         │
│    341 │   │                                                                                     │
│    342 │   │   if connector is None:                                                             │
│ >  343 │   │   │   connector = TCPConnector(loop=loop)                                           │
│    344 │   │                                                                                     │
│    345 │   │   if connector._loop is not loop:                                                   │
│    346 │   │   │   raise RuntimeError("Session and connector has to use same event loop")        │
│                                                                                                  │
│ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
│ │                      auth = None                                                             │ │
│ │           auto_decompress = True                                                             │ │
│ │                  base_url = None                                                             │ │
│ │              conn_timeout = None                                                             │ │
│ │                 connector = None                                                             │ │
│ │           connector_owner = True                                                             │ │
│ │                cookie_jar = None                                                             │ │
│ │                   cookies = None                                                             │ │
│ │ fallback_charset_resolver = <function ClientSession.<lambda> at 0x000002B43FCEEE80>          │ │
│ │                   headers = {                                                                │ │
│ │                             │   'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64;     │ │
│ │                             rv:83.0) Gecko/20100101 Firefox/83.0'                            │ │
│ │                             }                                                                │ │
│ │            json_serialize = <function dumps at 0x000002B43F8E56C0>                           │ │
│ │                      loop = <ProactorEventLoop running=False closed=True debug=False>        │ │
│ │            max_field_size = 8190                                                             │ │
│ │             max_line_size = 8190                                                             │ │
│ │          raise_for_status = False                                                            │ │
│ │              read_bufsize = 65536                                                            │ │
│ │              read_timeout = <_SENTINEL.sentinel: 1>                                          │ │
│ │             request_class = <class 'aiohttp.client_reqrep.ClientRequest'>                    │ │
│ │      requote_redirect_url = True                                                             │ │
│ │            response_class = <class 'aiohttp.client_reqrep.ClientResponse'>                   │ │
│ │                      self = <aiohttp.client.ClientSession object at 0x000002B440F00650>      │ │
│ │         skip_auto_headers = None                                                             │ │
│ │                   timeout = <_SENTINEL.sentinel: 1>                                          │ │
│ │             trace_configs = None                                                             │ │
│ │                 trust_env = False                                                            │ │
│ │                   version = HttpVersion(major=1, minor=1)                                    │ │
│ │         ws_response_class = <class 'aiohttp.client_ws.ClientWebSocketResponse'>              │ │
│ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiohttp\connector.py:79 │
│ 6 in __init__                                                                                    │
│                                                                                                  │
│    793 │   │                                                                                     │
│    794 │   │   self._ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint)          │
│    795 │   │   if resolver is None:                                                              │
│ >  796 │   │   │   resolver = DefaultResolver(loop=self._loop)                                   │
│    797 │   │   self._resolver = resolver                                                         │
│    798 │   │                                                                                     │
│    799 │   │   self._use_dns_cache = use_dns_cache                                               │
│                                                                                                  │
│ ┌──────────────────────────────────────── locals ────────────────────────────────────────┐       │
│ │  enable_cleanup_closed = False                                                         │       │
│ │                 family = <AddressFamily.AF_UNSPEC: 0>                                  │       │
│ │            fingerprint = None                                                          │       │
│ │            force_close = False                                                         │       │
│ │   happy_eyeballs_delay = 0.25                                                          │       │
│ │             interleave = None                                                          │       │
│ │      keepalive_timeout = <_SENTINEL.sentinel: 1>                                       │       │
│ │                  limit = 100                                                           │       │
│ │         limit_per_host = 0                                                             │       │
│ │             local_addr = None                                                          │       │
│ │                   loop = <ProactorEventLoop running=False closed=True debug=False>     │       │
│ │               resolver = None                                                          │       │
│ │                   self = <aiohttp.connector.TCPConnector object at 0x000002B440F00680> │       │
│ │                    ssl = True                                                          │       │
│ │            ssl_context = None                                                          │       │
│ │ timeout_ceil_threshold = 5                                                             │       │
│ │          ttl_dns_cache = 10                                                            │       │
│ │          use_dns_cache = True                                                          │       │
│ │             verify_ssl = True                                                          │       │
│ └────────────────────────────────────────────────────────────────────────────────────────┘       │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiohttp\resolver.py:94  │
│ in __init__                                                                                      │
│                                                                                                  │
│    91 │   │   if aiodns is None:                                                                 │
│    92 │   │   │   raise RuntimeError("Resolver requires aiodns library")                         │
│    93 │   │                                                                                      │
│ >  94 │   │   self._resolver = aiodns.DNSResolver(*args, **kwargs)                               │
│    95 │   │                                                                                      │
│    96 │   │   if not hasattr(self._resolver, "gethostbyname"):                                   │
│    97 │   │   │   # aiodns 1.1 is not available, fallback to DNSResolver.query                   │
│                                                                                                  │
│ ┌──────────────────────────────── locals ────────────────────────────────┐                       │
│ │   args = ()                                                            │                       │
│ │ kwargs = {}                                                            │                       │
│ │   loop = <ProactorEventLoop running=False closed=True debug=False>     │                       │
│ │   self = <aiohttp.resolver.AsyncResolver object at 0x000002B440F006B0> │                       │
│ └────────────────────────────────────────────────────────────────────────┘                       │
│                                                                                                  │
│ C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiodns\__init__.py:63   │
│ in __init__                                                                                      │
│                                                                                                  │
│    60 │   │   │   │   │   │   raise RuntimeError(                                                │
│    61 │   │   │   │   │   │   │   'aiodns needs a SelectorEventLoop on Windows. See more: http   │
│    62 │   │   │   │   except ModuleNotFoundError:                                                │
│ >  63 │   │   │   │   │   raise RuntimeError(                                                    │
│    64 │   │   │   │   │   │   'aiodns needs a SelectorEventLoop on Windows. See more: https://   │
│    65 │   │   kwargs.pop('sock_state_cb', None)                                                  │
│    66 │   │   timeout = kwargs.pop('timeout', None)                                              │
│                                                                                                  │
│ ┌──────────────────────────── locals ─────────────────────────────┐                              │
│ │      kwargs = {}                                                │                              │
│ │        loop = None                                              │                              │
│ │ nameservers = None                                              │                              │
│ │        self = <aiodns.DNSResolver object at 0x000002B440F006E0> │                              │
│ └─────────────────────────────────────────────────────────────────┘                              │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
RuntimeError: aiodns needs a SelectorEventLoop on Windows. See more: https://github.com/saghul/aiodns/issues/86
Exception ignored in: <bound method BaseEventLoop.call_exception_handler of <ProactorEventLoop running=False closed=True debug=False>>
Traceback (most recent call last):
  File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 1854, in call_exception_handler
  File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\logging\__init__.py", line 1568, in error
  File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\logging\__init__.py", line 1684, in _log
  File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\logging\__init__.py", line 1700, in handle
  File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\logging\__init__.py", line 1762, in callHandlers
  File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\logging\__init__.py", line 1028, in handle
  File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich\logging.py", line 160, in emit
  File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich\logging.py", line 221, in render
  File "C:\Users\Loham\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich\_log_render.py", line 43, in __call__
ImportError: sys.meta_path is None, Python is likely shutting down

Config File

[downloads]
# Folder where tracks are downloaded to
folder = "C:\\Users\\Loham\\StreamripDownloads"
# Put Qobuz albums in a 'Qobuz' folder, Tidal albums in 'Tidal' etc.
source_subdirectories = false

# Download (and convert) tracks all at once, instead of sequentially. 
# If you are converting the tracks, or have fast internet, this will 
# substantially improve processing speed.
concurrency = true
# The maximum number of tracks to download at once
# If you have very fast internet, you will benefit from a higher value,
# A value that is too high for your bandwidth may cause slowdowns
# Set to -1 for no limit
max_connections = 10
# Max number of API requests per source to handle per minute
# Set to -1 for no limit
requests_per_minute = 60

[qobuz]
# 1: 320kbps MP3, 2: 16/44.1, 3: 24/<=96, 4: 24/>=96
quality = 3
# This will download booklet pdfs that are included with some albums
download_booklets = true

# Authenticate to Qobuz using auth token? Value can be true/false only
use_auth_token = false
# Enter your userid if the above use_auth_token is set to true, else enter your email
email_or_userid = ""
# Enter your auth token if the above use_auth_token is set to true, else enter the md5 hash of your plaintext password
password_or_token = ""
# Do not change
app_id = ""
# Do not change
secrets = []

[tidal]
# 0: 256kbps AAC, 1: 320kbps AAC, 2: 16/44.1 "HiFi" FLAC, 3: 24/44.1 "MQA" FLAC
quality = 3
# This will download videos included in Video Albums.
download_videos = true

# Do not change any of the fields below
user_id = ""
country_code = ""
access_token = ""
refresh_token = ""
# Tokens last 1 week after refresh. This is the Unix timestamp of the expiration
# time. If you haven't used streamrip in more than a week, you may have to log
# in again using `rip config --tidal`
token_expiry = ""

[deezer]
# 0, 1, or 2
# This only applies to paid Deezer subscriptions. Those using deezloader
# are automatically limited to quality = 1
quality = 2
# An authentication cookie that allows streamrip to use your Deezer account
# See https://github.com/nathom/streamrip/wiki/Finding-Your-Deezer-ARL-Cookie
# for instructions on how to find this
arl = "removed as I suspect this to be a credential, can confirm the value in my actual config is like 100 characters long though"
# This allows for free 320kbps MP3 downloads from Deezer
# If an arl is provided, deezloader is never used
use_deezloader = true
# This warns you when the paid deezer account is not logged in and rip falls
# back to deezloader, which is unreliable
deezloader_warnings = true

[soundcloud]
# Only 0 is available for now
quality = 0
# This changes periodically, so it needs to be updated
client_id = ""
app_version = ""

[youtube]
# Only 0 is available for now
quality = 0
# Download the video along with the audio
download_videos = false
# The path to download the videos to
video_downloads_folder = "C:\\Users\\Loham\\StreamripDownloads\\YouTubeVideos"

[database]
# Create a database that contains all the track IDs downloaded so far
# Any time a track logged in the database is requested, it is skipped
# This can be disabled temporarily with the --no-db flag
downloads_enabled = true
# Path to the downloads database 
downloads_path = "C:\\Users\\Loham\\AppData\\Roaming\\streamrip\\downloads.db"
# If a download fails, the item ID is stored here. Then, `rip repair` can be
# called to retry the downloads
failed_downloads_enabled = true
failed_downloads_path = "C:\\Users\\Loham\\AppData\\Roaming\\streamrip\\failed_downloads.db"

# Convert tracks to a codec after downloading them.
[conversion]
enabled = false
# FLAC, ALAC, OPUS, MP3, VORBIS, or AAC
codec = "ALAC"
# In Hz. Tracks are downsampled if their sampling rate is greater than this. 
# Value of 48000 is recommended to maximize quality and minimize space
sampling_rate = 48000
# Only 16 and 24 are available. It is only applied when the bit depth is higher
# than this value.
bit_depth = 24
# Only applicable for lossy codecs
lossy_bitrate = 320

# Filter a Qobuz artist's discography. Set to 'true' to turn on a filter.
# This will also be applied to other sources, but is not guaranteed to work correctly
[qobuz_filters]
# Remove Collectors Editions, live recordings, etc.
extras = false
# Picks the highest quality out of albums with identical titles.
repeats = false
# Remove EPs and Singles
non_albums = false
# Remove albums whose artist is not the one requested
features = false
# Skip non studio albums
non_studio_albums = false
# Only download remastered albums
non_remaster = false

[artwork]
# Write the image to the audio file
embed = true
# The size of the artwork to embed. Options: thumbnail, small, large, original.
# "original" images can be up to 30MB, and may fail embedding. 
# Using "large" is recommended.
embed_size = "large"
# If this is set to a value > 0, max(width, height) of the embedded art will be set to this value in pixels
# Proportions of the image will remain the same
embed_max_width = -1
# Save the cover image at the highest quality as a seperate jpg file
save_artwork = true
# If this is set to a value > 0, max(width, height) of the saved art will be set to this value in pixels
# Proportions of the image will remain the same
saved_max_width = -1


[metadata]
# Sets the value of the 'ALBUM' field in the metadata to the playlist's name. 
# This is useful if your music library software organizes tracks based on album name.
set_playlist_to_album = true
# If part of a playlist, sets the `tracknumber` field in the metadata to the track's 
# position in the playlist instead of its position in its album
renumber_playlist_tracks = true
# The following metadata tags won't be applied
# See https://github.com/nathom/streamrip/wiki/Metadata-Tag-Names for more info
exclude = []

# Changes the folder and file names generated by streamrip.
[filepaths]
# Create folders for single tracks within the downloads directory using the folder_format
# template
add_singles_to_folder = false
# Available keys: "albumartist", "title", "year", "bit_depth", "sampling_rate",
# "id", and "albumcomposer"
folder_format = "{albumartist} - {title} ({year}) [{container}] [{bit_depth}B-{sampling_rate}kHz]"
# Available keys: "tracknumber", "artist", "albumartist", "composer", "title",
# and "albumcomposer", "explicit"
track_format = "{tracknumber:02}. {artist} - {title}{explicit}"
# Only allow printable ASCII characters in filenames.
restrict_characters = false
# Truncate the filename if it is greater than this number of characters
# Setting this to false may cause downloads to fail on some systems
truncate_to = 120

# Last.fm playlists are downloaded by searching for the titles of the tracks
[lastfm]
# The source on which to search for the tracks.
source = "qobuz"
# If no results were found with the primary source, the item is searched for 
# on this one.
fallback_source = ""

[cli]
# Print "Downloading {Album name}" etc. to screen
text_output = true
# Show resolve, download progress bars
progress_bars = true
# The maximum number of search results to show in the interactive menu
max_search_results = 100

[misc]
# Metadata to identify this config file. Do not change.
version = "2.0.3"
# Print a message if a new version of streamrip is available 
check_for_updates = true

Operating System

Windows 10

streamrip version

2.0.5

Screenshots and recordings

No response

Additional context

No response

@Loham Loham added the bug Something isn't working label Aug 4, 2024
@RyanThaDude
Copy link

Had the same issue on a new install. I found out that aiohttp 3.10.0 on Windows is the issue. Downgrade it to 3.9.5

pip3 install aiohttp==3.9.5

@JustMKMe
Copy link

I had same issue. RyanThaDude's solution helped out.

@Mhrnb
Copy link

Mhrnb commented Sep 29, 2024

Had the same issue on a new install. I found out that aiohttp 3.10.0 on Windows is the issue. Downgrade it to 3.9.5

pip3 install aiohttp==3.9.5

Thank you very much, brother.

@Elsayed91
Copy link

adding this line somewhere in the code also can fix it

if sys.platform == 'win32':
	asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

@Agushunterr05
Copy link

Had the same issue on a new install. I found out that aiohttp 3.10.0 on Windows is the issue. Downgrade it to 3.9.5

pip3 install aiohttp==3.9.5

thankssss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants