def grab_album(album_id, gpm): album = gpm.get_album(album_id) if cc.concurrency: return chimera.concurrency.blackhole(album, 'album') print('grabbing gpm album %s' % album.title) for track in album.songs: any_track(track, gpm, overwrite=cc.dl_album_overwrite, add_to_db=cc.dl_album_add_to_db, check_db=cc.dl_album_check_db)
def _any_track(task, service, dlthread=None, *args, **kwargs): if task.track.service == 'deezer': ds = any_track(task.track, service, overwrite=cc.dl_track_overwrite, add_to_db=cc.dl_track_add_to_db, check_db=cc.dl_track_check_db, lyrics=cc.tag_lyrics, save_lyrics=cc.save_lyrics, task=task, dlthread=dlthread) elif task.track.service in ['tidal', 'qobuz', 'napster', 'gpm']: ds = any_track(task.track, service, overwrite=cc.dl_track_overwrite, add_to_db=cc.dl_track_add_to_db, check_db=cc.dl_track_check_db, task=task, dlthread=dlthread) elif task.track.service == 'spotify': ds = sp_track(task.track, service, task=task, dlthread=dlthread) # uses playlist config parse_ds(ds, verbose=False) task.download_status = ds
def grab_track(song_id, deezer: Deezer, add_to_db=True): track = deezer.get_track(int(song_id)) if cc.concurrency: return chimera.concurrency.blackhole(track, 'track') ds = any_track(track, deezer, overwrite=cc.dl_track_overwrite, add_to_db=cc.dl_track_add_to_db, check_db=cc.dl_track_check_db, lyrics=cc.tag_lyrics, save_lyrics=cc.save_lyrics) cli.utils.parse_ds(ds)
def grab_track(song_id, gpm): track = gpm.get_track(song_id) if cc.concurrency: return chimera.concurrency.blackhole(track, 'track') ds = any_track(track, gpm, overwrite=cc.dl_track_overwrite, add_to_db=cc.dl_track_add_to_db, check_db=cc.dl_track_check_db) if ds.failed: print(ds.reason)
def grab_album(album_id, qobuz: Qobuz): album = qobuz.get_album(album_id) if cc.concurrency: return chimera.concurrency.blackhole(album, 'album') print('grabbing qobuz album %s' % album.title) for track in album.songs: ds = any_track(track, qobuz, overwrite=cc.dl_album_overwrite, add_to_db=cc.dl_album_add_to_db, check_db=cc.dl_album_check_db) cli.utils.parse_ds(ds)
def grab_track(song_id, qobuz): # 62333205 track = qobuz.get_track(song_id) if track: if cc.concurrency: return chimera.concurrency.blackhole(track, 'track') ds = any_track(track, qobuz, overwrite=cc.dl_track_overwrite, add_to_db=cc.dl_track_add_to_db, check_db=cc.dl_track_check_db) cli.utils.parse_ds(ds) else: print('Track not available on qobuz!')
def grab_album(album_id, deezer: Deezer, add_to_db=True): album = deezer.get_album(album_id) if cc.concurrency: return chimera.concurrency.blackhole(album, 'album') print('grabbing deezer album %s' % album.title) for track in album.songs: ds = any_track(track, deezer, overwrite=cc.dl_album_overwrite, add_to_db=cc.dl_album_add_to_db, check_db=cc.dl_album_check_db, lyrics=cc.tag_lyrics, save_lyrics=cc.save_lyrics) cli.utils.parse_ds(ds)
def grab_track(song_id, tidal: 'Tidal'): track = tidal.get_track(int(song_id)) if track: if cc.concurrency: return chimera.concurrency.blackhole(track, 'track') ds = any_track(track, tidal, overwrite=cc.dl_track_overwrite, add_to_db=cc.dl_track_add_to_db, check_db=cc.dl_track_check_db) cli.utils.parse_ds(ds)
def _any_album(task, service, dlthread=None, *args, **kwargs): if task.service == 'deezer': ds = any_track(task.track, service, overwrite=cc.dl_album_overwrite, add_to_db=cc.dl_album_add_to_db, check_db=cc.dl_album_check_db, lyrics=cc.tag_lyrics, save_lyrics=cc.save_lyrics, task=task, dlthread=dlthread) else: ds = any_track(task.track, service, overwrite=cc.dl_album_overwrite, add_to_db=cc.dl_album_add_to_db, check_db=cc.dl_album_check_db, task=task, dlthread=dlthread) parse_ds(ds, verbose=False) task.download_status = ds
def grab_track(song_id, napster: Napster): if song_id.startswith('http'): return grab_track_from_url(song_id, napster) track = napster.get_track(song_id) if cc.concurrency: return chimera.concurrency.blackhole(track, 'track') ds = any_track(track, napster, overwrite=cc.dl_track_overwrite, add_to_db=cc.dl_track_add_to_db, check_db=cc.dl_track_check_db) cli.utils.parse_ds(ds)
def grab_album(album_id, tidal): album = tidal.get_album(album_id) if album: if cc.concurrency: return chimera.concurrency.blackhole(album, 'album') print('grabbing tidal album %s' % album.title) for track in album.songs: ds = any_track(track, tidal, overwrite=cc.dl_album_overwrite, add_to_db=cc.dl_album_add_to_db, check_db=cc.dl_album_check_db) cli.utils.parse_ds(ds) else: cli.utils.pred('Album not found!')
def grab_album(album_id, napster: Napster): if album_id.startswith('http'): return grab_album_from_url(album_id, napster) album = napster.get_album(album_id) if cc.concurrency: return chimera.concurrency.blackhole(album, 'album') print('grabbing napster album %s' % album.title) for track in album.songs: ds = any_track(track, napster, overwrite=cc.dl_album_overwrite, add_to_db=cc.dl_album_add_to_db, check_db=cc.dl_album_check_db) if ds.failed: pred(ds.reason)
def _any_discography(task, service, dlthread=None, *args, **kwargs): if task.service == 'deezer': ds = any_track(task.track, service, overwrite=cc.dl_discography_overwrite, add_to_db=cc.dl_discography_add_to_db, check_db=cc.dl_discography_check_db, lyrics=cc.tag_lyrics, save_lyrics=cc.save_lyrics, task=task, dlthread=dlthread) elif task.track.service == 'spotify': ds = sp_track(task.track, service, task=task, dlthread=dlthread) # uses playlist config else: ds = any_track(task.track, service, overwrite=cc.dl_discography_overwrite, add_to_db=cc.dl_discography_add_to_db, check_db=cc.dl_discography_check_db, task=task, dlthread=dlthread) parse_ds(ds, verbose=False) task.download_status = ds
def test_track_download(self): track = self.qobuz.get_track(64366361) track.update_tags(self.qobuz) ds = any_track(track, self.qobuz) track.update_tags(ds.file_name) self.assertTrue(ds.failed == False)
def test_track_download(self): track = self.tidal.get_track(113297575) track.update_tags(self.tidal) ds = any_track(track, self.tidal) track.update_tags(ds.file_name) self.assertTrue(ds.failed == False)
def test_track_download(self): track = self.deezer.get_track(698905582) track.update_tags(self.deezer) ds = any_track(track, self.deezer) track.update_tags(ds.file_name) self.assertTrue(ds.failed == False)
def test_track_download(self): track = self.napster.get_track(365693021) track.update_tags(self.napster) ds = any_track(track, self.napster) track.update_tags(ds.file_name) self.assertTrue(ds.failed == False)