tubesync icon indicating copy to clipboard operation
tubesync copied to clipboard

Saving Watch Later Playlist

Open SheepDomination opened this issue 2 years ago • 45 comments

I want to add a watch later playlist source. Although the directory which I want to save the media into is the same downloads folder which I setup TubeSync although I get this error; You cannot specify a directory outside of the base directory (/downloads) ?

And is there any means to which I can pick which videos from the watch later play list to download ?

SheepDomination avatar Nov 26 '23 15:11 SheepDomination

The error is because you're trying to save downloads outside of the download root, check the source directory. Try setting a name like watch-later. If you've specified a full path like /something/watch-later this isn't inside the defined download root of /download and will throw the error you're seeing. All downloads must be within the /downloads root to make sense and be easily map-able via volumes from your container runtime.

meeb avatar Nov 27 '23 04:11 meeb

Although now I do not see any of the videos from the accounts watch later list ?

SheepDomination avatar Nov 27 '23 23:11 SheepDomination

If you are trying to sync a private playlist (a playlist that requires you to be logged into a browser to view) you'll need to export your cookies and use those with tubesync - effectively you need to "log in" to YouTube within tubesync. See:

https://github.com/meeb/tubesync/blob/main/docs/using-cookies.md

meeb avatar Nov 28 '23 04:11 meeb

If you are trying to sync a private playlist (a playlist that requires you to be logged into a browser to view) you'll need to export your cookies and use those with tubesync - effectively you need to "log in" to YouTube within tubesync. See:

https://github.com/meeb/tubesync/blob/main/docs/using-cookies.md

Do you know how to do this what is mentioned in the link; I'm using Edge and I've searched but can't find how ?

SheepDomination avatar Dec 03 '23 15:12 SheepDomination

Absolutely no idea, sorry. I've never used Edge and this is well outside the scope of TubeSync itself. I'd assume a plugin?

https://microsoftedge.microsoft.com/addons/search/export%20cookies

meeb avatar Dec 03 '23 15:12 meeb

I've uploaded my cookies.txt file to /config folder but TubeSync is still returning errors by which are; source has permanent failures ?

SheepDomination avatar Dec 04 '23 00:12 SheepDomination

Try deleting and re-adding the source, then check the logs of the container for details.

meeb avatar Dec 04 '23 06:12 meeb

Try deleting and re-adding the source, then check the logs of the container for details.

I'm doing the exact URL for the Watch Later list for the user Account, although I get an error;

Invalid URL, the URL must for a "YouTube channel" must be in the format of "https://www.youtube.com/SOMECHANNEL". The error was: path "/playlist" is not valid.

SheepDomination avatar Dec 04 '23 13:12 SheepDomination

Click the "add playlist" button not "add channel".

meeb avatar Dec 04 '23 13:12 meeb

Click the "add playlist" button not "add channel".

A source with this key already exists; that source is, YouTube playlist.

SheepDomination avatar Dec 04 '23 14:12 SheepDomination

Then you've not deleted the old source yet.

meeb avatar Dec 04 '23 14:12 meeb

Now I got this; Your new source has been created. If you have added a very large source such as a channel with hundreds of videos it can take several minutes or up to an hour for media to start to appear.

I assume all is working ?

SheepDomination avatar Dec 04 '23 14:12 SheepDomination

I'm getting 2 errors in the tasks. Failed to extract Data, no Metadata was returned ?

SheepDomination avatar Dec 04 '23 14:12 SheepDomination

That would imply that either your playlist URL doesn't work or your cookies weren't loaded properly. Check the logs for the word "cookies" and see if your cookies.txt file was properly loaded. If it was it would have been noted in the logs. This is in the container logs themselves, not in the web UI.

meeb avatar Dec 04 '23 14:12 meeb

That would imply that either your playlist URL doesn't work or your cookies weren't loaded properly. Check the logs for the word "cookies" and see if your cookies.txt file was properly loaded. If it was it would have been noted in the logs. This is in the container logs themselves, not in the web UI.

I don't see anything related to cookies.txt only, failed to load play list a few times among other things unrelated to cookies.txt ?

SheepDomination avatar Dec 04 '23 14:12 SheepDomination

Then you may not have exported or saved your cookies.txt from youtube.com correctly. If working you'll get a note like

[youtube-dl] using cookies.txt from: /some/path/to/cookies.txt

in the container logs.

meeb avatar Dec 04 '23 14:12 meeb

sync.youtube.YouTubeError: Failed to extract_info for "https://www.youtube.com/playlist?list=WL": No metadata was returned by youtube-dl, check for error messages in the logs above. This task will be retried later with an exponential backoff.

This is the error to which the log is returning; same thing, its related to the cookies.txt file ?

SheepDomination avatar Dec 04 '23 16:12 SheepDomination

Probably, yes. That error just means "yt-dlp tried to read the playlist and couldn't". Likely, the reason is because your cookies file isn't exported correctly or can't be read. If you don't see the [youtube-dl] using cookies.txt from: ... in your logs it won't work.

meeb avatar Dec 05 '23 05:12 meeb

Honestly, I don't know what is going wrong because I'm doing everything that I know correctly. I'm exporting out the cookies.txt file in Netscape format for only the URL specifically for accounts Watch Later list and all I get is the same error. And that error is, no metadata was returned by youtube-dl.

I have an extension for my browser but the author of that extension just tells me, there are no problems; it's related to youtube-dl not understanding.

I'm either going to never get this to work or someone hopefully can help me investigate what is causing the issue ?

SheepDomination avatar Dec 05 '23 17:12 SheepDomination

Well, if you're confident that the cookies.txt file is correct then the only thing it can be is you've saved it in the wrong place or the file ownership or permissions are wrong. Paste the output of this command run on the host:

$ docker exec -ti tubesync ls -lat /config

meeb avatar Dec 05 '23 18:12 meeb

This looks similar to the problem I have with the Watch Later playlist. #413 I've just tried it again and it's still a problem. Looks like yt-dlp is still corrupting the cookies file so that it can't use it. There hasn't been an update in yt-dlp since then. I see someone has tested a patch to fix an issue with members-only cookies, so hopefully that will be the fix we need.

ShadowfootNZ avatar Dec 07 '23 05:12 ShadowfootNZ

Thanks for looking into it. Hopefully if there is an issue here it'll get fixed with a new yt-dlp release. I don't have a Google account myself so I can't test things like watch later playlists so I'm reliant on accurate issues and logs to debug problems.

meeb avatar Dec 07 '23 05:12 meeb

Well, if you're confident that the cookies.txt file is correct then the only thing it can be is you've saved it in the wrong place or the file ownership or permissions are wrong. Paste the output of this command run on the host:

$ docker exec -ti tubesync ls -lat /config
drwxr-xr-x 1 app  users     84 Dec  8 12:10 .
-rwxr-xr-x 1 app  users 380928 Dec  8 12:10 db.sqlite3
drwxr-xr-x 1 app  users     22 Dec  5 12:06 config
drwxr-xr-x 1 app  users     66 Dec  4 10:00 video
-rwxr-xr-x 1 app  users    825 Nov 27 14:18 compose.yaml
drwxr-xr-x 1 root root     254 Nov 26 09:28 ..
drwxr-xr-x 1 app  users      0 Nov 16 08:49 downloads

The output as you requested ?

SheepDomination avatar Dec 09 '23 10:12 SheepDomination

That would imply your volumes defined in your compose.yaml are wrong and your cookies.txt file is in the wrong folder inside the container. What are your volumes in your compose.yaml for TubeSync?

meeb avatar Dec 10 '23 06:12 meeb

My volumes are:

/volume1/docker/tubesync:/config
/volume1/docker/tubesync:/downloads

SheepDomination avatar Dec 10 '23 14:12 SheepDomination

OK, so your volumes are very wrong. Try (after making sure the directories exist on the host):

/volume1/docker/tubesync/config:/config
/volume1/docker/tubesync/downloads:/downloads

And drop cookies.txt into your config directory. It's not being picked up in the container (and not working) because you have it at /config/config/cookies.txt and not /config/cookies.txt.

Re-using the same directory twice as a volume on the host usually makes little sense, certainly doesn't for TubeSync anyway, use two different directories. Also, don't put config on a network drive.

meeb avatar Dec 11 '23 02:12 meeb

OK, so your volumes are very wrong. Try (after making sure the directories exist on the host):

/volume1/docker/tubesync/config:/config
/volume1/docker/tubesync/downloads:/downloads

And drop cookies.txt into your config directory. It's not being picked up in the container (and not working) because you have it at /config/config/cookies.txt and not /config/cookies.txt.

Re-using the same directory twice as a volume on the host usually makes little sense, certainly doesn't for TubeSync anyway, use two different directories. Also, don't put config on a network drive.

The cookies.txt file is located in /docker/tubesync/config/cookies.txt Although tubesyncerrro

SheepDomination avatar Dec 11 '23 12:12 SheepDomination

I meant inside the container the file needs to be at /config/cookies.txt which it currently is not. I don't wish to sound antagonistic here, but these are issues to do with the basics of running containers and not really anything to do with TubeSync. If you make the modifications I have suggested to your volumes it should work.

meeb avatar Dec 11 '23 13:12 meeb

I meant inside the container the file needs to be at /config/cookies.txt which it currently is not. I don't wish to sound antagonistic here, but these are issues to do with the basics of running containers and not really anything to do with TubeSync. If you make the modifications I have suggested to your volumes it should work.

The cookies.txt file is placed in the directory path of /config/cookies.txt; although it still is not working ?

Others I've run this issue by, have informed me it's the issue with the container as the container file I'm running is working when run.

SheepDomination avatar Dec 11 '23 22:12 SheepDomination

It is not TubeSync. Either it's going to be a) an update required upstream in yt-dlp b) the way you've exported your cookies or c) the cookies file is not being loaded (wrong place, permissions etc).

Try the same debug steps again if you think you've fixed it:

$ docker exec -ti tubesync ls -lat /config

and check the logs for [youtube-dl] using cookies.txt from: .... If your cookies.txt file is now in the right place you will see this line in the logs.

meeb avatar Dec 12 '23 03:12 meeb