Check for podcast episode in playlists
This commit is contained in:
parent
1eef9756fd
commit
6dd0ad968b
1 changed files with 12 additions and 9 deletions
|
@ -4,7 +4,7 @@ import os
|
||||||
|
|
||||||
from album import download_album, download_artist_albums
|
from album import download_album, download_artist_albums
|
||||||
from const import TRACK, NAME, ID, ARTIST, ARTISTS, ITEMS, TRACKS, EXPLICIT, ALBUM, ALBUMS, \
|
from const import TRACK, NAME, ID, ARTIST, ARTISTS, ITEMS, TRACKS, EXPLICIT, ALBUM, ALBUMS, \
|
||||||
OWNER, PLAYLIST, PLAYLISTS, DISPLAY_NAME
|
OWNER, PLAYLIST, PLAYLISTS, DISPLAY_NAME, TYPE
|
||||||
from playlist import get_playlist_songs, get_playlist_info, download_from_user_playlist, download_playlist
|
from playlist import get_playlist_songs, get_playlist_info, download_from_user_playlist, download_playlist
|
||||||
from podcast import download_episode, get_show_episodes
|
from podcast import download_episode, get_show_episodes
|
||||||
from termoutput import Printer, PrintChannel
|
from termoutput import Printer, PrintChannel
|
||||||
|
@ -88,14 +88,17 @@ def download_from_urls(urls: list[str]) -> bool:
|
||||||
if not song[TRACK][NAME] or not song[TRACK][ID]:
|
if not song[TRACK][NAME] or not song[TRACK][ID]:
|
||||||
Printer.print(PrintChannel.SKIPS, '### SKIPPING: SONG DOES NOT EXIST ANYMORE ###' + "\n")
|
Printer.print(PrintChannel.SKIPS, '### SKIPPING: SONG DOES NOT EXIST ANYMORE ###' + "\n")
|
||||||
else:
|
else:
|
||||||
download_track('playlist', song[TRACK][ID], extra_keys=
|
if song[TRACK][TYPE] == "episode": # Playlist item is a podcast episode
|
||||||
{
|
download_episode(song[TRACK][ID])
|
||||||
'playlist_song_name': song[TRACK][NAME],
|
else:
|
||||||
'playlist': name,
|
download_track('playlist', song[TRACK][ID], extra_keys=
|
||||||
'playlist_num': str(enum).zfill(char_num),
|
{
|
||||||
'playlist_id': playlist_id,
|
'playlist_song_name': song[TRACK][NAME],
|
||||||
'playlist_track_id': song[TRACK][ID]
|
'playlist': name,
|
||||||
})
|
'playlist_num': str(enum).zfill(char_num),
|
||||||
|
'playlist_id': playlist_id,
|
||||||
|
'playlist_track_id': song[TRACK][ID]
|
||||||
|
})
|
||||||
enum += 1
|
enum += 1
|
||||||
elif episode_id is not None:
|
elif episode_id is not None:
|
||||||
download = True
|
download = True
|
||||||
|
|
Loading…
Add table
Reference in a new issue