mirror of
				https://github.com/Alexander-D-Karpov/akarpov
				synced 2025-11-04 03:27:24 +03:00 
			
		
		
		
	fixed music info retrieve
This commit is contained in:
		
							parent
							
								
									4aa1d207aa
								
							
						
					
					
						commit
						b63beb8da8
					
				| 
						 | 
					@ -365,13 +365,14 @@ def update_author_info(author: Author) -> None:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def search_all_platforms(track_name: str) -> dict:
 | 
					def search_all_platforms(track_name: str) -> dict:
 | 
				
			||||||
    print(track_name)
 | 
					    print(track_name)
 | 
				
			||||||
    session = spotipy.Spotify(
 | 
					    # session = spotipy.Spotify(
 | 
				
			||||||
        auth_manager=spotipy.SpotifyClientCredentials(
 | 
					    #     auth_manager=spotipy.SpotifyClientCredentials(
 | 
				
			||||||
            client_id=settings.MUSIC_SPOTIFY_ID,
 | 
					    #         client_id=settings.MUSIC_SPOTIFY_ID,
 | 
				
			||||||
            client_secret=settings.MUSIC_SPOTIFY_SECRET,
 | 
					    #         client_secret=settings.MUSIC_SPOTIFY_SECRET,
 | 
				
			||||||
        )
 | 
					    #     )
 | 
				
			||||||
    )
 | 
					    # )
 | 
				
			||||||
    spotify_info = get_spotify_info(track_name, session)
 | 
					    # spotify_info = get_spotify_info(track_name, session)
 | 
				
			||||||
 | 
					    spotify_info = {}  # TODO: add proxy for info retrieve
 | 
				
			||||||
    yandex_info = search_yandex(track_name)
 | 
					    yandex_info = search_yandex(track_name)
 | 
				
			||||||
    if "album_image_path" in spotify_info and "album_image_path" in yandex_info:
 | 
					    if "album_image_path" in spotify_info and "album_image_path" in yandex_info:
 | 
				
			||||||
        os.remove(yandex_info["album_image_path"])
 | 
					        os.remove(yandex_info["album_image_path"])
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user