initial commit
This commit is contained in:
commit
f59b9683f7
15 changed files with 1542 additions and 0 deletions
24
spodcast/app.py
Normal file
24
spodcast/app.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
import logging
|
||||
|
||||
from itertools import islice
|
||||
from librespot.audio.decoders import AudioQuality
|
||||
|
||||
from spodcast.podcast import download_episode, get_show_episodes
|
||||
from spodcast.utils import regex_input_for_urls
|
||||
from spodcast.spodcast import Spodcast
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
def client(args) -> None:
|
||||
Spodcast(args)
|
||||
Spodcast.DOWNLOAD_QUALITY = AudioQuality.NORMAL
|
||||
|
||||
if args.urls:
|
||||
for spotify_url in args.urls:
|
||||
episode_id, show_id = regex_input_for_urls(spotify_url)
|
||||
log.debug(f"episode_id {episode_id}. show_id {show_id}")
|
||||
if episode_id is not None:
|
||||
download_episode(episode_id)
|
||||
elif show_id is not None:
|
||||
for episode in islice(get_show_episodes(show_id), Spodcast.CONFIG.get_max_episodes()):
|
||||
download_episode(episode)
|
Loading…
Add table
Add a link
Reference in a new issue