NAME

youtube-dl-play - Download videos with youtube-dl *and* play them while downloading

VERSION

This document describes version 0.004 of youtube-dl-play (from Perl distribution App-YoutubeDlUtils), released on 2020-09-09.

SYNOPSIS

Usage:

% youtube-dl-play [OPTS] <URL_OR_VIDEO_ID>...

Example:

% youtube-dl-play https://www.youtube.com/watch?v=hoKvtNawdS8

DESCRIPTION

You want to download a video but want to see it while it downloads (and of course do not want to download it twice)? This is a wrapper for youtube-dl which does the following for each argument:

  • Run youtube-dl with --get-filename

    To get the output filename, first this is executed:

    % youtube-dl [OPTS] --get-filename <URL_OR_VIDEO_ID>
  • Run youtube-dl that outputs to stdout and pipe it to mpv

    % youtube-dl [OPTS] -o - <URL_OR_VIDEO_ID> | mpv --record-file <OUTPUT_FILENAME> -

Some caveats:

  • The media-player program mpv is required

  • Each command-line argument must be a video ID or video URL, not a playlist URL

  • Do not request a format that is unstreamable

    For example, <-f 135+140> (merging of video-only 720p MP4 and audio-only AAC stream).

  • Seeking (e.g. jump-forward) during playing currently will screw up the recording

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-YoutubeDlUtils.

SOURCE

Source repository is at https://github.com/perlancar/perl-App-YoutubeDlUtils.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-YoutubeDlUtils

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

Other youtube-dl wrappers in App::YoutubeDlUtils and App::YoutubeDlIf.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.