FreeTubeApp / FreeTube

An Open Source YouTube app for privacy
https://freetubeapp.io/
GNU Affero General Public License v3.0
12.44k stars 761 forks source link

Import Playlists #1016

Closed codewizkid closed 2 months ago

codewizkid commented 3 years ago

It would be great if you could let us import how playlists from YouTube. I have them all exported already, just nowhere to import...

xznhj8129 commented 3 years ago

Same here, since they eliminated the Export function i had to pry them out of Google's hands with a BeautifulSoup script and i'd really like to be able to make use of them

GilgusMaximus commented 3 years ago

At the moment you can only import playlists by editing the corresponding file. But playlists are not implemented in the final form at the moment, so this will have to wait until then.

Then you can import each playlist into their own respective FreeTube playlists

anonaddict commented 2 years ago

import from csv would be nice as I imagine many people, myself included have already long since deleted their google accounts

iacore commented 1 year ago

I'd like to add this feature. Where should I start?

iacore commented 1 year ago

Also, import history from Youtube takeout is broken. The .json file is not visible in the file picker. Should I open a new issue?

efb4f5ff-1298-471a-8973-3d47447115dc commented 1 year ago

@iacore are u sure its broken in the latest nightly build.

iacore commented 1 year ago

I have trouble downloading it. Github expire the link on network failure

aleksejrs commented 1 year ago

@efb4f5ff-1298-471a-8973-3d47447115dc, this is not implemented. There is only one playlist (saved videos), so there is nowhere to import YouTube playlists.

tbergeron commented 9 months ago

Can't we import takeout youtube playlists? (csv) That'd be amazing, the csv file only contains video IDs and dates... wouldn't be that hard to implement. That way we'd be able to import our watch history and any playlists.

iacore commented 9 months ago

Can't we import takeout youtube playlists? (csv) That'd be amazing, the csv file only contains video IDs and dates... wouldn't be that hard to implement. That way we'd be able to import our watch history and any playlists.

You can import first to Invidious, then export. I don't think importing playlists works yet.

jimrs commented 8 months ago

Can't we import takeout youtube playlists? (csv) That'd be amazing, the csv file only contains video IDs and dates... wouldn't be that hard to implement. That way we'd be able to import our watch history and any playlists.

You can import first to Invidious, then export. I don't think importing playlists works yet.

how, please? from what I saw, invidious can export playlists in json/xml format. Freetube accepts only .db format.

iacore commented 8 months ago

how, please? from what I saw, invidious can export playlists in json/xml format. Freetube accepts only .db format.

I don't think importing playlists works yet.

absidue commented 8 months ago

FreeTube doesn't support local playlists yet, so importing them is of course not supported either. FreeTube only has a saved video list, so the import and export is for that saved video list database, so you can export and import it from one FreeTube installation to another.

fartboygh commented 8 months ago

Can't we import takeout youtube playlists? (csv) That'd be amazing, the csv file only contains video IDs and dates... wouldn't be that hard to implement. That way we'd be able to import our watch history and any playlists.

This is exactly what's needed. The ability to use your youtube takeout in the import playlists button.

absidue commented 8 months ago

Again as mentioned above, FreeTube doesn't support local playlists yet, only a saved video list, so even if we added support for importing them, you wouldn't be able to see or use them in any way in FreeTube until local playlists are implemented.

fartboygh commented 8 months ago

When do you think that feature will make it in?

efb4f5ff-1298-471a-8973-3d47447115dc commented 8 months ago

No ETA

Hate9 commented 3 months ago

Hey, so, obviously this isn't a final solution to the playlists import thing, but here's a php script I whipped up in a few hours to turn the takeout csv exports into a freetube-compatible .db file!

Fair warning, it has no error-handling, and has only been tested on an old takeout export from 2022 (for some reason I can't download a new one rn, which is aggravating af), but it should work for current ones too. Also, I've only tested it on linux.

https://gitlab.com/MayESchaefer/google-takeout-playlists-to-freetube-import/

EDIT: I have now tested it on a recent export, and it doesn't work - apparently they changed their format somewhat. I'll fix it and update this comment when it's done.

EDIT: I've updated it, and it now works with current Takeout exports.

Lukilei commented 3 months ago

Hi, @Hate9 thanks for your efforts and I wanted to ask:

Do you think this would also work on windows and if yes how can I start it?

And also I wanted to ask why an API is required. I thought the id's in a youtube playlist takeout csv file are just the last part of youtube.com/watch?v=... so just a part of a normal link and I can also use them as such. But maybe that has also changed with new takeouts?

Hate9 commented 3 months ago

@Lukilei it should work on windows, but you'll need to install php and run it with that. here's the set of guides on setting it up, and here's how to run the thing after that.

the reason it needs to access the api is that there's information that's supposed to be in freetube's playlist files that isn't included in the takeout export, like video thumbnail urls and such.

Lukilei commented 3 months ago

@Hate9 thanks for the quick response and help. I've sorted out all the stuff with php and got that working.

I've learned that the file which has to be converted has to be named playlists.csv now when I launch the program it doesn't give me errors anymore it just says nothing and it creates a file but it's empty.

You said it's only been tested on older takeouts so maybe there lays the issue. If it helps, the present document structure is: Video ID,Playlist video creation timestamp

Also the whole API thing makes sence, it woudn't be an issue for a native Freetube importer I think but since you're converting...

Hate9 commented 3 months ago

@Lukilei it's been updated to work with current exports. you need to point it to the folder containing all of your playlists: playlists.csv is one of the files in current exports, but all of the other playlist files will need to be in the folder too. takeout should give you a subfolder with all your playlist csvs and a playlists.csv file.

Hate9 commented 3 months ago

to elaborate, playlists.csv just has some of the playlist metadata in it, the other files are what have the videos.

Hate9 commented 3 months ago

@Lukilei ok, do you have discord or something? I don't wanna clog up this issue with troubleshooting a completely different piece of software. my discord is REDACTED (you should have the username in your email notification for this reply).

efb4f5ff-1298-471a-8973-3d47447115dc commented 2 months ago

Closing in favor of https://github.com/FreeTubeApp/FreeTube/issues/5057