Giter Club home page Giter Club logo

youtube-dl-easy's Introduction

youtube-dl-easy

Script for running youtube-dl with basic options using PowerShell. Allows automatic download options, as well as manually choosing the formats.

Features

  • Download options for automatic best quality or manually chosen video and audio formats to combine
  • Download option for only audio or video
  • Optional use of command line arguments to override hard-coded variables
  • Support for downloading entire playlists
  • Update the downloader program from within the script

REQUIREMENTS

  • This is NOT a standalone script. It requires the youtube-dl program, which should be put in the same directory as this script. Download YouTube-dl here: https://yt-dl.org/

  • Alternatively, you can use this script with a fork of youtube-dl called "yt-dlp", which has more features and may work better. It is found here: https://github.com/yt-dlp/yt-dlp

  • Some download methods will require ffmpeg to be installed: https://ffmpeg.org/

Screenshot Preview

Script Screenshot

youtube-dl Links

Script / Code Parameters

You may wish/need to change certain parameters in the script code, located in the section called "PARAMETERS YOU MAY NEED/WISH TO CHANGE". This includes the location of the ffmpeg file, the output directory (default is 'outputs' folder in current directory) and filename, and options. See YouTube-dl documentation for more parameters.

Command Line Arguments

The script supports the following command line arguments:

  • -exe <string>: Set the name of the YouTube downloader executable (default: "yt-dlp.exe")
  • -desktop: Place the 'Outputs' folder on the desktop instead of the current directory
  • -options <string>: Manually set additional parameters for the YouTube downloader executable (default: "--no-mtime --add-metadata")
  • -debug: Display potentially helpful info for debugging, including resulting variable values

Running the Script & PowerShell Execution Policy

By default, you may not be able to run any PowerShell scripts unless you change Windows' execution policy.

You can change the execution policy just for the current process by running the following before running the script. Note that if you close the PowerShell window, it will reset the policy.

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process

Alternatively, because this script is signed, instead of "Unrestricted", you could use the "AllSigned" setting instead, like below. Note: If you changed anything inside the script at all, even optional settings, the signature will no longer be valid.

Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope Process

You can run the script by opening a PowerShell window in the folder with the script and entering this (after setting the execution policy if necessary, and don't forget the period):

.\"youtube-dl Easy Script.ps1"

Troubleshooting

If you come across weird errors, the first thing to try should be updating the youtube-dl program. You can do this using option # 7. YouTube-dl is updated pretty frequently, and they usually fix issues quickly when YouTube.com makes breaking changes.

If you encounter issues, you can use the -debug command line argument to display helpful information for troubleshooting.

youtube-dl-easy's People

Contributors

thiojoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

youtube-dl-easy's Issues

Latest release not Digitally signed

I believe the latest release of the script is not digitally signed, tried downloading it in multiple ways and none was signed after downloading...
Screenshot 2024-03-29 155826

Multiple Issues on Initial Test

I'm using the latest build of yt-dlp from here:
https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#installation > Windows x64

I'm trying your script for the first time using all defaults. Initial run results in the following error:

param : The term 'param' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.
At D:\Scripts\yt-dlp\youtube-dl Easy Script.ps1:51 char:1
+ param (
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (param:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

After choosing option 1, I'm seeing this error:
I see this everytime, regardless of option chosen...

yt-dlp.exe : WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "K0v9hnn24y8")
At D:\Scripts\yt-dlp\youtube-dl Easy Script.ps1:216 char:5
+     & .\$downloader_exe --list-formats $URL
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (WARNING: [youtu... "K0v9hnn24y8"):String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

I'm also seeing the script hang up here everytime:
[Metadata] Adding metadata to "Outputs\11 Cool Command Line Programs You Need to See.webm"

I noticed the Year property was populated with 55238

One other thing to note is that I have to close PowerShell after each test, as the download option never returns. It just downloads based on the option number I chose the first time.
Here we see the last line of options, and then it immediately starts downloading...

308     webm  2560x1440   60    |  421.48MiB  4403k https | vp09.00.50.08  4403k video only          1440p60, webm_dash

Running Command:   .\yt-dlp.exe  https://www.youtube.com/watch?v=K0v9hnn24y8 '--%' --no-mtime --add-metadata --ffmpeg-location "ffmpeg.exe" --output "Outputs\%(title)s.%
(ext)s" --ffmpeg-location "ffmpeg.exe" --output "Outputs\%(title)s.%(ext)s"
[youtube] Extracting URL: https://www.youtube.com/watch?v=K0v9hnn24y8
[youtube] K0v9hnn24y8: Downloading webpage
[youtube] K0v9hnn24y8: Downloading ios player API JSON
[youtube] K0v9hnn24y8: Downloading android player API JSON
yt-dlp.exe : WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "K0v9hnn24y8")
At D:\Scripts\yt-dlp\youtube-dl Easy Script.ps1:248 char:1
+ & .\$downloader_exe $format $URL '--%' $options #Final full command u ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (WARNING: [youtu... "K0v9hnn24y8"):String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
[youtube] K0v9hnn24y8: Downloading m3u8 information
[info] K0v9hnn24y8: Downloading 1 format(s): 308+251
[download] Destination: Outputs\11 Cool Command Line Programs You Need to See.f308.webm

[download]   0.0% of  421.48MiB at  580.53KiB/s ETA 12:23

I've tried clearing the following variables at the beginning of the script, but that didn't solve the issue with auto-downloading.

$choice = ''
$ffmpeg_location = ''
$output_location = ''
$downloader_exe = ''
$other_options = ''

Thanks...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.