mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-24 20:14:42 -04:00
Create custom async downloader for HLS streams
This commit is contained in:
parent
5b2aaf5ad2
commit
9f5cd49aab
7 changed files with 364 additions and 184 deletions
23
tests/test_download.py
Normal file
23
tests/test_download.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
import os
|
||||
import time
|
||||
from pprint import pprint
|
||||
|
||||
from streamrip.downloadtools import DownloadPool
|
||||
|
||||
|
||||
def test_downloadpool(tmpdir):
|
||||
start = time.perf_counter()
|
||||
with DownloadPool(
|
||||
(
|
||||
f"https://pokeapi.co/api/v2/pokemon/{number}"
|
||||
for number in range(1, 151)
|
||||
),
|
||||
tempdir=tmpdir,
|
||||
) as pool:
|
||||
pool.download()
|
||||
assert len(os.listdir(tmpdir)) == 151
|
||||
|
||||
# the tempfiles should be removed at this point
|
||||
assert len(os.listdir(tmpdir)) == 0
|
||||
|
||||
print(f"Finished in {time.perf_counter() - start}s")
|
Loading…
Add table
Add a link
Reference in a new issue