Currently, the specifying a limit with `--max-downloads` doesn't cause **youtube-dl** to stop right after it has successfully downloaded that number of files.
Instead, it keeps iterating the playlist until another candidate file is found to download, only to then discovers that the limit was previously met. This unnecessary activity can actually take quite a while when a large playlist is already mostly downloaded.
This fix adds an additional tail-check on the `_num_downloads` condition so that it terminates immediately after finishing the last eligible file.
The end of the byte range is the first byte that is NOT part of the to
be downloaded range. So don't include it into the requested HTTP
download range, as this additional byte leads to a broken TS packet and
subsequently to e.g. visible video corruption.
Fixes#14748.