Skip to content

Commit 0daa0ff

Browse files
committed
feat: show if song requires go+
1 parent 472aec4 commit 0daa0ff

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mov_cli_soundcloud/scraper.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from mov_cli.http_client import HTTPClient
66

77
if TYPE_CHECKING:
8-
from typing import Optional, Generator, Any
8+
from typing import Optional
99

1010
from mov_cli import Config
1111
from mov_cli.http_client import HTTPClient
@@ -53,10 +53,12 @@ def search(self, query: str, limit: Optional[int]) -> Iterable[Metadata]:
5353
if item["href"].count("/") == 2: # NOTE: only get music
5454
with yt_dlp.YoutubeDL(yt_options) as f:
5555
info = f.extract_info(self.base_url + item["href"])
56+
57+
go = " (GO+)" if "preview" in info.get("formats")[-1]["url"] else ""
5658

5759
yield SoundCloudMetadata(
5860
id = _,
59-
title = info.get("title") + " ~ " + info.get("uploader"),
61+
title = info.get("title") + f"{go} ~ " + info.get("uploader"),
6062
type = MetadataType.SINGLE,
6163
image_url = info.get("thumbnails")[-1]["url"],
6264
year = info.get("upload_date", "")[:4],
@@ -68,7 +70,7 @@ def search(self, query: str, limit: Optional[int]) -> Iterable[Metadata]:
6870
)
6971
)
7072

71-
def scrape(self, metadata: SoundCloudScraper, episode: utils.EpisodeSelector) -> Single:
73+
def scrape(self, metadata: SoundCloudMetadata, _: utils.EpisodeSelector) -> Single:
7274
return Single(
7375
url = metadata.info.get("formats")[-1]["url"],
7476
title = metadata.title,

0 commit comments

Comments
 (0)