Coder Social home page Coder Social logo

hmz-x / dl Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 29 KB

POSIX compliant script for downloading content to a specified directory using youtube-dl and then converting using ffmpeg.

License: GNU General Public License v3.0

Shell 100.00%

dl's Introduction

POSIX Compliant Youtube-dl And Ffmpeg Automator

POSIX compliant script for downloading content to a specified directory using youtube-dl and then converting using ffmpeg.

To change the default options to suit your needs see 'Basic Configuration' in dl.sh.

Usage

Usage: dl.sh [-e|--extension FILE_EXTENSION] [-s|--skip-ffmpeg]
[--youtube-dl YOUTUBE-DL_OPTION...] [--ffmpeg FFMPEG_OPTION...] [-h|--help] [-v|--version]

Everything read after --youtube-dl or --ffmpeg is considered an option for the corresponding program. youtube-dl option interpretation comes to an end once --ffmpeg is met or vice versa. --extension FILE_EXTENSION, --skip-ffmpeg, --version and --help should all precede --youtube-dl or --ffmpeg in order for them to be interpreted as options passed to dl.sh.

For instance, in the example below, the options -f bestaudio -u $USER -p $PASSWD are interpreted by youtube-dl and, and -vol 256 -i is interpreted by ffmpeg, not dl.sh.

dl.sh --youtube-dl -f bestaudio -u $USER -p $PASSWD --ffmpeg -vol 256 -i

-i flag for ffmpeg should come last since dl.sh calls ffmpeg as such:

eval "ffmpeg ""$ffmpeg_opt"" \"$file\" \"$new_file\""

where "$ffmpeg_opt" is all the options passed to ffmpeg, "$file" is the input file and "$new_file" is the output file.

--extension FILE_EXTENSION determines the file extension that the content will be converted into. --skip-ffmpeg allows for dl.sh to skip ffmpeg conversion.

Configuration

By default dl.sh sets ~/.dl.conf as its configuration file. Here's what the contents of ~/.dl.conf should look like:

"$HOME/$OUT_DIR"
https://www.example.com/1
https://www.example.com/2
https://www.example.com/3
https://www.example.com/4

where the first line is interpreted as the directory to which the content will be downloaded to. eval is used for interpretation thus please use quotes whenever possible. Rest of the lines should all be valid URLs to downloadable content. If the directory in the configuration file doesn't exist, it will be created. "$HOME", ~, 'My Home 123' are all valid directory names. (Don't forget to use quotes!)

LICENSE

dl.sh is free/libre software. This program is released under the GPLv3 license, which you can find in the file LICENSE.txt.

dl's People

Contributors

hmz-x avatar

Stargazers

Arut++ avatar Michael McMahon avatar kevin avatar  avatar

Watchers

 avatar

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.