mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Even more logging in spotify download
Fix #1 Test fix 2 Fixing part 2 Fixing ctnd Final fix Fixing spotipy get bug Same plusy kurwa Fixing fucking spotipy test More logging
This commit is contained in:
@@ -1064,11 +1064,15 @@ async def get_file(ctx, source, link):
|
||||
if source == "Spotify":
|
||||
dir_path = None
|
||||
item_type, item_id = spotify.parse_spotify_url(link)
|
||||
if item_id:
|
||||
coro = asyncio.to_thread(spotify.fetch_tracks, spotify_ctrl, item_type, link)
|
||||
file_list = await coro
|
||||
coro = asyncio.to_thread(spotify.get_item_name, spotify_ctrl, item_type, item_id)
|
||||
directory_name = await coro
|
||||
if item_type in ["album", "track", "playlist"] and item_id:
|
||||
logger.info(item_type)
|
||||
logger.info(item_id)
|
||||
logger.info("Spotify link provided")
|
||||
file_list = await asyncio.to_thread(spotify.fetch_tracks, spotify_ctrl, item_type, link)
|
||||
logger.info(file_list)
|
||||
directory_name = await asyncio.to_thread(spotify.get_item_name, spotify_ctrl, item_type, item_id)
|
||||
logger.info(directory_name)
|
||||
logger.info("Spotify scrape done")
|
||||
url_data = {"urls": []}
|
||||
url_dict = {}
|
||||
url_dict["save_path"] = Path(
|
||||
@@ -1078,6 +1082,7 @@ async def get_file(ctx, source, link):
|
||||
url_dict["songs"] = file_list
|
||||
url_data["urls"].append(url_dict.copy())
|
||||
file_name_f = youtube_download.default_filename
|
||||
logger.info("YT-DL")
|
||||
coro = asyncio.to_thread(
|
||||
youtube_download.download_songs,
|
||||
songs=url_data,
|
||||
@@ -1093,6 +1098,7 @@ async def get_file(ctx, source, link):
|
||||
proxy="",
|
||||
)
|
||||
_ = await coro
|
||||
logger.info("YT-DL done")
|
||||
dir_path = (url_dict["save_path"].resolve()).as_posix()
|
||||
if platform == "win32":
|
||||
dir_path = dir_path.replace("/", "\\")
|
||||
@@ -1829,9 +1835,8 @@ async def wyczysc_ulubione(ctx):
|
||||
"""
|
||||
async with ctx.typing():
|
||||
coroutine = asyncio.to_thread(
|
||||
requests.post,
|
||||
requests.get,
|
||||
f"{FILE_SERVICE_ADDRESS}{CLEAR_PRIO}",
|
||||
json={},
|
||||
timeout=360,
|
||||
)
|
||||
_ = await coroutine
|
||||
|
||||
Reference in New Issue
Block a user