invidious icon indicating copy to clipboard operation
invidious copied to clipboard

[Bug] Youtube Playlist`s import parser asks for a missing field (Title)

Open Manukineko opened this issue 1 year ago • 13 comments

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

  1. Export your youtube playlists with Google Takeout
  2. Import a Playlist CSV
  3. 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 image

Additional context

  • If I manually add the Title field, the import is properly processed.

Manukineko avatar Jul 01 '23 01:07 Manukineko

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.

benjamin051000 avatar Aug 09 '23 00:08 benjamin051000

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...

benjamin051000 avatar Aug 09 '23 01:08 benjamin051000

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

benjamin051000 avatar Aug 09 '23 01:08 benjamin051000

I wonder if simply removing line 40 and decrementing the indices would fix it.

benjamin051000 avatar Aug 09 '23 01:08 benjamin051000

Feel free to make a PR!

syeopite avatar Aug 09 '23 01:08 syeopite

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 ???

gil-roboute avatar Oct 09 '23 23:10 gil-roboute

I did the same steps but I got an index out of bounds

amoN366 avatar Oct 13 '23 23:10 amoN366

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?

tbergeron avatar Oct 19 '23 21:10 tbergeron

Same problem here, adding "Title" does not work.

fliwatuet1900 avatar May 12 '24 11:05 fliwatuet1900

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.

ThatMatrix avatar Jul 03 '24 21:07 ThatMatrix

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.

gil-roboute avatar Jul 16 '24 06:07 gil-roboute

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

ThatMatrix avatar Jul 16 '24 13:07 ThatMatrix