-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spotify to .txt file #29
Comments
It looks like the plugin didn't specify to use utf8 when writing files. If you pull and run the 1.1.0 branch has it fixed the problem? |
I pulled the latest and it still fails but has a different error this time:
|
It looks like maybe one of the songs in a playlist is missing an artist tag? artists = [artist["name"] for artist in track["artists"]]
TypeError: 'NoneType' object is not subscriptable This suggests the |
So I've been trying to isolate the issues and there's two discoveries so far:
|
Good idea, the latest 1.1.0 branch should skip any songs that it can't read properly. Give it a go and let me know if it works! If not, let me know an example song that it fails on for me to test |
Updated to 1.1.0 branch by downloading the zip, then copying and pasting the files in my ultrasonics folder. Unfortunately, it still failed. Here's a song that causes it to fail: https://open.spotify.com/track/4qzBepJAKtYu4T1GDtBZZc?si=cbeb47cc99054381
|
It seems that one of the songs from Spotify hasn't got a valid ID. If you are able to run in debug mode, put a break point at line 396 of up_spotify.py, and have a look at the |
Managed to test this myself with the song you supplied - I don't have the same error.
{'album': {'name': 'RISE', 'release_date': '2014-06-13'}, 'artists': [{...}], 'external_ids': {'isrc': 'KRB471402723'}, 'id': '4qzBepJAKtYu4T1GDtBZZc', 'name': '눈,코,입 (Eyes, Nose, Lips)', 'track_number': 2} And the plugin completes without issue. Could I ask you to re-download ultrasonics (1.1.0 is now the main branch and latest release), and try again? My only thought is a glitch on spotify's end, maybe the song was missing something temporarily, but that's now been fixed? |
Hey! thanks for looking into this again. I've been meaning to take a look myself as well just haven't had time (I bought some new equipment and have been re building my server). I should have time to give your suggestions a try tomorrow. will keep you posted! |
So I tested it on multiple playlists and it works on 99% of them. There is only one or two playlists that causes the program to stop and I think it is the issue that you pointed out (on spotify's end) where the song doesn't have a valid ID. (The song that I sent to test works fine now. Other Korean songs now work also). Is there a way to have the program jump the song with no ID and let the program continue listing for that and other playlists? Thanks for all of this btw. Knowing that I have a record of the 50-some playlists I've created really give me some peace of mind! `Converting tracks in 1djHlnZ2iNlg4hd6lFnAiZ: 30%|█████████████▍ | 25/84 [00:00<?, ?it/s] During handling of the above exception, another exception occurred: Traceback (most recent call last): |
I could allow it to skip tracks without an ID, but I'm hesitant to do so - I feel like there is no reason a song wouldn't have an ID so I'd be concerned that skipping it would potentially mask other issues, maybe if the Spotify API updates and breaks something, I would rather dramatic failure over a silent warning ;) I'm hoping that the cases you've discovered are temporary - either a glitch with the Spotify API or for some reason they are actually missing an ID, but would be updated soon. |
I'm trying to create a txt file via spotify and I keep getting the same error.
←[38m2021-09-06 18:08:27,640 - plugins - DEBUG - Running plugin custom file v0.1 (plugins.py:158)←[0m ←[31m2021-09-06 18:08:27,656 - plugins - ERROR - 'charmap' codec can't encode characters in position 174-178: character maps to <undefined> (plugins.py:291)←[0m Traceback (most recent call last): File "C:\Program Files (x86)\ultrasonics\ultrasonics\plugins.py", line 285, in applet_run plugin_run(*get_info(plugin), component="outputs", File "C:\Program Files (x86)\ultrasonics\ultrasonics\plugins.py", line 162, in plugin_run response = found_plugins[name].run( File "C:\Program Files (x86)\ultrasonics\ultrasonics\official_plugins\up_custom file.py", line 79, in run f.write("\n".join(write_lines)) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 174-178: character maps to <undefined> ←[33m2021-09-06 18:08:27,688 - plugins - WARNING - Applet 47c6a149-0f5a-11ec-a40b-54424958cd16 failed in 0:00:04.828303 (plugins.py:299)←[0m ←[96m2021-09-06 18:08:27,706 - database - INFO - Applet lastrun updated (database.py:377)←[0m
I believe it's because my playlists includes songs with Asian characters (Japanese, Korean, Chinese) but I'm not 100% sure.
I've tried using keywords to limit the playlists which only include English characters but it doesn't create the txt at all in some cases.
Any suggestions welcome
The text was updated successfully, but these errors were encountered: