Package: cs.app.ydl
Convenient command line and library wrapper for youtube-dl.Latest release 20220318:YDLCommand.main: plumb options.parallel through to the OverYDL constructor.Bump required revision for cs.cmdutils.Theyoutube-dltool and associatedyoutube_dlPython module
are very useful for downloading media from various websites.
However, as an end user who almost never streams because of my
soggy internet link, I find fetching several items is quite serial and
visually noisy.This module provides a command line toolydlwhich:runs multiple downloads in parallel with progress barsprints the downloaded filename as each completesInteractively, I keep this shell function:ydl(){
  ( set -ue
    dldir=${DL:-$HOME/dl}/v
    [ -d "$dldir" ] || set-x mkdir "$dldir"
    cd "$dldir"
    command ydl ${1+"$@"}
  )
}which runs the downloader in my preferred download area
without tedious manualcding.Functionmain(argv=None)Main command line.ClassOverYDLA manager for multipleYDLinstances.MethodOverYDL.queue(self, *a, **kw):
Queue a fetch ofurland return aResult.MethodOverYDL.queue_iter(self, urls):
Queue the URLs of the iterableurls,
essentially a convenience wrapper for thequeuemethod.
Returns a list of theResults for each queued URL.MethodOverYDL.report(self, Rs=None):
Wrapper returningcs.result.report(.Rs).Rsdefaults tolist(self.Rs, the accumulatedResults.ClassYDLManager for a download process.MethodYDL.__init__(self, url, *, fstags, upd=None, tick=None, over_progress=None, sem, **kw_opts):
Initialise the manager.Parameters:url: the URL to downloadfstags: mandatory keyword argument, acs.fstags.FSTagsinstanceupd: optionalcs.upd.Updinstance for progress reportingtick: optional callback to indicate state changeover_progress: anOverProgressto which to add each newProgressinstancesem: a sharedSemaphoregoverning download parallelismkw_opts: other keyword arguments are used to initialise
the options for the underlyingYoutubeDLinstanceMethodYDL.bg(self):
Return theResultfor this download,
starting the download if necessary.PropertyYDL.output_filename:
The target output filename.MethodYDL.process_info(ie_result):
Process info hook called by youtube_dl, seems uncalled :-(ClassYDLCommand(cs.cmdutils.BaseCommand)ydlcommand line implementation.Command line usage:Usage: ydl [-f] [-j jobs] {URLs|-}...
    -f      Force download - do not use the cache.
    -j jobs Number of jobs (downloads) to run in parallel.
            Default: 4MethodYDLCommand.apply_defaults(self):
Initial defaults options.MethodYDLCommand.apply_opts(self, opts):
Command line main switches.MethodYDLCommand.main(self, argv):
Command line main programme.Release LogRelease 20220318:YDLCommand.main: plumb options.parallel through to the OverYDL constructor.Bump required revision for cs.cmdutils.Release 20210906:
New -j jobs options to control parallelism, default 4.Release 20210404:
Update for recent cs.cmdutils change.Release 20210306:
Assorted internal updates.Release 20200621:YDL.run: just catch the youtube_dl DownloadError.Changes to the default output filename template.Other minor internal changes.Release 20200615.1:
Add usage message to docstring.Release 20200615:Initial "daemon" mode, suitable for "tail -f .ydld-queue | ydl -", handy for keeping around in a tmux session.Assorted small bugfixes.Release 20200521:
Initial PyPI release.