Test user streams
This commit is contained in:
parent
f5801c36fc
commit
8ea3721b14
|
|
@ -46,11 +46,10 @@ scdl me -f
|
|||
--version Show version
|
||||
-l [url] URL can be track/playlist/user
|
||||
-n [maxtracks] Download the n last tracks of a playlist according to the creation date
|
||||
-s Download the stream of a user (token needed)
|
||||
-a Download all tracks of user (including reposts)
|
||||
-t Download all uploads of a user (no reposts)
|
||||
-f Download all favorites of a user
|
||||
-C Download all commented by a user
|
||||
-f Download all favorites (likes) of a user
|
||||
-C Download all tracks commented on by a user
|
||||
-p Download all playlists of a user
|
||||
-r Download all reposts of user
|
||||
-c Continue if a downloaded file already exists
|
||||
|
|
|
|||
|
|
@ -22,11 +22,10 @@ Options:
|
|||
--version Show version
|
||||
-l [url] URL can be track/playlist/user
|
||||
-n [maxtracks] Download the n last tracks of a playlist according to the creation date
|
||||
-s Download the stream of a user (token needed)
|
||||
-a Download all tracks of user (including reposts)
|
||||
-t Download all uploads of a user (no reposts)
|
||||
-f Download all favorites of a user
|
||||
-C Download all commented by a user
|
||||
-f Download all favorites (likes) of a user
|
||||
-C Download all tracks commented on by a user
|
||||
-p Download all playlists of a user
|
||||
-r Download all reposts of user
|
||||
-c Continue if a downloaded file already exists
|
||||
|
|
|
|||
95
tests/test_user.py
Normal file
95
tests/test_user.py
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from tests.utils import assert_track, call_scdl_with_auth
|
||||
|
||||
|
||||
def count_files(dir: Path):
|
||||
return len(list(dir.rglob("*")))
|
||||
|
||||
|
||||
def test_all(tmp_path: Path):
|
||||
os.chdir(tmp_path)
|
||||
r = call_scdl_with_auth(
|
||||
"-l",
|
||||
"https://soundcloud.com/one-thousand-and-one",
|
||||
"-a",
|
||||
"-o",
|
||||
"3",
|
||||
"--onlymp3",
|
||||
)
|
||||
assert r.returncode == 0
|
||||
assert count_files(tmp_path) == 3
|
||||
|
||||
|
||||
def test_tracks(tmp_path: Path):
|
||||
os.chdir(tmp_path)
|
||||
r = call_scdl_with_auth(
|
||||
"-l",
|
||||
"https://soundcloud.com/one-thousand-and-one",
|
||||
"-t",
|
||||
"--name-format=track",
|
||||
"--onlymp3",
|
||||
)
|
||||
assert r.returncode == 0
|
||||
assert_track(tmp_path, "track.mp3")
|
||||
assert count_files(tmp_path) == 1
|
||||
|
||||
|
||||
def test_likes(tmp_path: Path):
|
||||
os.chdir(tmp_path)
|
||||
r = call_scdl_with_auth(
|
||||
"-l",
|
||||
"https://soundcloud.com/one-thousand-and-one",
|
||||
"-f",
|
||||
"--onlymp3",
|
||||
"--name-format={title}",
|
||||
)
|
||||
assert r.returncode == 0
|
||||
assert_track(
|
||||
tmp_path, "Wan Bushi - Eurodance Vibes (part 1+2+3).mp3", check_metadata=False
|
||||
)
|
||||
assert count_files(tmp_path) == 1
|
||||
|
||||
|
||||
def test_commented(tmp_path: Path):
|
||||
os.chdir(tmp_path)
|
||||
r = call_scdl_with_auth(
|
||||
"-l",
|
||||
"https://soundcloud.com/one-thousand-and-one",
|
||||
"-C",
|
||||
"--onlymp3",
|
||||
"--name-format={title}",
|
||||
)
|
||||
assert r.returncode == 0
|
||||
assert_track(
|
||||
tmp_path, "Wan Bushi - Eurodance Vibes (part 1+2+3).mp3", check_metadata=False
|
||||
)
|
||||
assert count_files(tmp_path) == 1
|
||||
|
||||
|
||||
def test_playlists(tmp_path: Path):
|
||||
os.chdir(tmp_path)
|
||||
r = call_scdl_with_auth(
|
||||
"-l",
|
||||
"https://soundcloud.com/one-thousand-and-one",
|
||||
"-p",
|
||||
"--onlymp3",
|
||||
)
|
||||
assert r.returncode == 0
|
||||
assert count_files(tmp_path) == 3
|
||||
|
||||
|
||||
def test_reposts(tmp_path: Path):
|
||||
os.chdir(tmp_path)
|
||||
r = call_scdl_with_auth(
|
||||
"-l",
|
||||
"https://soundcloud.com/one-thousand-and-one",
|
||||
"-r",
|
||||
"--name-format={title}",
|
||||
)
|
||||
assert r.returncode == 0
|
||||
assert_track(
|
||||
tmp_path, "Wan Bushi - Eurodance Vibes (part 1+2+3).mp3", check_metadata=False
|
||||
)
|
||||
assert count_files(tmp_path) == 1
|
||||
Loading…
Reference in New Issue
Block a user