rg3/youtube-dl — pull request #2723 by AGSPhoenix (2014-04-07 23:36:37+00:00)
Title: Add a postprocessor to concatenate files in a playlist

It may not be pretty, but it friggin' works. I did some initial testing with The Daily Show, but I have no idea how it handles other sites. Of particular concern is non-MP4 formats. Currently, the output file is always an MP4 container (this should be fixed), since I have concerns about it breaking with obscure containers. I've tested AVI, FLV, MP4, and MKV (they work), but there are dozens of others I haven't tested. For the time being, MP4 seems a reasonable default, since just about everything can play it.

This patch changes a few interfaces, most notably adding a return value to the process_info() function in YoutubeDL.py. Also, a 'saved-filename' key is added to the dictionary returned by process_video_result(). Also, run_ffmpeg_multiple_files() now accepts an optional list argument called preopts, for arguments that need to go before the input files. (Oh, ffmpeg. You so silly.)

The command line option is `--join`. Also, joining silently fails if the IE doesn't return "playlist" as the `_type`. Also, I have no idea what happens if you specify multiple URLs that are each a playlist. Or if you specify some that are and some that aren't. Or if the items in the playlist have different formats. Or something else I forgot in the time it took me to write out those other three.

I can't think of anything else to add to this wall of text, and getting acquainted with the youtube-dl internals has left my brain a pile of mush, so beware of mistakes both large and small. Now if you'll excuse me, I've got about a month's worth of Daily Show to catch up on.