Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How do I make it work with yt-dlp and with --config-locations "PATH to my config"? #79

Open
WhoMI7 opened this issue Dec 30, 2022 · 8 comments

Comments

@WhoMI7
Copy link

WhoMI7 commented Dec 30, 2022

I don't have a single clue even after trying to make it work for a whole hour.

@stax76
Copy link

stax76 commented Jan 3, 2023

My old Windows config:

Display Name: Download Video from YouTube (Windows/PowerShell)

Executable Name: wt

Arguments: -- pwsh -nologo -command "yt-dlp --ignore-errors --download-archive C:\External-Application-Button.txt --output 'C:\YouTube\%(channel)s - %(title)s.%(ext)s' ('[HREF]' -replace '&list=.+','')"

It's a bit complex, uses powershell to strip the playlist part of the URL to prevent a whole playlist being downloaded instead of a single file.

--download-archive keeps track of what was downloaded before to ensure things aren't downloaded many times.

Did you use yt-dlp as Executable Name? This won't work because yt-dlp is a console app, it will run hidden, similar as mpv runs console apps hidden.

PowerShell starts slow (250 ms), because of that I currently rewrite my command lines using Dash/Bash on Linux.

If you need something starting fast on Windows, have a look at Nushell, I recently migrated from Bash to Nushell.

@rp1231
Copy link

rp1231 commented Jan 3, 2023

@stax76
Would you mind sharing the Nushell version of the command line?

Thanks

@stax76
Copy link

stax76 commented Jan 3, 2023

I only have a powershell (Windows) and sh/dash (Linux) version.

gnome-terminal

--geometry 90x28+75+105 -- sh -c 'yt-dlp --ignore-errors --download-archive /someFolder/External-Application-Button.txt --output "/someFolder/YouTube/%(channel)s - %(title)s.%(ext)s" $(echo "[HREF]" | sed "s/&list=.*//")'

@rp1231
Copy link

rp1231 commented Jan 3, 2023

Thanks

@WhoMI7
Copy link
Author

WhoMI7 commented Jan 4, 2023

If you need something starting fast on Windows, have a look at Nushell

I installed nushell and it is in PATH.
Now what?
I tried setting Executable Name as nu but it doesn't work.
these are my arguments yt-dlp [HREF] --format "bestvideo+bestaudio/best" --sub-format best --sub-langs all,-live_chat --embed-subs --embed-metadata --embed-chapters --convert-subs srt --concurrent-fragments 10 --merge-output-format mkv --sponsorblock-mark all -o 'D:\Downloads\%(title)s.%(ext)s'
Not even cmd is working with this extension.
wt works fine though.

@memories169
Copy link

@BhaturaGuy Just set nushell as default profile on wt. It should work

@conradsrc
Copy link

conradsrc commented May 23, 2023

@stax76 do you or anyone else here know why I cannot get this to work with Windows Terminal using this extension? I had it working perfectly but never exported it before I was forced to do a fresh Windows install... and of course, now I can't recreate it. (Win10 Pro x64, Firefox 113.0.1 x64)

I always get a [error 2147942402 (0x80070002) when launching...] when passing ANY command to wt via cmd or pwsh, not just yt-dlp. For example, with wt as the executable name and the following arguments:

-- pwsh -nologo -command "ls"

I've tried so many variations of pwsh -c vs. cmd /c, quoting or not quoting the command going into the shell, checking or unchecking "Surround arguments with quote characters", different commands, not using -- or -nologo, etc.

Every single one of these executables is in my system %PATH% (wt, cmd, pwsh, yt-dlp) and I've done full reboots since any of that was touched so I know everything is working with the latest version of my environment. If I pass just a shell (e.g. cmd or pwsh) then it opens in wt without issue, but passing any commands to them, even extremely simple ones like dir to cmd or ls to pwsh give the same error.

Every issue I saw related to this against Terminal seemed to be related to either more basic syntax issues or stuff missing from their %PATH%; can't find anyone running it via a browser extension like this. I have it "working" by just not involving wt and using cmd as the executable and passing yt-dlp to that... but the fact that I used to have it working with Terminal and now can't recreate it is driving me nuts.

@stax76
Copy link

stax76 commented Aug 16, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants