mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-09 14:11:55 -04:00
17 lines
305 B
Python
17 lines
305 B
Python
import asyncio
|
|
|
|
loop = asyncio.new_event_loop()
|
|
|
|
|
|
def arun(coro):
|
|
return loop.run_until_complete(coro)
|
|
|
|
|
|
def afor(async_gen):
|
|
async def _afor(async_gen):
|
|
items = []
|
|
async for item in async_gen:
|
|
items.append(item)
|
|
return items
|
|
|
|
return arun(_afor(async_gen))
|