tartube icon indicating copy to clipboard operation
tartube copied to clipboard

Add support for yt-dlp's --paths parameter

Open 1024mb opened this issue 3 years ago • 11 comments

Could you please add an option to use that? I use Classic Mode and using --paths to point to a temp folder would be great. Please add that option.

The way I think it could be added is with a box to specify the temp folder and another to specify the home path though if we are already choosing a download folder Tartube could just use that as the home path and only let us specify the temp one.

Another way could be just adding a box to disable or override the output directory option so it only passes the filename pattern as --output that way we can add in the Extra Command Line Options box the --paths parameter (if we add it now yt-dlp will ignore it because Tartube is passing a full path with the --output parameter). I prefer to do it this way so you don't have to maintain so many options.

1024mb avatar Jun 08 '21 08:06 1024mb

Added in v2.3.233.

Click Edit > General download options.... Click the Show advanced download options button if it's visible. Then click yt-dlp > Output or yt-dlp > Paths.

The interface isn't exactly what you suggested, but hopefully it meets your needs. If not, there is still time to tweak it before the next major release.

axcore avatar Jul 16 '21 15:07 axcore

Thank you!! It's much better than what I suggested.

One thing I want to ask you, I saw you let us use --break-on-existing but there is no way to customize the archive file path, can this be added?

EDIT1: There is also another thing. I've picked yt-dlp and choose a custom executable and when I click on "Update yt-dlp" in Classic mode I get this:

Starting update operation, installing/updating yt-dlp
..\..\..\mingw64\bin\python3.exe ..\..\..\mingw64\bin\pip3-script.py install --upgrade --no-dependencies youtube-dl
Collecting youtube-dl
  Downloading youtube_dl-2021.6.6-py2.py3-none-any.whl (1.9 MB)
Installing collected packages: youtube-dl
Successfully installed youtube-dl-2021.6.6
Update operation finished

EDIT2: Also I see in the output window that for some reason Tartube invokes yt-dlp using python (python3 C:\path\to\custom\ytdlp.exe -args) and it obviously fails, I had to choose local yt-dlp instead. I'm using Windows 10.

EDIT3: With verbose enabled I see yt-dlp doesn't recognize any ffmpeg installed, if I use yt-dlp manually it does detects it (it is in PATH). Adding --ffmpeg-location "C:\path to\ffmpeg" to the extra commands does solves this.

EDIT4: When a minimum disk space is set to auto stop downloads and it is reached it seems Tartube doesn't terminate all yt-dlp processes, some are still running, in fact the processes that actually do the data writting are the ones left running (for some reason yt-dlp creates another yt-dlp process every time is executed), this same error happens with yt-dlg too (after renaming yt-dlp to youtube-dl to make the gui use yt-dlp).

EDIT5: I should clarify a little bit about the EDIT4, it is not exactly like what happens with youtube-dlg, that application does terminates one of the pair yt-dlp processes but in this case it terminates the process that does the data writing/downloading -or at least, besides terminating one of the processes it makes that process to stop writing/downloading- so the processes that remain do nothing at all.

Also behavior when stopping is different, when I stop yt-dlg and it terminates one of the pair processes the application still waits (Stop button doesn't change to Download) as there are processes still running (so it recognizes that there are still yt-dlp -though now named youtube-dl- processes running) so I have to terminate them manually. Tartube on the other hand does thinks that all the processes were terminated. So, in short yt-dlg terminates the processes that write data -or at least it makes those processes to stop writing data but doesn't terminate them- and Tartube terminates the processes that do not write data.

1024mb avatar Aug 13 '21 07:08 1024mb

why can't use this image when using paths temp

candrapersada avatar Oct 11 '21 11:10 candrapersada

why can't use this image when using paths temp

Because you are supposed to use the path HOME.

1024mb avatar Oct 24 '21 07:10 1024mb

why can't use this image when using paths temp

Sorry, I don't understand your question. I have not used Tartube for 2 months and I have forgotten how it works :)

@1024mb Thanks for your edits, I will implement them when I have internet again.

axcore avatar Oct 24 '21 17:10 axcore

EDIT1 -There is also another thing. I've picked yt-dlp and choose a custom executable and when I click on "Update yt-dlp" in Classic mode I get this:

I am not able to reproduce this problem. Please show me the settings you have selected in Edit > System preferences > Downloads > Forks and Downloaders > File Paths, so I can make sure I'm trying the same setup.

EDIT3 With verbose enabled I see yt-dlp doesn't recognize any ffmpeg installed

Please clarify the exact setup you're using so I can try to reproduce it.

EDIT4, EDIT5

I have seen anything like this behaviour recently, it may have been some ancient yt-dlg problem. If you think it still exists on yt-dlp then I can look into that. Tartube does stop any processes it creates, but I haven't looked into yt-dlp threading very closely.

axcore avatar Mar 11 '22 08:03 axcore

In v2.3.447, you can fully customise the location of the archive file. See Edit > System preferences... > Operations > Archive

axcore avatar Mar 20 '22 16:03 axcore

My issue is that I have a fair amount of files that I get errno 2 on when trying to download (I think it is because of a path length issue), but I found that if I set the TEMP folder it can download them successfully then move them to the proper spot.

But as far as I can tell, I will have to have custom download options for each folder so I can set the proper HOME path to make sure the files end up in the right spot.

How can we tell Tartube to use the current working folder for the HOME path?

Thanks Axcore!

ceonelson avatar Apr 14 '22 11:04 ceonelson

My issue is that I have a fair amount of files that I get errno 2 on when trying to download (I think it is because of a path length issue), but I found that if I set the TEMP folder it can download them successfully then move them to the proper spot.

But as far as I can tell, I will have to have custom download options for each folder so I can set the proper HOME path to make sure the files end up in the right spot.

Is this Windows stuff? I'm not a Windows user, I don't know how that would be done.

How can we tell Tartube to use the current working folder for the HOME path?

You can't, the 'current working directory' does not exist, it is just an abstraction. (There is a python os.getcwd() function, but it won't give you what you want, every single time.)

If path length is an issue you can try these things:

  1. Right-click a channel, and select Channel actions > Set download destination > Use an external location. You can probably add HOME there. (I have not tested that.)

You must still update every channel/playlist in your database, but at least you won't have to create new download options every time.

  1. The obvious solution: download to C:\stuff rather than C:\folder\folder\folder\folder\stuff

  2. Limit the filename length. Edit > General download options... > Files > Filesystem > Limit filename length. But beware, this seems to be broken in yt-dlp at the moment.

axcore avatar Apr 20 '22 11:04 axcore

Am I able to use %(upload_date>%Y)s somehow for the path?

warrigt avatar Jun 27 '22 13:06 warrigt

Edit > General download options > Files > File names

In the box at the top, select "Custom"

Now you can select the upload date in the boxes near the bottom

axcore avatar Jun 27 '22 17:06 axcore