invidious
invidious copied to clipboard
[Bug] Youtube Playlist`s import parser asks for a missing field (Title)
Describe the bug I got a an index 6 error when I tried to import a youtube playlist .csv file. It seems that the CSV that Google Takeout is producing doesn'thave the "Title" field before the "Description" field.
Steps to Reproduce
- Export your youtube playlists with Google Takeout
- Import a Playlist CSV
- See the error below
Logs
Title: `Missing column index: 6 (IndexError)`
Date: `2023-07-01T01:45:12Z`
Route: `/data_control?referer=%2Ffeed%2Fplaylists`
Version: `2023.06.21-75c4c0b3 @ master`
<details>
<summary>Backtrace</summary>
<p>
\```
Missing column index: 6 (IndexError)
from /usr/share/crystal/src/csv.cr:315:5 in '[]'
from src/invidious/user/imports.cr:44:10 in 'update_data_control'
from lib/kemal/src/kemal/route.cr:12:9 in '->'
from src/invidious/helpers/handlers.cr:30:37 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
from lib/kemal/src/kemal/filter_handler.cr:21:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
from src/invidious/helpers/handlers.cr:94:12 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
from src/invidious/helpers/handlers.cr:151:29 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
from src/ext/kemal_static_file_handler.cr:112:11 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
from /usr/share/crystal/src/http/server/request_processor.cr:51:11 in 'process'
from /usr/share/crystal/src/http/server.cr:502:5 in '->'
from /usr/share/crystal/src/fiber.cr:146:11 in 'run'
from ???
\```
</p>
</details>
Screenshots
No "Title" field in the exported CSV
Additional context
- If I manually add the Title field, the import is properly processed.
Same here. I wonder if the csv format just changed and hasn't been fixed here yet. Probably not too difficult to update, assuming this is the problem.
Yup. Adding ,Title
to the end of the header (first line) in the playlist.csv file allows it to be uploaded no problem, although it seems to put the Visibility in the description field...
Silly me. Here are the parsing lines:
https://github.com/iv-org/invidious/blob/34508966027fce3f460d9670eeecef67b92565a0/src/invidious/user/imports.cr#L38-L42
Looks like Title goes before description
I wonder if simply removing line 40 and decrementing the indices would fix it.
Feel free to make a PR!
Index out of bounds error persists - I think either I am having CSV issues or Youtube has changed the CSV columns again. I only have two columns in my Watch Later playlist (other playlists are the same but this is the only one I care about). CSV columns are 'Video ID' and 'Playlist Video Creation Timestamp'
Title:
Index out of bounds (IndexError)
Date:2023-10-09T22:57:49Z
Route:/data_control?referer=%2Ffeed%2Fplaylists
Version:2023.09.18-bb14f794 @ master
Backtrace
Index out of bounds (IndexError) from /usr/share/crystal/src/indexable.cr:949:8 in '[]' from src/invidious/user/imports.cr:35:17 in 'parse_playlist_export_csv' from src/invidious/user/imports.cr:210:20 in 'from_youtube_pl' from src/invidious/routes/preferences.cr:315:21 in 'update_data_control' from src/invidious/routing.cr:66:27 in '->' from lib/kemal/src/kemal/route.cr:12:26 in '->' from src/invidious/helpers/handlers.cr:30:5 in 'process_request' from lib/kemal/src/kemal/route_handler.cr:17:7 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from lib/kemal/src/kemal/websocket_handler.cr:13:14 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from lib/kemal/src/kemal/filter_handler.cr:21:7 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/invidious/helpers/handlers.cr:212:5 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/invidious/helpers/handlers.cr:94:12 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/invidious/helpers/handlers.cr:145:12 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/invidious/helpers/handlers.cr:68:12 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/ext/kemal_static_file_handler.cr:112:11 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from lib/kemal/src/kemal/exception_handler.cr:8:7 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from src/invidious/helpers/logger.cr:17:35 in 'call' from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next' from lib/kemal/src/kemal/init_handler.cr:12:7 in 'call' from /usr/share/crystal/src/http/server/request_processor.cr:51:11 in 'process' from /usr/share/crystal/src/http/server.cr:521:5 in 'handle_client' from /usr/share/crystal/src/http/server.cr:451:5 in '->' from /usr/share/crystal/src/fiber.cr:146:11 in 'run' from /usr/share/crystal/src/fiber.cr:98:34 in '->' from ???
I did the same steps but I got an index out of bounds
Index out of bounds error persists - I think either I am having CSV issues or Youtube has changed the CSV columns again. I only have two columns in my Watch Later playlist (other playlists are the same but this is the only one I care about). CSV columns are 'Video ID' and 'Playlist Video Creation Timestamp'
Title:
Index out of bounds (IndexError)
Date:2023-10-09T22:57:49Z
Route:/data_control?referer=%2Ffeed%2Fplaylists
Version:2023.09.18-bb14f794 @ master
Backtrace
I confirm this is still happening. I exported YouTube playlists using google takeout and when trying to import them in invidious I get the same.
I’d do a PR but I’ve never contributed to this project. Any guidance?
Same problem here, adding "Title" does not work.
This is still happening for those who would pass by here, I got the error today. After looking at the CSV file, it seems like google changed their export format again. Now there are only two fields left, I'll try to look at the code and make a PR soon.
This is still happening for those who would pass by here, I got the error today. After looking at the CSV file, it seems like google changed their export format again. Now there are only two fields left, I'll try to look at the code and make a PR soon.
I feel like they do these things on purpose.
Definitely staying tuned if you do end up making a PR - I would love to test this out.
This is still happening for those who would pass by here, I got the error today. After looking at the CSV file, it seems like google changed their export format again. Now there are only two fields left, I'll try to look at the code and make a PR soon.
I feel like they do these things on purpose.
Definitely staying tuned if you do end up making a PR - I would love to test this out.
I did make the PR (see above), it's awaiting review