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

Request feature, PowerShell Commands #31

Closed
Witchilich opened this issue Oct 17, 2019 · 1 comment
Closed

Request feature, PowerShell Commands #31

Witchilich opened this issue Oct 17, 2019 · 1 comment

Comments

@Witchilich
Copy link

I would love to use youtube-dl from the browser. So, I can launch PowerShell with youtube-dl [HREF] command.

@sparksnpa
Copy link

@restia666ashdoll

It's already possible to do this in its current form, I will share my setup that runs a few downloads at once. Basically I use it to use my tv cable credentials to download the nightly prime time shows we watch so we can watch them at our leisure. I use this along with filebot to automatically rename the shows and move them where I want them to be with the Plex formatting.

To use it all you do is right click on the link to the video you want, select the correct button, it will prompt you for the tv show title, not the episode name, (this helps filebot match it up and correctly rename it). It will create 3 batch files and rotate putting links in them and all you have to do is execute the 3 batches when your all done gathering your videos and it will download them 3 at a time.

You can easily create your own based on my crappy batch files. But hey it works how it is :).

The first batch file just allows for 1 button clear of the download batches as well as the lock files used. I simply call it before I start to gather the shows for the day. The second batch file takes the passed prompt (tv show title), as well as the URL and builds an execution string to download the file with youtube-dl and outputs it to 1 of 3 download bats. It will automatically add "S00E00" to the video file as well as it seems to help filebot recognize a tv show instead of a movie. You can add a 3rd button if you want to be able to run the resulting download batch files from the browser.

You will need to create at least two buttons, depending on what all you want them to do.

The first one set to pop up on "page" and "frame", call it clear (or something similar), set it to execute the following bat file:

@echo off
del "1.lock"
del "2.lock"
del "3.lock"
del "download_1.bat"
del "download_2.bat"
del "download_3.bat"

The second one set it to pop up on "link", "image", "video", "audio", set the arguement to "[PROMPT]" "[HREF]", tick the quotation option, call it youtube-dl, set it to execute the following bat file:

@echo off
if exist <path_of_bat>1.lock (
	del "<path_of_bat>1.lock"
	copy /y NUL <path_of_bat>2.lock >NUL
	goto:end
) else if exist <path_of_bat>2.lock (
	del "<path_of_bat>2.lock"
	copy /y NUL <path_of_bat>3.lock >NUL
	goto:end
)
) else if exist <path_of_bat>3.lock (
	del "<path_of_bat>3.lock"
	copy /y NUL <path_of_bat>1.lock >NUL
	goto:end
)

:end

if exist <path_of_bat>1.lock (
	@echo <path_of_bat>youtube-dl.exe --newline -R 1 -o "<path_to_store_downloads>%~1 - S00E00 - %%%%(title)s.%%%%(ext)s" -f mp4 --ignore-config --hls-prefer-native <extra_login_arg> %2 >> <path_of_bat>download_1.bat
)
if exist <path_of_bat>2.lock (
	@echo <path_of_bat>youtube-dl.exe --newline -R 1 -o "<path_to_store_downloads>%~1 - S00E00 - %%%%(title)s.%%%%(ext)s" -f mp4 --ignore-config --hls-prefer-native <extra_login_arg> %2 >> <path_of_bat>download_2.bat
)
if exist <path_of_bat>3.lock (
	@echo <path_of_bat>youtube-dl.exe --newline -R 1 -o "<path_to_store_downloads>%~1 - S00E00 - %%%%(title)s.%%%%(ext)s" -f mp4 --ignore-config --hls-prefer-native <extra_login_arg> %2 >> <path_of_bat>download_3.bat
)

Put both batch files in the same folder, replace <path_of_bat> with the path eg: c:\youtube-dl, replace <path_to_store_downloads> with the complete path to where your content gets saved eg: c:\downloads, replace <extra_login_arg> with any other arguments you need youtube-dl to use.

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

2 participants