Skip to content
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

ValueError: could not convert string to float: '' #27

Closed
unicav opened this issue Nov 9, 2023 · 3 comments
Closed

ValueError: could not convert string to float: '' #27

unicav opened this issue Nov 9, 2023 · 3 comments

Comments

@unicav
Copy link

unicav commented Nov 9, 2023

Ubuntu 22.04
Python 3.10.12

INFO:root:Created playlist with name=Test at id=4rkgtHurcTnsGjp7lHNFMr
Traceback (most recent call last):
File "/usr/local/bin/tospotify", line 8, in
sys.exit(main())
File "/home/serenity/.local/lib/python3.10/site-packages/tospotify/run.py", line 87, in main
update_spotify_playlist(spot, playlist_path, playlist_id, args.convert)
File "/home/serenity/.local/lib/python3.10/site-packages/tospotify/search.py", line 120, in update_spotify_playlist
songs = parse_songs(playlist_path)
File "/home/serenity/.local/lib/python3.10/site-packages/tospotify/parser.py", line 33, in parse_songs
playlist = m3u8.load(playlist_path)
File "/home/serenity/.local/lib/python3.10/site-packages/m3u8/init.py", line 49, in load
return _load_from_file(uri, custom_tags_parser)
File "/home/serenity/.local/lib/python3.10/site-packages/m3u8/init.py", line 56, in _load_from_file
return M3U8(raw_content, base_uri=base_uri, custom_tags_parser=custom_tags_parser)
File "/home/serenity/.local/lib/python3.10/site-packages/m3u8/model.py", line 153, in init
self.data = parse(content, strict, custom_tags_parser)
File "/home/serenity/.local/lib/python3.10/site-packages/m3u8/parser.py", line 143, in parse
_parse_extinf(line, data, state, lineno, strict)
File "/home/serenity/.local/lib/python3.10/site-packages/m3u8/parser.py", line 261, in _parse_extinf
state['segment']['duration'] = float(duration)
ValueError: could not convert string to float: ''

@radujica
Copy link
Owner

radujica commented Nov 9, 2023

Does the playlist file contain a #EXTINF: entry without any number of seconds, such as #EXTINF:123?

According to https://en.wikipedia.org/wiki/M3U that's invalid, so the error is correct.

@unicav
Copy link
Author

unicav commented Nov 9, 2023 via email

@radujica
Copy link
Owner

radujica commented Nov 9, 2023

tospotify relies fully on m3u8 for parsing. Will see if an improved error message can be added there, but otherwise I count this as closed.

Perhaps, for tospotify, consider using another playlist-making app that would handle this scenario. Cheers!

@radujica radujica closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants